public bool DeleteAssetFile(GageAdjustReport paras) { int API = 13; string token = HttpContext.Current.Request.Headers.Get("token"); if (Models.UniversalModels.User.IsValidToken(token)) { User CurrentUser = Models.UniversalModels.User.GetUserByToken(token); if (Models.UniversalModels.User.IsContainsCurrentAPIPermission(CurrentUser.UserID, API)) { Log log = new Log(API, CurrentUser); log.Add(token + "|" + nameof(paras) + ":" + JsonConvert.SerializeObject(paras)); try { bool s = new GageServiceImpl().DeleteAssetFile(paras.ID); return(s); } catch (Exception ex) { log.Add("Exception:" + ex.Message + "|" + ex.StackTrace); return(false); } } } throw new HttpResponseException(HttpStatusCode.Forbidden); }//13
public bool UploadAssetFile() { int API = 12; string token = HttpContext.Current.Request.Headers.Get("token"); string AssetID = Convert.ToString(HttpContext.Current.Request.Headers.GetValues("AssetID").First()); string FileCategory = Convert.ToString(HttpContext.Current.Request.Headers.GetValues("FileCategory").First()); HttpPostedFile postedFile = HttpContext.Current.Request.Files[0]; if (Models.UniversalModels.User.IsValidToken(token)) { User CurrentUser = Models.UniversalModels.User.GetUserByToken(token); if (Models.UniversalModels.User.IsContainsCurrentAPIPermission(CurrentUser.UserID, API)) { Log log = new Log(API, CurrentUser); log.Add(token + "|" + "AssetID:" + AssetID + " FileCategory:" + FileCategory); try { bool s = new GageServiceImpl().UploadAssetFile(postedFile, log.RequestID, FileCategory, AssetID); return(s); } catch (Exception ex) { log.Add("Exception:" + ex.Message + "|" + ex.StackTrace); return(false); } } } throw new HttpResponseException(HttpStatusCode.Forbidden); }//12
public string GetGageLedgerDownloadURL(GageFilter Filter) { string excel_name = new GageServiceImpl().ExportGageLedgerToExcel(Filter); if (excel_name != null) { return("http://192.168.9.49:8020/report/" + excel_name); } else { return(null); } }
public IEnumerable <DiscardSlip> GetDiscardSlipsOf(string AssetID) { IEnumerable <DiscardSlip> DiscardSlips = new GageServiceImpl().GetDiscardSlipsOf(AssetID); return(DiscardSlips); }
public IEnumerable <RepairSlip> GetRepairSlipsOf(string AssetID) { IEnumerable <RepairSlip> RepairSlips = new GageServiceImpl().GetRepairSlipsOf(AssetID); return(RepairSlips); }
public IEnumerable <LendSlip> GetAllLendSlips() { IEnumerable <LendSlip> LendSlips = new GageServiceImpl().GetAllLendSlips(); return(LendSlips); }
public IEnumerable <LendSlip> GetLendSlipsOf(string AssetID) { IEnumerable <LendSlip> LendSlips = new GageServiceImpl().GetLendSlipsOf(AssetID); return(LendSlips); }
public IEnumerable <Gage> GetBy(string AssetID) { IEnumerable <Gage> Gages = new GageServiceImpl().GetBy(AssetID); return(Gages); }
public IEnumerable <Gage> SelectBy(GageFilter Filter) { IEnumerable <Gage> Gages = new GageServiceImpl().SelectBy(Filter); return(Gages); }
public IEnumerable <AssetFile> GetAssetFilesOf(string AssetID, string FileCategory) { IEnumerable <AssetFile> assetFiles = new GageServiceImpl().GetAssetFilesOf(AssetID, FileCategory); return(assetFiles); }