public List<Custom_Invoice_B> Get_Collection(int ID) { List<Custom_Invoice_B> _List_Collection = new List<Custom_Invoice_B>(); DataTable dt = Custom_Invoice_DA.Get_Collection(ID); foreach (DataRow row in dt.Rows) { Custom_Invoice_B _Custom_Invoice_B = new Custom_Invoice_B(); _Custom_Invoice_B.ID = int.Parse(row["ID"].ToString()); //if (row["CTN_Unit"].ToString() != "") // _Custom_Invoice_B.CTn_Unit = int.Parse(row["CTN_Unit"].ToString()); if (row["Proforma_Invoice_ID"].ToString() != "") _Custom_Invoice_B.Proforma_Invoice_ID = int.Parse(row["Proforma_Invoice_ID"].ToString()); _Custom_Invoice_B.Marks_And_Nos = row["Marks_And_Nos"].ToString(); _Custom_Invoice_B.Article_ID = int.Parse(row["Article_ID"].ToString()); _Custom_Invoice_B.Description = row["Description"].ToString(); //_Custom_Invoice_B.HS_Code = row["HS_Code"].ToString(); if (row["Quantity"].ToString() != "") _Custom_Invoice_B.Quantity = int.Parse(row["Quantity"].ToString()); if (row["Quantity_Unit"].ToString() != "") _Custom_Invoice_B.Quantity_Unit = int.Parse(row["Quantity_Unit"].ToString()); if (row["Net_Weight"].ToString() != "") _Custom_Invoice_B.Net_Weight = float.Parse(row["Net_Weight"].ToString()); if (row["Net_Weight_Unit"].ToString() != "") _Custom_Invoice_B.Net_Weight_Unit = int.Parse(row["Net_Weight_Unit"].ToString()); if (row["Gross_Weight"].ToString() != "") _Custom_Invoice_B.Gross_Weight = float.Parse(row["Gross_Weight"].ToString()); if (row["Gross_Weight_Unit"].ToString() != "") _Custom_Invoice_B.Gross_Weight_Unit = int.Parse(row["Gross_Weight_Unit"].ToString()); if (row["Unit_Price"].ToString() != "") _Custom_Invoice_B.Unit_Price = float.Parse(row["Unit_Price"].ToString()); if (row["Unit_Price_Unit"].ToString() != "") _Custom_Invoice_B.Unit_Price_Unit = int.Parse(row["Unit_Price_Unit"].ToString()); //if (row["Amount"].ToString() != "") // _Custom_Invoice_B.Amount = float.Parse(row["Amount"].ToString()); _List_Collection.Add(_Custom_Invoice_B); } return _List_Collection; }
public List<Custom_Invoice_B> GetCustomCollectionByCustomId(int Custom_Invoice_ID) { List<Custom_Invoice_B> List_Custom_Info = new List<Custom_Invoice_B>(); DataTable dt = Custom_Invoice_DA.GetCustomCollectionByCustomId(Custom_Invoice_ID); foreach (DataRow row in dt.Rows) { Custom_Invoice_B _Custom_Invoice_B = new Custom_Invoice_B(); _Custom_Invoice_B.Proforma_Invoice_ID = int.Parse(row["Proforma_Invoice_ID"].ToString()); _Custom_Invoice_B.Article_ID = int.Parse(row["Article_ID"].ToString()); //_Custom_Invoice_B.Customer_Item_Code = row["Style"].ToString(); //_Custom_Invoice_B.HS_Code = row["HSCOde"].ToString(); if (row["QTY"].ToString() != "") _Custom_Invoice_B.Quantity = int.Parse(row["QTY"].ToString()); if (row["Unit_ID1"].ToString() != "") _Custom_Invoice_B.Quantity_Unit = int.Parse(row["Unit_ID1"].ToString()); if (row["Unit_Price"].ToString() != "") _Custom_Invoice_B.Unit_Price = float.Parse(row["Unit_Price"].ToString()); if (row["Unit_ID2"].ToString() != "") _Custom_Invoice_B.Unit_Price_Unit = int.Parse(row["Unit_ID2"].ToString()); //if (row["Net_Wt_PerUnit"].ToString() != "") // _Custom_Invoice_B.Net_Weight = float.Parse(row["Net_Wt_PerUnit"].ToString()); //if (row["Unit"].ToString() != "") // _Custom_Invoice_B.Net_Weight_Unit = int.Parse(row["Unit"].ToString()); //if (row["Gross_Wt_PerCTN"].ToString() != "") // _Custom_Invoice_B.Gross_Weight = float.Parse(row["Gross_Wt_PerCTN"].ToString()); //if (row["Gross_Wt_Unit"].ToString() != "") // _Custom_Invoice_B.Gross_Weight_Unit = int.Parse(row["Gross_Wt_Unit"].ToString()); List_Custom_Info.Add(_Custom_Invoice_B); } return List_Custom_Info; }