예제 #1
0
 public ExpressViewManifest GetBagDetail(int HubId, int CustomerId)
 {
     try
     {
         var list = new ExpressManifestRepository().GetBagsDetail(HubId, CustomerId);
         return(list);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #2
0
 public TradelaneFile GetBagLabel(int BagId)
 {
     try
     {
         var list = new ExpressManifestRepository().GetBagLabel(BagId);
         return(list);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #3
0
 public ExpressViewManifest GetManifestDetail(int ManifestId)
 {
     try
     {
         var list = new ExpressManifestRepository().GetManifestDetail(ManifestId);
         return(list);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #4
0
 public List <ExpressManifestModel> GetManifests(ExpressTrackManifest trackManifest)
 {
     try
     {
         var list = new ExpressManifestRepository().GetManifests(trackManifest);
         return(list);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #5
0
 public MainfestDetailModel GetNonManifestedShipments(int OperationZoneId, int UserId, int CreatedBy, string moduleType, string subModuleType)
 {
     try
     {
         var list = new ExpressManifestRepository().GetNonManifestedShipments(OperationZoneId, UserId, CreatedBy, moduleType, subModuleType);
         return(list);
     }
     catch (Exception e)
     {
         return(null);
     }
 }
예제 #6
0
        public List <HubDetailModel> GetHubs()
        {
            try
            {
                var list = new ExpressManifestRepository().GetHubs();
                return(list);
            }

            catch (Exception ex)
            {
                return(null);
            }
        }
예제 #7
0
        public IHttpActionResult UploadOtherDocument()
        {
            try
            {
                int id          = 0;
                var httpRequest = HttpContext.Current.Request;
                ShipmentRepository shipmentRepository = new ShipmentRepository();
                HttpFileCollection files = httpRequest.Files;
                //This code will execute only when user will upload the document
                if (files.Count > 0)
                {
                    int ShipmentId = Convert.ToInt32(httpRequest.Form["ShipmentId"].ToString());
                    int CustomerId = Convert.ToInt32(httpRequest.Form["CustomerId"].ToString());
                    int UserId     = Convert.ToInt32(httpRequest.Form["UserId"].ToString());
                    int HubId      = Convert.ToInt32(httpRequest.Form["HubId"].ToString());

                    var docfiles = new List <string>();

                    // Entry in tradelane tables
                    id = new ExpressManifestRepository().TradelaneEntryFromManifest(ShipmentId, UserId, CustomerId, HubId);

                    string filePathToSave = string.Format(FrayteTradelaneDocumentPath.ShipmentDocument, id);
                    string fileFullPath   = "";
                    filePathToSave = HttpContext.Current.Server.MapPath(filePathToSave);

                    if (!System.IO.Directory.Exists(filePathToSave))
                    {
                        System.IO.Directory.CreateDirectory(filePathToSave);
                    }

                    HttpPostedFile file = files[0];
                    if (!string.IsNullOrEmpty(file.FileName))
                    {
                        if (!File.Exists(filePathToSave + file.FileName))
                        {
                            //Save in server folder
                            fileFullPath = filePathToSave + file.FileName;
                            file.SaveAs(fileFullPath);

                            //Save file name and other information in DB
                            FrayteResult result = new TradelaneBookingRepository().SaveShipmentDocument(id, FrayteShipmentDocumentType.OtherDocument, file.FileName, UserId);

                            if (result.Status)
                            {
                                return(Ok(id));
                            }
                            else
                            {
                                return(BadRequest("OtherDocument"));
                            }
                        }
                        else
                        {
                            return(BadRequest("OtherDocument"));
                        }
                    }
                }
                if (id > 0)
                {
                    return(Ok(id));
                }
                return(BadRequest());
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }