public ICollection <Domain.FormItems> ConvertFormItemDGVToFormItemList(DataGridView formItemsDGV) { //Data List Initialization ICollection <Domain.FormItems> formItemData_List = new List <Domain.FormItems>(); //Copy data from data grid view and populate addListData foreach (DataGridViewRow row in formItemsDGV.Rows) { String BudgetPool = row.Cells["BudgetPool"].FormattedValue.ToString(); String ItemCode = row.Cells["ItemCode"].FormattedValue.ToString(); String ItemDesc = row.Cells["ItemDesc"].FormattedValue.ToString(); String Quantity = row.Cells["Quantity"].FormattedValue.ToString(); String Unit = row.Cells["Unit"].FormattedValue.ToString(); String UnitPrice = row.Cells["UnitPrice"].FormattedValue.ToString(); String Currency = row.Cells["Currency"].FormattedValue.ToString(); //DateTime Parse DateTime ROS_Date = DateTime.Parse(row.Cells["ROS_Date"].FormattedValue.ToString()); String Comments = row.Cells["Comments"].FormattedValue.ToString(); String AC_No = row.Cells["AC_No"].FormattedValue.ToString(); Domain.FormItems addItem = new Domain.FormItems(BudgetPool, ItemCode, ItemDesc, Quantity, Unit, UnitPrice, Currency, ROS_Date, Comments, AC_No); formItemData_List.Add(addItem); } return(formItemData_List); }
public ICollection <Domain.FormItems> GetDomainFormItems(ICollection <FormItem> formItems, String bpNo) { ICollection <Domain.FormItems> formItemsData = new List <Domain.FormItems>(); foreach (FormItem item in formItems) { Domain.FormItems temp = new Domain.FormItems(bpNo, item.ItemCode, item.ItemDesc, item.Quantity.ToString(), item.Unit, item.UnitPrice.ToString(), item.Currency, item.ROS_Date, item.Comments, item.AC_No); formItemsData.Add(temp); } return(formItemsData); }