Ejemplo n.º 1
0
        public async Task <JsonResult> AdrID_SelectMob(int ObjKy, int TrnTypKy, int PreKy)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

            string key = prefix.AdrID + "-" + "ObjKy " + ObjKy.ToString() + ":" + TrnTypKy + PreKy + "-CKy:" + CKy;
            List <AdrID_SelectMob> list = new List <AdrID_SelectMob>();
            var AdrIDList = HTNCache.GetCachedObject(key);

            if (AdrIDList != null)
            {
                list = (List <AdrID_SelectMob>)AdrIDList;
            }
            else
            {
                list = await apiOpr.AdrID_SelectMob(HTNSession.Environment, CKy, UsrKy, ObjKy, TrnTypKy, PreKy);

                HTNCache.SetCachedObject(key, list, 3600);
            }
            return(Json(list, JsonRequestBehavior.AllowGet));
        }
        //Bu
        public JsonResult BUNMLookup(string ObjKy, string PreKy = "1")
        {
            int UsrKy = HTNSession.UsrKy;
            int CKy   = HTNSession.CKy;

            List <BUModel> PettySettle = new List <BUModel>();
            string         key         = "BUNm" + "-" + "ObjKy " + ObjKy.ToString() + ":" + PreKy + "-CKy:" + CKy;
            var            BUNmlist    = HTNCache.GetCachedObject(key);

            if (BUNmlist != null)
            {
                PettySettle = (List <BUModel>)BUNmlist;
            }
            else
            {
                PettySettle = apiOpr.BUNMLookup(HTNSession.Environment, CKy, UsrKy, ObjKy, PreKy);
                HTNCache.SetCachedObject(key, PettySettle, 3600);
            }


            return(Json(PettySettle, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        //have to cache
        public JsonResult UsrObjPrp_SelectAllLastChildWeb(string PrntKy)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

            List <ObjMasModel> list = new List <ObjMasModel>();

            string key     = "ObjMas" + "-" + "PrntKy " + PrntKy.ToString() + "-" + "CKy:" + CKy.ToString() + "-" + UsrKy.ToString();
            var    objList = HTNCache.GetCachedObject(key);

            if (objList != null)
            {
                list = (List <ObjMasModel>)objList;
            }

            if (objList == null)
            {
                list = apiOpr.UsrObjPrp_SelectAllLastChildWeb(HTNSession.Environment, CKy, UsrKy, PrntKy);
                HTNCache.SetCachedObject(key, list, 3600);
            }

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GoodRecivedNote(int?ObjectCode)
        {
            if (!ObjectCode.HasValue)
            {
                ObjectCode = 14590;
            }

            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

            List <ObjMasModel> list = new List <ObjMasModel>();

            string key     = "ObjMass" + "-" + "PrntKy " + ObjectCode.ToString() + "-" + "CKy:" + CKy.ToString() + "-" + UsrKy.ToString();
            var    objList = HTNCache.GetCachedObject(key);



            if (objList != null)
            {
                list = (List <ObjMasModel>)objList;
            }

            if (objList == null)
            {
                list = apiOpr.UsrObjPrp_SelectAllLastChildWeb(HTNSession.Environment, CKy, UsrKy, ObjectCode.Value.ToString());
                HTNCache.SetCachedObject(key, list, 3600);
            }

            string json = Newtonsoft.Json.JsonConvert.SerializeObject(list);

            ViewBag.FormChildren = list;
            ViewBag.ObjectCode   = ObjectCode;


            return(View());
        }
Ejemplo n.º 5
0
        public async Task <JsonResult> PrjNm_SelectMob(int ObjKy, int TrnTypKy, int PreKy)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

            List <PrjNm_SelectMob> list = new List <PrjNm_SelectMob>();
            string key       = prefix.PrjNm + "-" + "ObjKy " + ObjKy.ToString() + ":" + TrnTypKy + PreKy + "-CKy:" + CKy;
            var    PrjNmList = HTNCache.GetCachedObject(key);

            if (PrjNmList != null)
            {
                list = (List <PrjNm_SelectMob>)PrjNmList;
            }
            else
            {
                list = await apiOpr.PrjNm_SelectMob(HTNSession.Environment, CKy, UsrKy, ObjKy, TrnTypKy, PreKy);

                HTNCache.SetCachedObject(key, list, 3600);
            }

            return(Json(list, JsonRequestBehavior.AllowGet));
            //Clear the Cache use this function
            //HTNCache.ClearCacheItems("Prj");
        }