예제 #1
0
        public bool DeleteAdjustReport(int AdjustReport_ID)
        {
            GageAdjustReport report = GageAdjustReport.GetBy(AdjustReport_ID);

            report.Delete();
            return(true);
        }
예제 #2
0
        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
예제 #3
0
        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);
        }
예제 #4
0
 public IEnumerable <GageAdjustReport> GetAdjusReportsOf(int AdjustSlip_ID)
 {
     return(GageAdjustReport.GetReportsOf(AdjustSlip_ID));
 }