public CreateBagModel CreateBag(string AWBNumber, int ScannedBy, int MobileEventId) { CreateBagModel result = new ExpressScannedAWBRepository().CreateBag(AWBNumber, ScannedBy, MobileEventId); if (result.BagId > 0 && result.Status == true && result.IsBagCreated == true) { var result1 = new TradelaneDocument().ShipmentExportBagNumber(result.BagId, ScannedBy); result.FilePath = result1.FilePath; result.FileName = result1.FileName; } Elmah.ErrorLog.GetDefault(null).Log(new Elmah.Error(new Exception("AWBNumber, ScannedBy, MobileEventId values for CreateBag Action is : " + AWBNumber + ", " + ScannedBy + ", " + MobileEventId))); return(result); }
public CreateBagModel BagClose(int BagId) { var BagDtl = new ExpressScannedAWBRepository().BagClose(BagId); if (BagDtl.BagId > 0 && BagDtl.Status == true) { var result1 = new TradelaneDocument().ShipmentBagLabel(BagDtl.BagId, BagDtl.CustomerId); BagDtl.FilePath = result1.FilePath; BagDtl.FileName = result1.FileName; } Elmah.ErrorLog.GetDefault(null).Log(new Elmah.Error(new Exception("BagId value for BagClose Action is : " + BagId))); return(BagDtl); }
public string GetAwb(ExpressShipmentModel expressBookingDetail, ExpressShipmentRequest frayteShipmentRequest, string AwbNo, string AwbFrom) { string Awbno = string.Empty; if (AwbFrom == "NoNUI") { AwbAgain: var awbNo = frayteShipmentRequest.Security.AccountNumber.Substring(0, 3).ToString() + new Random().Next(100000000, 999999999); var Result = dbContext.Expresses.Where(a => a.AWBBarcode == awbNo).FirstOrDefault(); if (Result == null) { ScanInitalAwbModel SIAM = new ScanInitalAwbModel(); SIAM.AwbNumber = awbNo; SIAM.MobileEventId = 1; SIAM.ScannedBy = GetCustomerDetail(frayteShipmentRequest.Security.AccountNumber).CustomerId; var AwbDetial = new ExpressScannedAWBRepository().CollectionScanMobileAwb(SIAM); expressBookingDetail.ExpressId = AwbDetial.ExpressId; Awbno = AwbDetial.AwbNumber; expressBookingDetail.ShipmentStatusId = dbContext.Expresses.Where(a => a.ExpressId == AwbDetial.ExpressId).FirstOrDefault().ShipmentStatusId; } else { goto AwbAgain; } } else { var Result = dbContext.Expresses.Where(a => a.AWBBarcode == AwbNo).FirstOrDefault(); if (Result == null) { ScanInitalAwbModel SIAM = new ScanInitalAwbModel(); SIAM.AwbNumber = AwbNo; SIAM.MobileEventId = 1; SIAM.ScannedBy = GetCustomerDetail(frayteShipmentRequest.Security.AccountNumber).CustomerId; var AwbDetial = new ExpressScannedAWBRepository().CollectionScanMobileAwb(SIAM); expressBookingDetail.ExpressId = AwbDetial.ExpressId; Awbno = AwbDetial.AwbNumber; expressBookingDetail.ShipmentStatusId = dbContext.Expresses.Where(a => a.ExpressId == AwbDetial.ExpressId).FirstOrDefault().ShipmentStatusId; } } return(Awbno); }
public CreateBagModel GetBagLabel(int BagId) { var BagDtl = new ExpressScannedAWBRepository().GetBagsModel(BagId); if (BagDtl.BagId > 0) { BagDtl.Status = false; var result1 = new TradelaneDocument().ShipmentBagLabel(BagDtl.BagId, BagDtl.CustomerId); if (!string.IsNullOrEmpty(result1.FileName) && !string.IsNullOrEmpty(result1.FilePath)) { BagDtl.FilePath = result1.FilePath; BagDtl.FileName = result1.FileName; BagDtl.Status = true; } } else { BagDtl.Status = false; } Elmah.ErrorLog.GetDefault(null).Log(new Elmah.Error(new Exception("BagId value for GetBagLabel Action is : " + BagId))); return(BagDtl); }