Ejemplo n.º 1
0
        //cache this
        public JsonResult UsrObjPrp_SelectDeepSearchWeb(string PrntKy, string ObjTyp, string ObjNm)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

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


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

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

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


            foreach (ObjMasModel ob in list)
            {
                if (ob.isFirstFocusObj == 1)
                {
                    int x = 10;
                }
            }

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public async Task <JsonResult> UsrObjPrp_SelectDeepSearchWeb(string PrntKy, string ObjTyp, string ObjNm)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

            List <ObjMasModel> list = new List <ObjMasModel>();
            string             key  = "objMas" + PrntKy + ObjTyp + ObjNm;
            var itmList             = HTNCache.GetCachedObject(key);

            if (itmList != null)
            {
                list = (List <ObjMasModel>)itmList;
            }
            else
            {
                list = await apiOpr.UsrObjPrp_SelectWeb(HTNSession.Environment, CKy, UsrKy, PrntKy, ObjTyp, ObjNm, true);

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


            //foreach (ObjMasModel ob in list)
            //{
            //    if(ob.isFirstFocusObj == 1)
            //    {
            //        int x = 10;
            //    }
            //}

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

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

            string key     = "ObjMasObjSec" + "-" + "PrntKy " + PrntKy.ToString() + ":" + ObjTyp + ObjNm + "-" + "Cky:" + CKy.ToString() + "-" + UsrKy.ToString();
            var    objList = HTNCache.GetCachedObject(key);

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

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



            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public JsonResult GetAllItemsWithDept(int ItmTypKy, int Dept, int Cat, int ObjKy, int PageNo, int PageSize, int OnlyisAct, string ItmCd = "", string ItmNm = "")
        {
            int usrKy = HTNSession.UsrKy;
            int CKy   = HTNSession.CKy;
            //string AppCustmPath = WebConfigurationManager.AppSettings["AppCustmPath"];
            //string Path = AppCustmPath + "Images\\POSImage\\";
            //if(OnlyisAct== null)
            // OnlyisAct = 1; ///if 0 load all product if 1 load only active products

            // ItmCd = ""; // please add these in javascript if nedded (-Lelimo)
            // please add these in javascript if nedded (-Lelimo)
            int OriPageSize = PageSize;
            //PageSize = 100000;
            List <ItmMasModel> list = new List <ItmMasModel>();

            string key = ItmTypKy.ToString() + Dept.ToString() + Cat.ToString() + ItmCd + ItmNm + OnlyisAct.ToString();

            var itmList = HTNCache.GetCachedObject(key);

            if (itmList != null)
            {
                list = (List <ItmMasModel>)itmList;
            }
            else
            {
                list = Operation.GetAllItems(HTNSession.Environment, OnlyisAct, ItmTypKy, Dept, Cat, usrKy, CKy, ObjKy, ItmCd, ItmNm, PageNo, PageSize);
                if (list != null)
                {
                    HTNCache.SetCachedObject(key, list, 500);
                }
            }
            int EndP   = 1;
            int StartP = 0;

            if (list != null)
            {
                EndP   = EndPoint(OriPageSize, PageNo, list.Count);
                StartP = StartPoint(PageNo, EndP);
            }
            List <ItmMasModel> i = new List <ItmMasModel>();

            if (list != null)
            {
                i = list.Skip(StartP).Take(EndP).ToList();
            }

            return(Json(i, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public async Task <JsonResult> Code_SelectMob(string ObjKy, string TrnTypKy, string PreKy)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;
            List <Code_SelectMob> list = new List <Code_SelectMob>();
            string key      = prefix.Code + "-" + "ObjKy " + ObjKy.ToString() + ":" + TrnTypKy + PreKy + "-CKy:" + CKy + "-" + UsrKy.ToString();
            var    CodeList = HTNCache.GetCachedObject(key);

            if (CodeList != null)
            {
                list = (List <Code_SelectMob>)CodeList;
            }
            else
            {
                list = await apiOpr.CodeIdNm_SelectMob(HTNSession.Environment, CKy, UsrKy, Convert.ToInt32(ObjKy), Convert.ToInt32(TrnTypKy), Convert.ToInt32(PreKy));

                HTNCache.SetCachedObject(key, list, 3600);
            }
            return(Json(list, JsonRequestBehavior.AllowGet));
        }
        public async Task <JsonResult> CdNm_SelectMob(int ObjKy, int TrnTypKy, int PreKy)
        {
            string key   = ObjKy.ToString() + TrnTypKy.ToString() + PreKy.ToString();
            int    CKy   = HTNSession.CKy;
            int    UsrKy = HTNSession.UsrKy;
            // List<CdNm_SelectMob> list = new List<CdNm_SelectMob>();
            var list = HTNCache.GetCachedObject(key);

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

                HTNCache.SetCachedObject(key, list, 10000);
            }
            return(Json(list, JsonRequestBehavior.AllowGet));
        }
        public JsonResult OdrCode(string ObjKy, string BuKy, string PrjKy)
        {
            var    UsrKy       = HTNSession.UsrKy;
            var    CKy         = HTNSession.CKy;
            var    OdrKyCode   = new List <OrdrModel>();
            string key         = "OdrCode" + "-" + "ObjKy " + ObjKy + BuKy + PrjKy + "-CKy:" + CKy;
            var    OdrCodeList = HTNCache.GetCachedObject(key);

            if (OdrCodeList != null)
            {
                OdrKyCode = (List <OrdrModel>)OdrCodeList;
            }
            else
            {
                OdrKyCode = apiOpr.PaymentOdrCode(CKy, UsrKy, ObjKy, BuKy, PrjKy, HTNSession.Environment);
                HTNCache.SetCachedObject(key, OdrKyCode, 3600);
            }

            return(Json(OdrKyCode, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
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 + "-" + UsrKy.ToString();
            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.AdrIDNm_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.º 10
0
        public async Task <JsonResult> TaskNm_SelectMob(int ObjKy, int PrjKy)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

            List <TaskNm_SelectMob> list = new List <TaskNm_SelectMob>();
            string key        = prefix.TskNm + "-" + "ObjKy " + ObjKy.ToString() + ObjKy + ":" + PrjKy + "-CKy:" + CKy;
            var    TaskNmlist = HTNCache.GetCachedObject(key);

            if (TaskNmlist != null)
            {
                list = (List <TaskNm_SelectMob>)TaskNmlist;
            }
            else
            {
                list = await apiOpr.TaskNm_SelectMob(HTNSession.Environment, CKy, UsrKy, ObjKy, PrjKy);

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

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 11
0
        //********Project Combo**********

        public async Task <JsonResult> PrjID_SelectMob(int ObjKy, int TrnTypKy, int PreKy)
        {
            int CKy   = HTNSession.CKy;
            int UsrKy = HTNSession.UsrKy;

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

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

                HTNCache.SetCachedObject(key, list, 3600);
            }
            //HTNCache.ClearCacheItems("Acc");
            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());
        }