Esempio n. 1
0
        public IActionResult SaveItem(string Id = null)
        {
            DMChucVuModel data           = new DMChucVuModel();
            string        ControllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
            int           IdDC           = Int32.Parse(MyModels.Decode(Id, API.Models.Settings.SecretId + ControllerName).ToString());

            data.SearchData = new SearchDMChucVu()
            {
                CurrentPage = 0, ItemsPerPage = 10, Keyword = ""
            };

            /*
             * if (HttpContext.Session.GetString(ControllerName + "_Search")!= null)
             * {
             *  data.SearchData = JsonConvert.DeserializeObject<SearchDMChucVu>(HttpContext.Session.GetString(ControllerName + "_Search"));
             * }*/
            if (IdDC == 0)
            {
                data.Item = new DMChucVu();
            }
            else
            {
                data.Item = DMChucVuService.GetItem(IdDC, API.Models.Settings.SecretId + ControllerName);
            }


            return(View(data));
        }