public void AddStack(Guid stackId, Guid weigherID, string ticketNo, string LoadUnloadTicketNO, DateTime dateWeighed, double truckWeight, double grossWeight, double bags, DateTime dateTimeLoaded, int truckTypeID, int wbServiceProviderID ) { StackTransactionModel o = new StackTransactionModel(this); o.ID = Guid.NewGuid(); o.StackID = stackId; o.GINID = ID; o.WeigherID = weigherID; o.DateTimeWeighed = dateWeighed; o.TruckWeight = truckWeight; o.GrossWeight = grossWeight; o.NoOfBags = bags; o.LoadUnloadTicketNO = LoadUnloadTicketNO; o.ScaleTicketNumber = ticketNo; o.DateTimeLoaded = dateTimeLoaded; o.TruckTypeID = truckTypeID; o.WBServiceProviderID = wbServiceProviderID; AddStack(o); }
public static List <StackTransactionModel> GetTruckType(GINModel parentGin) { List <StackTransactionModel> ServiceProviderList; ServiceProviderList = new List <StackTransactionModel>(); DataTable WarehouseOperator = ECX.DataAccess.SQLHelper.getDataTable(ConnectionString, "GetTruckType"); foreach (DataRow r in WarehouseOperator.Rows) { StackTransactionModel pnm = new StackTransactionModel(parentGin); Common.DataRow2Object(r, pnm); ServiceProviderList.Add(pnm); } return(ServiceProviderList); }
public void AddStack(StackTransactionModel sm) { if (stackList != null) { if (stackList.Exists(s => s.StackID == sm.StackID)) { throw new Exception("Cannot add from the same stack"); } if (stackList.Exists(s => s.ScaleTicketNumber == sm.ScaleTicketNumber)) { throw new Exception("Duplicate scale ticket no"); } if (stackList.Exists(s => s.LoadUnloadTicketNO == sm.LoadUnloadTicketNO)) { throw new Exception("Duplicate Loading Ticket no"); } } stackList.Add(sm); }
public List <StackTransactionModel> GetStacksLoaded() { if (stackList != null) { return(stackList); } DataTable dt = SQLHelper.getDataTable(ConnectionString, "tblStackLoadingGet", ID); stackList = new List <StackTransactionModel>(); foreach (DataRow dr in dt.Rows) { StackTransactionModel o = new StackTransactionModel(this); Common.DataRow2Object(dr, o); AddStack(o); } return(stackList); }
public static List <StackTransactionModel> GetCurCoffBalance(GINModel parentGin) { List <StackTransactionModel> StackByShedList; StackByShedList = new List <StackTransactionModel>(); DataTable dt = ECX.DataAccess.SQLHelper.getDataTable( ConnectionString, "GetCurCoffBalance", parentGin.PickupNoticesList[0].WarehouseReceiptNo, parentGin.LICShedID ); foreach (DataRow r in dt.Rows) { StackTransactionModel pnm = new StackTransactionModel(parentGin); Common.DataRow2Object(r, pnm); StackByShedList.Add(pnm); } return(StackByShedList); }
public static List <StackTransactionModel> GetStackInShed(GINModel parentGin) { List <StackTransactionModel> StackByShedList; StackByShedList = new List <StackTransactionModel>(); DataTable dt = ECX.DataAccess.SQLHelper.getDataTable( ConnectionString, "GetStackByShedId", parentGin.LICShedID, parentGin.CommodityGradeID, parentGin.ProductionYear ); foreach (DataRow r in dt.Rows) { StackTransactionModel pnm = new StackTransactionModel(parentGin); Common.DataRow2Object(r, pnm); StackByShedList.Add(pnm); } return(StackByShedList); }
//-------- Create END ------- March 20 2015 public static GINModel GetGIN(string GINNo) { GINModel gm = new GINModel(); DataTable dt = SQLHelper.getDataTable(ConnectionString, "GINGet", GINNo); Common.DataRow2Object(dt.Rows[0], gm); List <Guid> pnIdList = new List <Guid>(); List <Guid> sIdList = new List <Guid>(); foreach (DataRow dr in dt.Rows) { Guid pnID = new Guid(dr["PUNID"].ToString()); if (!pnIdList.Exists(s => s == pnID)) { pnIdList.Add(pnID); PickupNoticeModel pnm = new PickupNoticeModel(); Common.DataRow2Object(dr, pnm); pnm.ID = pnID; gm.punList.Add(pnm); } } foreach (DataRow dr in dt.Rows) { StackTransactionModel sm = new StackTransactionModel(gm); Common.DataRow2Object(dr, sm); if (sm.StackTransactionID == Guid.Empty) { break; } if (!sIdList.Exists(s => s == sm.StackTransactionID)) { sIdList.Add(sm.StackTransactionID); sm.ID = sm.StackTransactionID; gm.stackList.Add(sm); } } return(gm); }