Example #1
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
Example #2
0
        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
Example #3
0
        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);
            }
        }
Example #4
0
        public IEnumerable <DiscardSlip> GetDiscardSlipsOf(string AssetID)
        {
            IEnumerable <DiscardSlip> DiscardSlips = new GageServiceImpl().GetDiscardSlipsOf(AssetID);

            return(DiscardSlips);
        }
Example #5
0
        public IEnumerable <RepairSlip> GetRepairSlipsOf(string AssetID)
        {
            IEnumerable <RepairSlip> RepairSlips = new GageServiceImpl().GetRepairSlipsOf(AssetID);

            return(RepairSlips);
        }
Example #6
0
        public IEnumerable <LendSlip> GetAllLendSlips()
        {
            IEnumerable <LendSlip> LendSlips = new GageServiceImpl().GetAllLendSlips();

            return(LendSlips);
        }
Example #7
0
        public IEnumerable <LendSlip> GetLendSlipsOf(string AssetID)
        {
            IEnumerable <LendSlip> LendSlips = new GageServiceImpl().GetLendSlipsOf(AssetID);

            return(LendSlips);
        }
Example #8
0
        public IEnumerable <Gage> GetBy(string AssetID)
        {
            IEnumerable <Gage> Gages = new GageServiceImpl().GetBy(AssetID);

            return(Gages);
        }
Example #9
0
        public IEnumerable <Gage> SelectBy(GageFilter Filter)
        {
            IEnumerable <Gage> Gages = new GageServiceImpl().SelectBy(Filter);

            return(Gages);
        }
Example #10
0
        public IEnumerable <AssetFile> GetAssetFilesOf(string AssetID, string FileCategory)
        {
            IEnumerable <AssetFile> assetFiles = new GageServiceImpl().GetAssetFilesOf(AssetID, FileCategory);

            return(assetFiles);
        }