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)); }
//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)); }
//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)); }
public JsonResult ClearAllCachItem() { string Cky = HTNSession.CKy.ToString(); HTNCache.ClearCacheItems(Cky); return(Json("success", JsonRequestBehavior.AllowGet)); }
public JsonResult InsertHdrPurchaseReq(string purReqHdr, string ObjKy) { int cky = HTNSession.CKy; int usrKy = HTNSession.UsrKy; OrderNo OrdKy = apiOpr.InsertHdrPurchaseReq(HTNSession.Environment, cky, usrKy, Convert.ToInt32(ObjKy), purReqHdr); HTNCache.ClearCacheItems("OdrCode", "CKy-" + cky.ToString()); return(Json(OrdKy, JsonRequestBehavior.AllowGet)); }
// [HttpPost] public async Task <ActionResult> Insert(string updateGrid, string NewGridDetail) //string ItmTypKy) //List<ItmMasModel> list { int CKy = HTNSession.CKy; int UsrKy = HTNSession.UsrKy; HTNCache.ClearCacheItems(); //bool process = false; bool ItmKy = await Operation.InsertPOS(HTNSession.Environment, CKy, UsrKy, updateGrid, NewGridDetail); return(Json(ItmKy, JsonRequestBehavior.AllowGet)); }
public JsonResult ClearCachItem(string Key) { if (Key != null) { HTNCache.ClearCacheItems(Key); return(Json("success", JsonRequestBehavior.AllowGet)); } else { return(Json("Can't Clear", JsonRequestBehavior.AllowGet)); } }
public JsonResult UpdateHdrPurchaseReq(string purReqUpdtHdr, string ObjKy) { int cky = HTNSession.CKy; int usrKy = HTNSession.UsrKy; bool msg = apiOpr.UpdateHdrPurchaseReq(HTNSession.Environment, cky, usrKy, Convert.ToInt32(ObjKy), purReqUpdtHdr); if (msg) { HTNCache.ClearCacheItems("OdrCode", "CKy-" + cky.ToString()); } return(Json(msg, JsonRequestBehavior.AllowGet)); }
public ActionResult Insert(string updateGrid, string NewGridDetail) //string ItmTypKy) //List<ItmMasModel> list { int CKy = HTNSession.CKy; int UsrKy = HTNSession.UsrKy; //string AppCustmPath = WebConfigurationManager.AppSettings["AppCustmPath"]; //string Path = AppCustmPath + fileName; HTNCache.ClearCacheItems(); //bool process = false; bool ItmKy = Operation.InsertPOS(HTNSession.Environment, CKy, UsrKy, updateGrid, NewGridDetail); return(Json(ItmKy, JsonRequestBehavior.AllowGet)); }
public JsonResult UpdateAddressGrid(string updatedAdr) { int cKy = HTNSession.CKy; int usrKy = HTNSession.UsrKy; bool msg = apiOpr.UpdateAddressGrid(HTNSession.Environment, cKy, usrKy, updatedAdr); if (msg) { HTNCache.ClearCacheItems("AdrID", "CKy:" + cKy.ToString()); HTNCache.ClearCacheItems("AdrNm", "CKy:" + cKy.ToString()); } return(Json(msg, JsonRequestBehavior.AllowGet)); }
public JsonResult AccMassInsertUpdate(string updateAccmacc, string newAccmacc, string AccKy) { var UsrKy = HTNSession.UsrKy; var CKy = HTNSession.CKy; var AccMassInsertUpdate = apiOpr.AccMassInsertUpdate(HTNSession.Environment, CKy, UsrKy, newAccmacc, updateAccmacc); if (AccMassInsertUpdate) { HTNCache.ClearCacheItems("AccID", "CKy:" + CKy.ToString()); HTNCache.ClearCacheItems("AccNm", "CKy:" + CKy.ToString()); } return(Json(AccMassInsertUpdate, JsonRequestBehavior.AllowGet)); }
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)); }
public ActionResult InsertandUpdateProjects(string updateAccmacc, string newAccmacc, string PrjTyp) { bool process = false; int cky = HTNSession.CKy; int UsrKy = HTNSession.UsrKy; // Dont call each object from UI controller, Change the code to datalayer in API //foreach (CdMas model in list) //{ process = operation.InsertandUpdateProjects(HTNSession.Environment, updateAccmacc, newAccmacc, PrjTyp, cky, UsrKy); //} HTNCache.ClearCacheItems("PrjID", "CKy:" + cky.ToString()); HTNCache.ClearCacheItems("PrjNm", "CKy:" + cky.ToString()); return(Json(process, JsonRequestBehavior.AllowGet)); }
public JsonResult getAllrecodes() { var list = HTNCache.GetCacheItems(); string[] prefixlist = new string[] { "ItmID", "ItmNm", "PrjID", "PrjNm", "AccID", "AccNm", "AdrID", "AdrNm", "Code", "CdNm", "TskID", "TskNm", "BUCode", "BUNm", "ObjMas", "ObjMasObjSec" }; string CNm = HTNSession.CNm; string Cky = HTNSession.CKy.ToString(); List <CacheClear> finaloutput = new List <CacheClear>(); for (int i = 0; i < list.Count; i++) { var splitstr = list[i]; var str = splitstr.Split('-'); for (int j = 0; j < prefixlist.Length; j++) { if (prefixlist[j] == str[0]) { var checkobjky = str[1].Split(' '); var ckey = str[2].Split(':'); if (checkobjky[0] == "ObjKy") { var gettheobjky = checkobjky[1].Split(':'); if (Cky == ckey[1]) { finaloutput.Add(new CacheClear { Ky = splitstr, ComNm = str[0], Objky = gettheobjky[0], Cky = ckey[1], CNm = CNm }); } } else { var Checkprnky = checkobjky[1].Split(':'); if (Cky == ckey[1]) { finaloutput.Add(new CacheClear { Ky = splitstr, ComNm = str[0], PrntKy = Checkprnky[0], Cky = ckey[1], CNm = CNm }); } } } } } return(Json(finaloutput, 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)); }
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 ActionResult InsertCode(List<CdMas> list, string ConCd) //{ // bool process = false; // int cky = HTNSession.CKy; // int UsrKy = HTNSession.UsrKy; // // Dont call each object from UI controller, Change the code to datalayer in API // //foreach (CdMas model in list) // //{ // process = operation.InsertCode(HTNSession.Environment, list, ConCd, cky, UsrKy); // //} // return Json(process, JsonRequestBehavior.AllowGet); //} public ActionResult InsertUpdateCode(string updateAccmacc, string newAccmacc, string ConCd, string IsPrntChng, string objKy) { bool process = false; int cky = HTNSession.CKy; int UsrKy = HTNSession.UsrKy; // Dont call each object from UI controller, Change the code to datalayer in API //foreach (CdMas model in list) //{ process = operation.InsertUpdateCode(HTNSession.Environment, updateAccmacc, newAccmacc, ConCd, cky, UsrKy, IsPrntChng, objKy); if (process) { HTNCache.ClearCacheItems(prifix.CdID.ToString(), "CKy:" + cky.ToString()); HTNCache.ClearCacheItems(prifix.CdNm.ToString(), "CKy:" + cky.ToString()); HTNCache.ClearCacheItems(prifix.BUCode.ToString(), "CKy:" + cky.ToString()); HTNCache.ClearCacheItems(prifix.BUNm.ToString(), "CKy:" + cky.ToString()); } //} return(Json(process, JsonRequestBehavior.AllowGet)); }
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> 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)); }
//********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 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)); }
//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)); }
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()); }
public JsonResult GetCachelist() { var list = HTNCache.GetCacheItems(); return(Json(list, JsonRequestBehavior.AllowGet)); }