예제 #1
0
        public ResultConfigLog GetConfigLog()
        {
            var inputValue = HttpContext.Current.Request.Form["Inputs"];
            var StartTime = HttpContext.Current.Request.Form["StartTime"];
            var endTime = HttpContext.Current.Request.Form["EndTime"];
            var areaId = HttpContext.Current.Request.Form["AreaID"];
            QueryConfigLog model = Newtonsoft.Json.JsonConvert.DeserializeObject<QueryConfigLog>(inputValue);
            if (model == null)
                return null;

            if (!string.IsNullOrEmpty(StartTime))
            {
                DateTime dt = DateTime.Parse(StartTime.ToString());
                model.StartTime = dt;
            }
            if (!string.IsNullOrEmpty(endTime))
            {
                DateTime dt = DateTime.Parse(endTime.ToString());
                model.EndTime = dt;
            }
            if (!string.IsNullOrEmpty(areaId))
            {
                model.AreaID = int.Parse(areaId.ToString());
            }
            ResultConfigLog result = new AlloctionBLL().GetConfigLog(model);
            System.Web.Caching.Cache c = new System.Web.Caching.Cache();

            CacheHelper.SetCache("ConfigLog", result);

            return result;
        }
예제 #2
0
        public string GetConfigLogDetail()
        {
            var inputValue = HttpContext.Current.Request.Form["Inputs"];
            ResultConfigLog logList = new ResultConfigLog();
            if (CacheHelper.GetCache("ConfigLog") != null)
            {
                logList = (ResultConfigLog)CacheHelper.GetCache("ConfigLog");
            }
            else
            {
                logList = new AlloctionBLL().GetConfigLog(null);
                CacheHelper.SetCache("ConfigLog", logList);
            }

            BaseConfigLog model = logList.LogList.Where(a => a.SysNo == int.Parse(inputValue.ToString())).FirstOrDefault();
            if (model != null)
            {
                return Newtonsoft.Json.JsonConvert.SerializeObject(model.CFGDEC);
            }
            return "";
        }
예제 #3
0
        public string SaveAlloctionAndLog()
        {
            var inputValue = HttpContext.Current.Request.Form["Inputs"];
            var memo = HttpContext.Current.Request.Form["Memo"];

            QueryAlloction model = Newtonsoft.Json.JsonConvert.DeserializeObject<QueryAlloction>(inputValue);
            if (model == null)
                return null;

            for (int i = 1; i <= model.ListConfig.Count; i++)
            {
                TB_ALLOCTION_CONFIG m = model.ListConfig[(i - 1)];
                m.ALLOCTION_StartDate = m.ALLOCTION_EndDate.AddMonths(-1);
            }
            memo = memo.Replace('\'', '"');

            TB_ALLOCTION_CONFIG_History log = new TB_ALLOCTION_CONFIG_History();
            log.CFGDATE = model.ListConfig[0].ALLOCTION_EndDate;
            log.CFGDEC = memo;
            log.OPTIONUSER = Framework.Common.Utils.GetCookie("userid");
            log.CFGOBJECT = model.ListConfig[0].ParentAREAID;
            log.OPTIONTIME = DateTime.Now;
            log.PAYClass = model.ListConfig[0].PAYClass;
            model.ConfigLog = log;
            var result = new AlloctionBLL().SaveAlloctionAndLog(model);
            result.TreeName = model.ParentName;
            return Newtonsoft.Json.JsonConvert.SerializeObject(result);
        }
예제 #4
0
        public string GetTreeObj()
        {
            var inputValue = HttpContext.Current.Request.Form["Inputs"];
            QueryTreeObj model = Newtonsoft.Json.JsonConvert.DeserializeObject<QueryTreeObj>(inputValue);
            if (model == null)
                return null;

            var result = new AlloctionBLL().GetTreeObjByID(model);

            return Newtonsoft.Json.JsonConvert.SerializeObject(result);
        }