hadoop hadoop

hadoop hadoop

  • NA
  • 159
  • 50.7k

get the data of GridViewRow from one class to another class

May 22 2015 2:47 AM
I've a class "get_productStock.cs" inside "content" folder. Here I am using GridView. I've to pass the the data of GridViewRow to another class "ClsStockMgmt.cs".
This "ClsStockMgmt.cs" is inside folder AppCode -> BusinessObject -> "ClsStockMgmt.cs". how can I do this?
My current approach is I am calling the class in "get_productStock.cs" and pass the data of GridViewRow as object to "ClsStockMgmt.cs"
 
//***** my current appraoch *****//
// get_productStock.cs
private ClsStockMgmt.MgmtGeneral SetStockForAllyGroups(GridViewRow selectedRow, string userName)
{
ClsStockMgmt.MgmtGeneral obj = new ClsStockMgmt.MgmtGeneral();
obj.ProductNumber_Ally = CleanText(((HiddenField)selectedRow.FindControl("hidden_product_number")).Value);
obj.ProductQuantity_Ally = CleanText(selectedRow.Cells[12].Text);
obj.ProductRetailer_Ally = userName;
obj.ProductOwnerId_Ally = Session["userId"].ToString();
return obj;
}
// ClsStockMgmt.cs
public class MgmtGeneral
{
public string ProductNumber_Ally { get; set; }
public string ProductQuantity_Ally { get; set; }
public string Pay_Parent_Agent_Cd { get; set; }
public string ProductRetailer_Ally { get; set; }
public string ProductOwnerId_Ally { get; set; }
}
// do my stuff
but now I want to pass the values of GridViewRow to ClsStockMgmt.cs without calling the method of ClsStockMgmt suppose by making object of GridViewRow and pass to another class. I want to change the approach of passing data.
Is it possible or not?

Answers (1)