public object GetFrghtBillDoc(long fbdId) { var frghtBillDoc = _unit.FreightBillRepository.GetByID(fbdId); var result = new ExpFreightBill(); result.FreightBillID = frghtBillDoc.FreightBillID; result.FreightBillNo = frghtBillDoc.FreightBillNo; result.FreightBillRef = frghtBillDoc.FreightBillRef; //result.FreightBillRef = frghtBillDoc.FreightBillRef; result.FreightBillDate = frghtBillDoc.FreightBillDate == null ? "" : string.Format("{0:dd/MM/yyyy}", frghtBillDoc.FreightBillDate); //result.LCID = frghtBillDoc.LCID; //result.PIID = frghtBillDoc.PIID; //result.PINo = frghtBillDoc.PIID == null ? "" : _unit.ExpLeatherPI.GetByID(frghtBillDoc.PIID).PINo; //result.PIDate = frghtBillDoc.PIID == null // ? "" // : string.Format("{0:dd/MM/yyyy}", _unit.ExpLeatherPI.GetByID(frghtBillDoc.PIID).PIDate); result.CIID = frghtBillDoc.CIID; result.CINo = frghtBillDoc.CIID == null ? "" : _unit.ExpCommercialInvoiceRepository.GetByID(frghtBillDoc.CIID).CINo; result.CIRefNo = frghtBillDoc.CIID == null ? "" : _unit.ExpCommercialInvoiceRepository.GetByID(frghtBillDoc.CIID).CIRefNo; result.CIDate = frghtBillDoc.CIID == null ? "" : string.Format("{0:dd/MM/yyyy}", _unit.ExpCommercialInvoiceRepository.GetByID(frghtBillDoc.CIID).CIDate); result.OrdDeliveryMode = frghtBillDoc.CIID == null ? "" : DalCommon.ReturnOrderDeliveryMode( _unit.ExpCommercialInvoiceRepository.GetByID(frghtBillDoc.CIID).OrdDeliveryMode); result.BLID = frghtBillDoc.BLID; result.BLNo = frghtBillDoc.BLID == null ? "" : _unit.ExpBillOfLadingRepository.GetByID(frghtBillDoc.BLID).BLNo; result.BLDate = frghtBillDoc.BLID == null ? "" : string.Format("{0:dd/MM/yyyy}", _unit.ExpBillOfLadingRepository.GetByID(frghtBillDoc.BLID).BLDate); result.FreightAgentID = frghtBillDoc.FreightAgentID; result.FreightAgentCode = frghtBillDoc.FreightAgentID == null ? "" : _unit.SysBuyerRepository.GetByID(frghtBillDoc.FreightAgentID).BuyerCode; result.FreightAgentName = frghtBillDoc.FreightAgentID == null ? "" : _unit.SysBuyerRepository.GetByID(frghtBillDoc.FreightAgentID).BuyerName; //result.NotifyTo = frghtBillDoc.NotifyTo; result.MSNo = frghtBillDoc.MSNo; result.MSDate = string.Format("{0:dd/MM/yyyy}", frghtBillDoc.MSDate); result.ShipmentOf = frghtBillDoc.ShipmentOf; result.ShipmentFrom = frghtBillDoc.ShipmentFrom; result.ShipmentTo = frghtBillDoc.ShipmentTo; result.WBNo = frghtBillDoc.WBNo; result.WBDate = string.Format("{0:dd/MM/yyyy}", frghtBillDoc.WBDate); result.FreightWeight = frghtBillDoc.FreightWeight; result.FreightRate = frghtBillDoc.FreightRate; result.FreightValue = frghtBillDoc.FreightValue; result.FreightBillCurrency = frghtBillDoc.FreightBillCurrency; result.ExchangeCurrency = frghtBillDoc.ExchangeCurrency; result.ExchangeRate = frghtBillDoc.ExchangeRate; result.ExchangeValue = frghtBillDoc.ExchangeValue; //result.THCharge = frghtBillDoc.THCharge; result.AirWayBill = frghtBillDoc.AirWayBill; result.FCSMYCCharge = frghtBillDoc.FCSMYCCharge; result.SSCMCCCharge = frghtBillDoc.SSCMCCCharge; result.OtherCharge = frghtBillDoc.OtherCharge; result.LocalCarringCharge = frghtBillDoc.LocalCarringCharge; result.CustomCharge = frghtBillDoc.CustomCharge; result.VATAsReceipt = frghtBillDoc.VATAsReceipt; result.LoadUnloadCharge = frghtBillDoc.LoadUnloadCharge; //result.GSPEXpence = frghtBillDoc.GSPEXpence; result.AgencyCommision = frghtBillDoc.AgencyCommision; result.SpecialDeliveryCharge = frghtBillDoc.SpecialDeliveryCharge; result.TotalAmt = frghtBillDoc.TotalAmt; //result.AdvanceAmt = frghtBillDoc.AdvanceAmt; //result.NetFreightAmt = frghtBillDoc.NetFreightAmt; result.TrminalCharge = frghtBillDoc.TrminalCharge; result.ExamineCharge = frghtBillDoc.ExamineCharge; result.AmendmentCharge = frghtBillDoc.AmendmentCharge; result.FreightBillNote = frghtBillDoc.FreightBillNote; result.RecordStatus = frghtBillDoc.RecordStatus; return(result); }