public bool DeleteAdjustReport(int AdjustReport_ID) { GageAdjustReport report = GageAdjustReport.GetBy(AdjustReport_ID); report.Delete(); return(true); }
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 UploadAdjustReport(HttpPostedFile postedFile, int RequestID, int AdjustSlip_ID) { byte[] fileContents = new byte[postedFile.ContentLength]; postedFile.InputStream.Read(fileContents, 0, fileContents.Length); string SavedName = RequestID + "_" + postedFile.FileName; if (Common.FtpRepository.UploadFile(fileContents, "/AssetSystem/GageAdjustReport/", SavedName) == true) { GageAdjustReport Report = new GageAdjustReport(); Report.FK_AdjustSlip_ID = AdjustSlip_ID; Report.Date = DateTime.Now; Report.Path = "http://192.168.9.3:8888/AssetSystem/GageAdjustReport/" + SavedName; Report.Add(); } return(true); }
public IEnumerable <GageAdjustReport> GetAdjusReportsOf(int AdjustSlip_ID) { return(GageAdjustReport.GetReportsOf(AdjustSlip_ID)); }