public List <InvLeatherStockAdjustRequest> GetAllCNFRequestList() { var AllRequest = (from r in _context.Inv_LeatherStockAdjustRequest.AsEnumerable() where r.RecordStatus == "CNF" || r.RecordStatus == "APV" from s in _context.SYS_Store where s.StoreID == r.StoreID from t in _context.Sys_LeatherType where t.LeatherTypeID == r.LeatherType orderby r.RequestDate descending select new InvLeatherStockAdjustRequest { RequestID = r.RequestID, PurchaseYear = r.PurchaseYear, RequestDate = (r.RequestDate).ToString("dd'/'MM'/'yyyy"), LeatherType = r.LeatherType, StoreName = s.StoreName, LeatherTypeName = t.LeatherTypeName, StoreID = r.StoreID, RecordStatus = DalCommon.ReturnRecordStatus(r.RecordStatus) }).ToList(); return(AllRequest); }
public LCM_CommercialInvoice ModelConversionToLcmCommercialInvoice(CommercialInvoiceVM model, int userId, string url) { var entity = model.CIID == 0 ? new LCM_CommercialInvoice() : (from b in _context.LCM_CommercialInvoice.AsEnumerable() where b.CIID == model.CIID select b).FirstOrDefault(); entity.CIID = model.CIID; entity.CINo = model.CINo; entity.CIDate = DalCommon.SetDate(model.CIDate); entity.CICurrency = model.CICurrency; entity.LCID = model.LCID; entity.LCNo = model.LCNo; entity.CIStatus = model.CIStatus; entity.ExchangeCurrency = model.ExchangeCurrency; entity.ExchangeRate = model.ExchangeRate; entity.ExchangeValue = model.ExchangeValue; entity.CINote = model.CINote; entity.RecordStatus = model.CIID == 0 ? "NCF" : _unit.CommercialInvoiceRepository.GetByID(model.CIID).RecordStatus; entity.SetBy = model.CIID == 0 ? userId : _unit.CommercialInvoiceRepository.GetByID(model.CIID).SetBy; entity.SetOn = model.CIID == 0 ? DateTime.Now : _unit.CommercialInvoiceRepository.GetByID(model.CIID).SetOn; entity.ModifiedBy = model.CIID == 0 ? (int?)null : userId; entity.ModifiedOn = model.CIID == 0 ? (DateTime?)null : DateTime.Now; return(entity); }
public EXP_BankDebitVoucher SetToModelObject(EXPBankDebitVoucher model, int userid) { EXP_BankDebitVoucher Entity = new EXP_BankDebitVoucher(); Entity.BankID = model.BankID; //Entity.LCNo = model.LCNo.ToString(); //Entity.LCID = model.LCID; Entity.BranchID = model.BranchID; //Entity.LCID = model.LCID; Entity.BDVNo = model.BDVNo; Entity.BDVDate = DalCommon.SetDate(model.BDVDate); Entity.ExchangeCurrency = model.ExchangeCurrency; Entity.ExchangeRate = model.ExchangeRate; Entity.ExchangeAmount = model.ExchangeAmount; Entity.LCMargin = model.LCMargin; Entity.Remarks = model.Remarks; Entity.CommissionAmt = model.CommissionAmt; Entity.PostageAmt = model.PostageAmt; Entity.SwiftCharge = model.SwiftCharge; Entity.SourceTaxAmt = model.SourceTaxAmt; Entity.VatAmt = model.VatAmt; Entity.StationaryExpense = model.StationaryExpense; Entity.OtherCost = model.OtherCost; Entity.TotalAmount = model.TotalAmount; Entity.RecordStatus = "NCF"; Entity.SetOn = DateTime.Now; Entity.SetBy = userid; Entity.IPAddress = GetIPAddress.LocalIPAddress(); return(Entity); }
public List <PrqPurchaseChallan> GetChallanList(long purchaseID) { var challanList = (from c in _context.Prq_PurchaseChallan.AsEnumerable() where c.PurchaseID == purchaseID from s in _context.Sys_Source where s.SourceID == c.SourceID from l in _context.Sys_Location where l.LocationID == c.LocationID orderby c.ChallanID select new PrqPurchaseChallan { ChallanID = c.ChallanID, ChallanNo = c.ChallanNo, ChallanDate = (c.ChallanDate).ToString("dd'/'MM'/'yyyy"), SourceID = c.SourceID, SourceName = s.SourceName, LocationID = c.LocationID, LocationName = l.LocationName, ChallanCategory = c.ChallanCategory, ReceiveStore = DalCommon.GetStoreName(c.ReceiveStore), ChallanNote = c.ChallanNote, RecordStatus = DalCommon.ReturnRecordStatus(c.RecordStatus) }).ToList(); return(challanList); }
public EXP_PackingList SetToModelObject(EXPPackingList model, int userid) { EXP_PackingList Entity = new EXP_PackingList(); Entity.PLID = model.PLID; Entity.PLNo = model.PLNo; Entity.CIID = model.CIID; Entity.PLDate = DalCommon.SetDate(model.PLDate); Entity.BalesNo = model.BalesNo; Entity.BaleQty = model.BaleQty; Entity.TotalPcs = model.TotalPcs; Entity.TotalSide = model.TotalSide; Entity.MeterCIQty = model.MeterCIQty; Entity.FootCIQty = model.FootCIQty; Entity.PLNetWeight = model.PLNetWeight; Entity.NetWeightUnit = model.NetWeightUnit; Entity.PLGrossWeight = model.PLGrossWeight; Entity.GrossWeightUnit = model.GrossWeightUnit; Entity.PLMarks = model.PLMarks; Entity.PLNote = model.PLNote; Entity.RecordStatus = "NCF"; Entity.SetOn = DateTime.Now; Entity.SetBy = userid; Entity.IPAddress = GetIPAddress.LocalIPAddress(); return(Entity); }
public Prq_BillPayment SetToModelObject(PrqBillPayment model) { Prq_BillPayment Entity = new Prq_BillPayment(); Entity.PaymentDate = DalCommon.SetDate(model.PaymentDate);// Convert.ToDateTime(Convert.ToDateTime(model.PaymentDate).ToString("dd/MM/yyyy")); Entity.SupplierID = model.SupplierID; Entity.SupplierAddressID = model.SupplierAddressID; Entity.PaymentType = model.PaymentType; Entity.PaymentMethod = model.PaymentMethod; Entity.Currency = model.Currency; Entity.PaymentDoc = model.PaymentDoc; Entity.BillAmount = model.BillAmount; Entity.VatPercentage = model.VatPercentage; Entity.VatAmount = model.VatAmount; Entity.DeductAmount = model.DeductAmount; Entity.PaymentAmount = model.PaymentAmount; Entity.Remarks = model.Remarks; Entity.RecordStatus = "NCF"; Entity.PurchaseYear = model.PurchaseYear; Entity.PaymentStatus = true; Entity.SetOn = DateTime.Now; Entity.SetBy = model.SetBy; Entity.IPAddress = string.Empty; return(Entity); }
public long AddNewRequisitionDate(string _ScheduleID, string _RequiredDate) { try { using (_context) { PRD_YearMonthFinishReqDate obj = new PRD_YearMonthFinishReqDate(); obj.ScheduleID = Convert.ToInt64(_ScheduleID); obj.RequiredDate = DalCommon.SetDate(_RequiredDate); //Random r = new Random(); //obj.RequisitionNo = r.Next().ToString(); obj.RequisitionNo = DalCommon.GetPreDefineNextCodeByUrl("WBRequisitionForCrusting/WBRequisitionForCrusting"); obj.RecordStatus = "NCF"; _context.PRD_YearMonthFinishReqDate.Add(obj); _context.SaveChanges(); return(obj.RequisitionDateID); } } catch { return(0); } }
public List <SysChemicalItem> GetChemicalItemWithStock(byte _RequisitionFrom, byte _RequisitionTo) { var FinalStock = DalChemicalStock.ItemWiseStockInSpecificChemicalStore(_RequisitionTo); var FinalStockProductionFloor = DalChemicalStock.ItemWiseStockInSpecificProductionFloor(_RequisitionFrom); var Data = (from c in _context.Sys_ChemicalItem.AsEnumerable() where c.IsActive == true join fs in FinalStock on c.ItemID equals fs.ItemID into FinalStocks from fs in FinalStocks.DefaultIfEmpty() join ps in FinalStockProductionFloor on c.ItemID equals ps.ItemID into ProductionStock from ps in ProductionStock.DefaultIfEmpty() join it in _context.Sys_ItemType on c.ItemTypeID equals it.ItemTypeID into Items from it2 in Items.DefaultIfEmpty() orderby c.ItemName select new SysChemicalItem { ItemID = c.ItemID, ItemName = c.ItemName, ItemCategory = DalCommon.ReturnChemicalItemCategory(c.ItemCategory), ItemTypeID = c.ItemTypeID, ItemTypeName = (it2 == null ? null : it2.ItemTypeName), StockQty = (fs == null ? 0 : fs.ClosingQty), SafetyStock = ps == null ? 0 : Convert.ToInt32(ps.ClosingQty) //Actually Production Stock }).ToList(); return(Data); }
public ValidationMsg SaveAck(SlsBuyerOrder model, int userId) { try { var entity = _unit.SlsBuyerOrederRepository.GetByID(model.BuyerOrderID); entity.AcknowledgementStatus = model.AcknowledgementStatus; entity.AckDate = model.AckDate == null ? (DateTime?)null : DalCommon.SetDate(model.AckDate); entity.ProposedShipmentDate = model.ProposedShipmentDate == null ? (DateTime?)null : DalCommon.SetDate(model.ProposedShipmentDate); entity.DeliveryLastDate = model.DeliveryLastDate == null ? (DateTime?)null : DalCommon.SetDate(model.DeliveryLastDate); entity.ExpectedProdStartDate = model.ExpectedProdStartDate == null ? (DateTime?)null : DalCommon.SetDate(model.ExpectedProdStartDate); entity.AcknowledgeNote = model.AcknowledgeNote; entity.ModifiedBy = userId; entity.ModifiedOn = DateTime.Now; _unit.SlsBuyerOrederRepository.Update(entity); _save = _unit.IsSaved(); if (_save) { _validationMsg.ReturnId = entity.BuyerOrderID; _validationMsg.Type = Enums.MessageType.Success; _validationMsg.Msg = "Saved successfully."; } } catch { _validationMsg.Type = Enums.MessageType.Error; _validationMsg.Msg = "Failed to save."; } return(_validationMsg); }
private SLS_BuyerOrderDelivery ConvertOrderDelivery(SlsBuyerOrderDelivery model, int userId, long buyerOrderId) { var entity = model.BuyerOrderDeliveryID == 0 ? new SLS_BuyerOrderDelivery() : (from b in _context.SLS_BuyerOrderDelivery.AsEnumerable() where b.BuyerOrderDeliveryID == model.BuyerOrderDeliveryID select b).FirstOrDefault(); entity.BuyerOrderDeliveryID = model.BuyerOrderDeliveryID; entity.BuyerOrderID = buyerOrderId; entity.OrdDeliverySL = model.OrdDeliverySL; entity.OrdDeliveryDate = model.OrdDeliveryDate.Contains("/") ? DalCommon.SetDate(model.OrdDeliveryDate.Trim()) : DalCommon.SetDate(Convert.ToDateTime(model.OrdDeliveryDate).ToString("dd/MM/yyyy")); entity.ArticleID = model.ArticleID; entity.ColorID = model.ColorID; entity.OrdDateFootQty = model.OrdDateFootQty; entity.OrdDateMeterQty = model.OrdDateMeterQty; entity.SetOn = model.BuyerOrderDeliveryID == 0 ? DateTime.Now : _unit.SlsBuyerOrderDeliveryRepository.GetByID(model.BuyerOrderDeliveryID).SetOn; entity.SetBy = model.BuyerOrderDeliveryID == 0 ? userId : _unit.SlsBuyerOrderDeliveryRepository.GetByID(model.BuyerOrderDeliveryID).SetBy; entity.ModifiedOn = model.BuyerOrderDeliveryID == 0 ? (DateTime?)null : DateTime.Now; entity.ModifiedBy = model.BuyerOrderDeliveryID == 0 ? (int?)null : userId; entity.IsActive = true; return(entity); }
private LCM_BillofLading BillOfLadingModelConverter(LcmBillOfLadingVM model, int userId, string url) { var entity = model.Blid == 0 ? new LCM_BillofLading() : (from b in _context.LCM_BillofLading.AsEnumerable() where b.BLID == model.Blid select b).FirstOrDefault(); entity.BLID = model.Blid; entity.BLNo = model.BlNo; entity.BLDate = DalCommon.SetDate(model.BlDate); entity.CIID = model.CIID; entity.CINo = model.CINo; entity.LCID = model.Lcid; entity.LCNo = model.LcNo; entity.ShippedOnBoardDate = DalCommon.SetDate(model.ShippedOnBoardDate); entity.ExpectedArrivalTime = DalCommon.SetDate(model.ExpectedArrivalTime); entity.Shipper = model.Shipper; entity.ShipmentMode = model.ShipmentMode; entity.VesselName = model.VesselName; entity.VoyageNo = model.VoyageNo; entity.TransShipmentPort = model.TransShipmentPort; entity.ShipmentPort = model.ShipmentPort; entity.BLNote = model.BlNote; if (model.Blid == 0) { entity.RecordStatus = "NCF"; entity.SetBy = userId; entity.SetOn = DateTime.Now; } else { entity.ModifiedBy = userId; entity.ModifiedOn = DateTime.Now; } return(entity); }
public EXP_AgentCommission SetToModelObject(EXPAgentCommission model, int userid) { EXP_AgentCommission Entity = new EXP_AgentCommission(); Entity.AgentComID = model.AgentComID; Entity.AgentComNo = model.AgentComNo; Entity.AgentComDate = DalCommon.SetDate(model.AgentComDate); Entity.AgentComRef = model.AgentComRef; Entity.BuyerID = Convert.ToInt32(model.BuyerID); Entity.CIID = model.CIID; Entity.CIAmount = model.CIAmount; Entity.ComOnAmount = model.ComOnAmount; Entity.CIDate = DalCommon.SetDate(model.CIDate); Entity.InvoiceCurrency = model.InvoiceCurrency; //Entity.LocalCurrency = model.LocalCurrency; Entity.LocalCurrency = _context.Sys_Currency.Where(m => m.CurrencyName == "TK").FirstOrDefault().CurrencyID; Entity.RecordStatus = "NCF"; Entity.SetOn = DateTime.Now; Entity.SetBy = userid; Entity.IPAddress = GetIPAddress.LocalIPAddress(); return(Entity); }
// Search List for Leather Stock Adjustment Request public List <InvLeatherStockAdjustRequest> GetAllNCFRequestList() { var AllRequest = (from r in _context.Inv_LeatherStockAdjustRequest.AsEnumerable() where r.RecordStatus != "APV" from s in _context.SYS_Store where s.StoreID == r.StoreID from t in _context.Sys_LeatherType where t.LeatherTypeID == r.LeatherType //from i in _context.Inv_LeatherStockAdjustItem.Where(x=>x.RequestID==r.RequestID).DefaultIfEmpty() //from sp in _context.Sys_Supplier.Where(x=>x.SupplierID== i.SupplierID).DefaultIfEmpty() orderby r.RequestDate descending select new InvLeatherStockAdjustRequest { RequestID = r.RequestID, PurchaseYear = r.PurchaseYear, RequestDate = (r.RequestDate).ToString("dd'/'MM'/'yyyy"), LeatherType = r.LeatherType, StoreName = s.StoreName, LeatherTypeName = t.LeatherTypeName, StoreID = r.StoreID, RecordStatus = DalCommon.ReturnRecordStatus(r.RecordStatus) //SupplierID= (i.SupplierID).ToString(), //SupplierName= sp.SupplierName, //ChallanID= (i.ChallanID).ToString() }).ToList(); return(AllRequest); }
public List <SysArticleChallan> GetSearchInformation() { using (_context) { var Data = (from c in _context.Sys_ArticleChallan.AsEnumerable() join b in _context.Sys_Buyer on c.BuyerID equals b.BuyerID into Buyers from b in Buyers.DefaultIfEmpty() join a in _context.Sys_Article on c.ArticleID equals a.ArticleID into Articles from a in Articles.DefaultIfEmpty() orderby c.ArticleChallanID descending select new SysArticleChallan { ArticleChallanID = c.ArticleChallanID, ArticleChallanNo = c.ArticleChallanNo, BuyerID = c.BuyerID, BuyerCode = (b == null?null:b.BuyerCode), BuyerName = (b == null ? null : b.BuyerName), ArticleID = c.ArticleID, ArticleName = (a == null?null:a.ArticleName), PreparationDate = Convert.ToDateTime(c.PreparationDate).ToString("dd'/'MM'/'yyyy"), RecordStatus = DalCommon.ReturnRecordStatus(c.RecordStatus), ChallanNote = c.ChallanNote, ArticleNote = c.ArticleNote, ArticleArea = c.ArticleArea }).ToList(); return(Data); } }
public List <ExpBankVoucher> GetTransactionInfoForSearch() { using (_context) { var Data = (from t in _context.EXP_BankVoucher.AsEnumerable() join b in _context.Sys_Bank on t.BankID equals b.BankID into Banks from b in Banks.DefaultIfEmpty() join br in _context.Sys_Branch on t.BranchID equals br.BranchID into Branches from br in Branches.DefaultIfEmpty() join ci in _context.EXP_CI on(t.CIID == null?null:t.CIID) equals ci.CIID into CIs from ci in CIs.DefaultIfEmpty() orderby t.BVID descending select new ExpBankVoucher { BVID = t.BVID, RefBVNo = t.RefBVNo, BVDate = (Convert.ToDateTime(t.BVDate)).ToString("dd'/'MM'/'yyyy"), BVType = (t.BVType == "DR"? "Debit": "Credit"), BankID = t.BankID, BankName = b == null?null:b.BankName, BranchID = t.BranchID, BranchName = br == null ? null : br.BranchName, ACNo = t.ACNo, ACName = t.ACName, Remarks = t.Remarks, RecordStatus = DalCommon.ReturnRecordStatus(t.RecordStatus) }).ToList(); return(Data); } }
private LCM_PackingList ModelConversionPackingList(PackingListVM model, int userId, string url) { var entity = model.Plid == 0 ? new LCM_PackingList() : (from b in _context.LCM_PackingList.AsEnumerable() where b.PLID == model.Plid select b).FirstOrDefault(); entity.PLID = model.Plid; entity.PLNo = model.Plid == 0 ? DalCommon.GetPreDefineNextCodeByUrl(url) : model.PlNo; entity.PLDate = DalCommon.SetDate(model.PlDate); entity.LCID = model.Lcid; entity.LCNo = model.LcNo; entity.CIID = model.Ciid; entity.CINo = model.CiNo; entity.PLNetWeight = model.NetWeight; entity.NetWeightUnit = model.NetWeightUnit; entity.PLGrossWeight = model.GrossWeight; entity.GrossWeightUnit = model.GrossWeightUnit; entity.PLNote = model.PlNote; entity.RecordStatus = model.Plid == 0 ? "NCF" : model.RecordStatus; entity.SetOn = model.Plid == 0 ? DateTime.Now : _unit.PackingListRepository.GetByID(model.Plid).SetOn; entity.SetBy = model.Plid == 0 ? userId : _unit.PackingListRepository.GetByID(model.Plid).SetBy; entity.ModifiedBy = model.Plid == 0 ? (int?)null : userId; entity.ModifiedOn = model.Plid == 0 ? (DateTime?)null : DateTime.Now; return(entity); }
public List <SysChemicalItem> GetAvailableChemicalInStock(byte _RequisitionAt) { var FinalStock = DalChemicalStock.ItemWiseStockInSpecificChemicalStore(_RequisitionAt); var data = (from s in FinalStock where s.ClosingQty > 0 join c in _context.Sys_ChemicalItem on s.ItemID equals c.ItemID into Chemicals from c in Chemicals.DefaultIfEmpty() join i in _context.Sys_ItemType on(c.ItemTypeID == null? null: c.ItemTypeID) equals i.ItemTypeID into ItemTypes from i in ItemTypes.DefaultIfEmpty() select new SysChemicalItem { ItemID = Convert.ToInt32(s.ItemID), ItemName = c == null ? null : c.ItemName, //ItemCategory = DalCommon.ReturnChemicalItemCategory(c.ItemCategory), //ItemTypeName = DalCommon.GetItemTypeName(Convert.ToByte(c.ItemTypeID)), ItemCategory = c.ItemCategory, ItemTypeName = (i == null? null: i.ItemTypeName), StockQty = s.ClosingQty }).ToList(); foreach (var item in data) { item.ItemCategory = DalCommon.ReturnChemicalItemCategory(item.ItemCategory); } return(data); }
public object GetFrghtBillDocs() { var billDocs = _context.EXP_FreightBill.ToList(); var results = billDocs.Select( bill => new { bill.FreightBillID, bill.FreightBillNo, FreightBillDate = string.Format("{0:dd/MM/yyyy}", bill.FreightBillDate), bill.FreightBillRef, //bill.LCID, //LCNo = bill.LCID == null ? "" : _context.EXP_LCOpening.FirstOrDefault(ob => ob.LCID == bill.LCID).LCNo, //bill.PIID, //PINo = bill.PIID == null ? "" : _context.EXP_LeatherPI.FirstOrDefault(ob => ob.PIID == bill.PIID).PINo, bill.CIID, CINo = bill.CIID == null ? "" : _context.EXP_CI.FirstOrDefault(ob => ob.CIID == bill.CIID).CINo, CIRefNo = bill.CIID == null ? "" : _context.EXP_CI.FirstOrDefault(ob => ob.CIID == bill.CIID).CIRefNo, bill.BLID, BLNo = bill.BLID == null ? "" : _context.EXP_BillofLading.FirstOrDefault(ob => ob.BLID == bill.BLID).BLNo, bill.FreightAgentID, FreightAgentName = bill.FreightAgentID == null ? "" : _context.Sys_Buyer.FirstOrDefault(ob => ob.BuyerID == bill.FreightAgentID).BuyerName, RecordStatus = DalCommon.ReturnRecordStatus(bill.RecordStatus) }).OrderByDescending(ob => ob.FreightBillID).ToList(); return(results); }
public EXP_BankLoan SetToBankLoanEntityObject(EXPBankLoan model, int _userid)//int _userid { EXP_BankLoan entity = new EXP_BankLoan(); entity.BankLoanID = model.BankLoanID; entity.BankLoanNo = model.BankLoanNo; //entity.BankID = model.BankID; //entity.BranchID = model.BranchID; entity.LoanHead = model.LoanHead; entity.RefACNo = model.RefACNo; entity.RefACName = model.RefACName; var GridloanRecieveDate = model.LoanReceiveDate.Contains("/") ? model.LoanReceiveDate : Convert.ToDateTime(model.LoanReceiveDate).ToString("dd/MM/yyyy"); entity.LoanReceiveDate = DalCommon.SetDate(GridloanRecieveDate); entity.LoanAmt = model.LoanAmt; entity.InterestPercent = model.InterestPercent; entity.LoanLimit = model.LoanLimit; entity.ReturnedAmt = model.ReturnedAmt; entity.BalanceAmt = model.BalanceAmt; entity.CIID = model.CIID; entity.Remarks = model.Remarks; entity.RecordStatus = "NCF"; entity.RunningStatus = "CLS"; entity.SetOn = DateTime.Now; entity.SetBy = _userid; entity.IPAddress = GetIPAddress.LocalIPAddress(); return(entity); }
private EXP_TransportChallan ConvertTransportChallan(ExpTransportChallan model, int userId) { var entity = model.TransportChallanID == 0 ? new EXP_TransportChallan() : (from b in _context.EXP_TransportChallan.AsEnumerable() where b.TransportChallanID == model.TransportChallanID select b).FirstOrDefault(); entity.TransportChallanID = model.TransportChallanID; entity.TransportChallanNo = model.TransportChallanNo; entity.TransportChallanDate = DalCommon.SetDate(model.TransportChallanDate); entity.TransportChallanRef = model.TransportChallanRef; entity.TransportChallanNote = model.TransportChallanNote; entity.DeliverChallanID = model.DeliverChallanID; entity.Sender = model.Sender; entity.SenderAddress = model.SenderAddress; entity.Receiver = model.Receiver; entity.ReceverAddress = model.ReceverAddress; entity.DeliveryFrom = model.DeliveryFrom; entity.DEliveryTo = model.DEliveryTo; entity.RecordStatus = model.RecordStatus ?? "NCF"; entity.SetBy = model.TransportChallanID == 0 ? userId : _context.EXP_TransportChallan.FirstOrDefault(ob => ob.TransportChallanID == model.TransportChallanID).SetBy; entity.SetOn = model.TransportChallanID == 0 ? DateTime.Now : _context.EXP_TransportChallan.FirstOrDefault(ob => ob.TransportChallanID == model.TransportChallanID).SetOn; entity.ModifiedBy = model.TransportChallanID == 0 ? (int?)null : userId; entity.ModifiedOn = model.TransportChallanID == 0 ? (DateTime?)null : DateTime.Now; return(entity); }
public List <Prq_Purchase> GetPurchaseListID(int supplier, string dateFrom, string dateTo) { DateTime fromdate = DalCommon.SetDate(dateFrom); DateTime toDate = DalCommon.SetDate(dateTo); List <Prq_PreGradeSelection> result = (from temp in _context.Prq_PreGradeSelection where temp.SupplierID == supplier && temp.RecordStatus == "CNF" && temp.SelectionDate >= fromdate && temp.SelectionDate <= toDate select temp).ToList(); var lstPurchase = (from temp in result join temp2 in _context.Prq_Purchase on temp.PurchaseID equals temp2.PurchaseID select new { PurchaseID = temp2.PurchaseID, PurchaseNo = temp2.PurchaseNo, PurchaseDate = temp2.PurchaseDate }).AsEnumerable(); List <Prq_Purchase> lstPo = new List <Prq_Purchase>(); foreach (var item in lstPurchase) { Prq_Purchase ob = new Prq_Purchase(); ob.PurchaseID = item.PurchaseID; ob.PurchaseNo = item.PurchaseNo; ob.PurchaseDate = item.PurchaseDate; lstPo.Add(ob); } return(lstPo); }
public List <Prq_PreGradeSelection> GetSelectionListID(int store, int supplier, string dateFrom, string dateTo) { DateTime fromdate = DalCommon.SetDate(dateFrom); DateTime toDate = DalCommon.SetDate(dateTo); List <Prq_PreGradeSelection> result = (from temp in _context.Prq_PreGradeSelection where temp.SelectionStore == store && temp.SupplierID == supplier && temp.RecordStatus == "CNF" && temp.SelectionDate >= fromdate && temp.SelectionDate <= toDate select temp).OrderByDescending(o => o.SelectionID).ToList(); return(result.ToList()); }
private EXP_ExportForm ConvertModel(ExpExportForm model, int userId, string url) { var entity = model.ExportFormID == 0 ? new EXP_ExportForm() : (from b in _context.EXP_ExportForm.AsEnumerable() where b.ExportFormID == model.ExportFormID select b).FirstOrDefault(); entity.DealerID = model.DealerID; entity.ExportFormID = model.ExportFormID; entity.ExportFormNo = model.ExportFormNo; entity.ExportFormDate4 = DalCommon.SetDate(model.ExportFormDate4); entity.ExportFormRef = model.ExportFormRef; entity.ExportFormRef1 = model.ExportFormRef1; entity.ExportFormRef2 = model.ExportFormRef2; entity.ExportFormRef3 = model.ExportFormRef3; entity.CIID = model.CIID; entity.PLID = model.PLID; entity.Comodity = model.Comodity; entity.ComodityCode = model.ComodityCode; entity.DestinationCountry = model.DestinationCountry; entity.CountryCode = model.CountryCode; entity.DestinationPort = model.DestinationPort; entity.PortCode = model.PortCode; entity.PackQTy = model.PackQTy; entity.PackUnit = model.PackUnit; entity.PackUnitCode = model.PackUnitCode; entity.VolumeQty = model.VolumeQty; entity.VolumeUnit = model.VolumeUnit; entity.DeclaredCurrency = model.DeclaredCurrency; entity.InvoiceValue = model.InvoiceValue; entity.InvoiceCurrency = model.InvoiceCurrency; entity.DeliveryTerm = model.DeliveryTerm; entity.TermOfSaleNo = model.TermOfSaleNo; entity.TermSaleDate = DalCommon.SetDate(model.TermSaleDate); entity.Importer = model.Importer; entity.CarryingVassal = model.CarryingVassal; entity.ExportBillDtl = model.ExportBillDtl; entity.PortOfShipment = model.PortOfShipment; entity.LandCustomPort = model.LandCustomPort; entity.ShipmentDate = DalCommon.SetDate(model.ShipmentDate); entity.Exporter = model.Exporter; entity.CCIESNo = model.CCIESNo; entity.CCIESDate = DalCommon.SetDate(model.CCIESDate); entity.Sector = model.Sector; entity.SectorCode = model.SectorCode; entity.SetOn = model.ExportFormID == 0 ? DateTime.Now : _unit.ExportFormRepository.GetByID(model.ExportFormID).SetOn; entity.SetBy = model.ExportFormID == 0 ? userId : _unit.ExportFormRepository.GetByID(model.ExportFormID).SetBy; entity.ModifiedOn = model.ExportFormID == 0 ? (DateTime?)null : DateTime.Now; entity.ModifiedBy = model.ExportFormID == 0 ? (int?)null : userId; entity.RecordStatus = model.RecordStatus ?? "NCF"; return(entity); }
public List <PRQChemFrgnPurcOrdr> GetOrderInformationForLOV() { var Orders = (from o in _context.PRQ_ChemFrgnPurcOrdr.AsEnumerable() where o.RecordStatus == "CNF" & o.OrderState == "RNG" & o.OrderCategory == "FPO" from s1 in _context.Sys_Supplier.Where(x => x.SupplierID == o.SupplierID).DefaultIfEmpty() join sa in _context.Sys_SupplierAddress.Where(x => x.IsActive && !x.IsDelete) on o.SupplierID equals sa.SupplierID into SupplierAddress from sa2 in SupplierAddress.DefaultIfEmpty() from s2 in _context.Sys_Supplier.Where(x => x.SupplierID == o.LocalAgent).DefaultIfEmpty() join la in _context.Sys_SupplierAddress.Where(x => x.IsActive && !x.IsDelete) on o.LocalAgent equals la.SupplierID into LocalAgentAddress from la2 in LocalAgentAddress.DefaultIfEmpty() from s3 in _context.Sys_Supplier.Where(x => x.SupplierID == o.ForeignAgent).DefaultIfEmpty() join fa in _context.Sys_SupplierAddress.Where(x => x.IsActive && !x.IsDelete) on o.ForeignAgent equals fa.SupplierID into ForeignAgentAddress from fa2 in ForeignAgentAddress.DefaultIfEmpty() orderby o.OrderID descending select new PRQChemFrgnPurcOrdr { OrderID = o.OrderID, OrderNo = o.OrderNo, OrderTo = DalCommon.ReturnOrderTo(o.OrderTo), OrderDate = (Convert.ToDateTime(o.OrderDate)).ToString("dd'/'MM'/'yyyy"), OrderType = DalCommon.ReturnOrderType(o.OrderType), SupplierID = Convert.ToInt32((s1 == null ? null : (s1.SupplierID).ToString())), SupplierName = (s1 == null ? null : s1.SupplierName), SupplierCode = (s1 == null ? null : s1.SupplierCode), SupplierAddress = (sa2 == null? null: sa2.Address), SupplierContactNumber = (sa2 == null ? null : sa2.ContactNumber), LocalAgent = Convert.ToInt32((la2 == null ? null : (la2.SupplierID).ToString())), LocalAgentName = (s2 == null ? null : s2.SupplierName), LocalAgentCode = (s2 == null ? null : s2.SupplierCode), LocalAgentAddress = (la2 == null ? null : la2.Address), LocalAgentContactNumber = (la2 == null ? null : la2.ContactNumber), ForeignAgent = Convert.ToInt32((s3 == null ? null : (s3.SupplierID).ToString())), ForeignAgentName = (s3 == null ? null : s3.SupplierName), ForeignAgentCode = (s3 == null ? null : s3.SupplierCode), ForeignAgentAddress = (fa2 == null ? null : fa2.Address), ForeignAgentContactNumber = (fa2 == null ? null : fa2.ContactNumber), OrderNote = o.OrderNote }).ToList(); return(Orders); }
public Prq_PurchaseYearTarget SetToModelObject(PrqPurchaseYearTarget model) { Prq_PurchaseYearTarget Entity = new Prq_PurchaseYearTarget(); Entity.YearStartDate = DalCommon.SetDate(model.YearStartDate); // Convert.ToDateTime(Convert.ToDateTime(model.YearStartDate).ToString("dd/MM/yyyy")); Entity.YearEndDate = DalCommon.SetDate(model.YearEndDate); //Convert.ToDateTime(Convert.ToDateTime(model.YearEndDate).ToString("dd/MM/yyyy")); Entity.PurchaseYear = model.PurchaseYear; Entity.SetOn = DateTime.Now; Entity.SetBy = model.SetBy; Entity.IPAddress = string.Empty; return(Entity); }
public Prq_PurchaseYearPeriod SetToModelObject(PrqPurchaseYearPeriod model) { Prq_PurchaseYearPeriod Entity = new Prq_PurchaseYearPeriod(); Entity.StartDate = DalCommon.SetDate(model.StartDate); // Convert.ToDateTime(Convert.ToDateTime(model.StartDate).ToString("dd/MM/yyyy")); Entity.EndDate = DalCommon.SetDate(model.EndDate); // Convert.ToDateTime(Convert.ToDateTime(model.EndDate).ToString("dd/MM/yyyy")); Entity.YearID = model.YearID; Entity.RecordStatus = "NCF"; Entity.SetOn = DateTime.Now; Entity.SetBy = model.SetBy; return(Entity); }
public int SaveAdjustItemRequest(InvLeatherStockAdjustModel model, int userID) { var leatherTypeID = DalCommon.GetLeatherTypeCode("Raw Hide"); var leatherStatusID = DalCommon.GetLeatherStatusCode("Raw Hide"); using (TransactionScope transaction = new TransactionScope()) { #region Insert Inv_LeatherStockAdjustRequest objAdjustmentRequest = new Inv_LeatherStockAdjustRequest(); objAdjustmentRequest.PurchaseYear = model.PurchaseYear; objAdjustmentRequest.RequestDate = DalCommon.SetDate(model.RequestDate); objAdjustmentRequest.LeatherType = model.LeatherType; objAdjustmentRequest.StoreID = model.StoreID; objAdjustmentRequest.RecordStatus = "NCF"; objAdjustmentRequest.SetBy = userID; objAdjustmentRequest.SetOn = DateTime.Now; _context.Inv_LeatherStockAdjustRequest.Add(objAdjustmentRequest); _context.SaveChanges(); var currentRequestID = objAdjustmentRequest.RequestID; foreach (var item in model.StockAdjustItemList) { Inv_LeatherStockAdjustItem objAdjustmentItems = new Inv_LeatherStockAdjustItem(); objAdjustmentItems.RequestID = currentRequestID; objAdjustmentItems.SupplierID = item.SupplierID; objAdjustmentItems.PurchaseID = item.ChallanID; objAdjustmentItems.ItemTypeID = item.ItemTypeID; objAdjustmentItems.LeatherType = model.LeatherType; objAdjustmentItems.LeatherStatus = leatherStatusID; objAdjustmentItems.ItemQty = item.ItemQty; objAdjustmentItems.Unit = item.Unit; objAdjustmentItems.Remarks = item.Remarks; objAdjustmentItems.AdjustmentCause = item.AdjustmentCause; _context.Inv_LeatherStockAdjustItem.Add(objAdjustmentItems); _context.SaveChanges(); } transaction.Complete(); return(currentRequestID); #endregion } }
public EXP_DeliveryChallanCI SetToDeliveryChallanCIModelObject(EXPDeliveryChallanCI model, int _userid) { EXP_DeliveryChallanCI entity = new EXP_DeliveryChallanCI(); entity.DeliverChallanID = model.DeliverChallanID; entity.CIID = model.CIID; entity.PLID = model.PLID; entity.RecordStatus = DalCommon.ReturnRecordStatus(model.RecordStatus); entity.SetOn = DateTime.Now; entity.SetBy = _userid; entity.RecordStatus = "NCF"; entity.IPAddress = GetIPAddress.LocalIPAddress(); return(entity); }
private PrqChemLocalPurcBill SetToBillModel(PRQ_ChemLocalPurcBill entity) { var model = new PrqChemLocalPurcBill(); model.BillId = entity.BillID; model.BillNo = entity.BillNo; model.BillDate = string.Format("{0:dd/MM/yyyy}", entity.BillDate); model.SupplierName = entity.SupplierID == null ? "" : _unit.SysSupplierRepository.GetByID(entity.SupplierID).SupplierName; model.SupplierBillNo = entity.SupplierBillNo; model.RecordStatus = DalCommon.ReturnRecordStatus(entity.RecordStatus); return(model); }
public IEnumerable <PrdRecipe> GetAllNcfRecipeList() { #region Old Code //var items = from r in _context.PRD_Recipe // join p in _context.Sys_ProductionProces on r.RecipeFor equals p.ProcessID // join c in _context.Sys_Color on r.ArticleColor equals c.ColorID // join u in _context.Sys_Unit on r.BaseUnit equals u.UnitID // select new PrdRecipe // { // RecipeID = r.RecipeID, // RecipeName=r.RecipeName, // RecipeNo = r.RecipeNo, // ArticleNo=r.ArticleNo, // ArticleName =r.ArticleName, // ArticleColor = r.ArticleColor, // ArticleColorName=c.ColorName, // ArticleChallanNo=r.ArticleChallanNo, // RecipeFor=r.RecipeFor, // RecipeProcessName =p.ProcessName, // CalculationBase=r.CalculationBase, // BaseQuantity=r.BaseQuantity, // BaseUnit=r.BaseUnit, // UnitName=u.UnitName, // RecordStatus = r.RecordStatus // }; #endregion var items = _unit.PrdRecipeRepository.Get() .Select(r => new PrdRecipe() { RecipeID = r.RecipeID, RecipeName = r.RecipeName, RecipeNo = r.RecipeNo, ArticleNo = r.ArticleNo, ArticleName = r.ArticleName, ArticleColor = r.ArticleColor, ArticleColorName = r.ArticleColor != null ? _unit.SysColorRepository.GetByID(r.ArticleColor).ColorName : "", ArticleChallanNo = r.ArticleChallanNo, RecipeFor = r.RecipeFor, RecipeProcessName = r.RecipeFor != null ? _unit.SysProductionProces.GetByID(r.RecipeFor).ProcessName : "", CalculationBase = r.CalculationBase, BaseQuantity = r.BaseQuantity, BaseUnit = r.BaseUnit, UnitName = _unit.SysUnitRepository.GetByID(r.BaseUnit).UnitName, RecordStatus = DalCommon.ReturnRecordStatus(r.RecordStatus) }).ToList(); return(items.ToList().OrderByDescending(o => o.RecipeID)); }