This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - .net Integration

krish80 - Tuesday, December 29, 2009 5:15 AM:

Hi,

I have created one form in visual studio 2008. In that form i have add 4 controls.

          1. file upload control 2. button control (Upload) 3. Gridview control 4. button control (Save to Aras)

(Note : once i select the excel file & upload the file through File Upload control the data's  will show in the Gridview control. The excel data's columns like : empname, empno, dept, emailid)

Step 1: i copied this form (default.aspx, default.aspx.cs)  to  ..clientscriptsone   this folder.

Step 2: I have created one Itemtype (empdetails) in Aras and created the properties as same as EXCEL columns. (like : empname, empno, dept, emailid)

Step 3: I add that default.aspx form to this empdtails itemtype - View 

Result : I can see the form and if i select the excel file i can view it in Gridview.

 

Request : I want to save this data's  to empdetails (ItemType - ARAS) which is shown in the gridview. Pls guide me how to do this.

 

Thanks 

RK

 

 

 

 

 



tstickel - Monday, January 4, 2010 11:53 AM:

RK

From your problem statement I believe that, in Step 3, you added default.aspx as the TOC View Start Page.  This implies that
default.aspx is intended to display a grid of all of your employee data, not just the data for one employee.

If that is correct, then what you have to do is to is create on OnClick event for your button control (Save to Aras).  The Javascript code
for that event would look something like this:


for (var row = 1; i < numrows; i++) {
  var emplitem = top.aras.newItem("empdetails","add");
  emplItem.setProperty("empname",gridview(row,col1).value);
  emplItem.setProperty("empno",gridview(row,col2).value);
  .....
  var res = emplItem.apply();
}

I do not know how you access the cells in your gridview, so I just used a generic gridview(row,col).value to retrieve the value in
a certain row/column.  Your code would have to be more complicated, assuming that it has to handle employee adds, updates and possibly deletes.