private GrnDetail CreateGRNObject(DataRow dr) { try { GrnDetail detail = new GrnDetail(); detail.AlreadyReceivedQty = Convert.ToDouble(dr[CON_FIELD_ALREADYRECEIVEDQTY]); detail.AmendmentNo = Convert.ToInt32(dr[CON_FIELD_AMENDMENTNO]); detail.ChallanQty = Convert.ToDouble(dr[CON_FIELD_CHALLANQTY]); detail.GRNNo = Convert.ToString(dr[CON_FIELD_GRNNO]); detail.InvoiceQty = Convert.ToDouble(dr[CON_FIELD_INVOICEQTY]); detail.ItemCode = Convert.ToString(dr[CON_FIELD_ITEMCODE]); detail.ItemDescription = Convert.ToString(dr[CON_FIELD_ITEMDESCRIPTION]); detail.ItemId = Convert.ToInt32(dr[CON_FIELD_ITEMID]); detail.PONumber = Convert.ToString(dr[CON_FIELD_PONUMBER]); detail.POQty = Convert.ToDouble(dr[CON_FIELD_POQTY]); detail.MaxQty = Convert.ToDouble(dr[CON_FIELD_MAXQTY]); detail.PurchaseUOM = Convert.ToString(dr[CON_FIELD_PURCHASEUOM]); detail.SerialNo = Convert.ToInt32(dr[CON_FIELD_SERIALNO]); detail.Weight = Convert.ToInt32(dr[CON_FIELD_WEIGHT]); return(detail); } catch (Exception ex) { throw ex; } }
public List <GrnDetail> Search() { try { List <GrnDetail> GRNDetailList = new List <GrnDetail>(); System.Data.DataTable dTable = new DataTable(); string errorMessage = string.Empty; dTable = GetSelectedRecords(Common.ToXml(this), SP_GRNDETAIL_SEARCH, ref errorMessage); if (dTable != null) { foreach (System.Data.DataRow drow in dTable.Rows) { GrnDetail _Grn = CreateGRNObject(drow); _Grn.GRNBatchDetailList = _Grn.GetBatchDetail(); GRNDetailList.Add(_Grn); } } return(GRNDetailList); } catch (Exception ex) { throw ex; } }
public List <GrnDetail> GetGRNItem(ref string errorMessage) { try { List <GrnDetail> GRNDetailList = new List <GrnDetail>(); System.Data.DataTable dTable = new DataTable(); dTable = GetSelectedRecords(Common.ToXml(this), SP_GETGRNITEMS, ref errorMessage); if (dTable != null) { foreach (System.Data.DataRow drow in dTable.Rows) { GrnDetail _Grn = CreateGRNObject(drow); GRNDetailList.Add(_Grn); } } return(GRNDetailList); } catch (Exception ex) { throw ex; } }