Beispiel #1
0
        public JsonResult UpdateRegister(int reg_id, string reg_status)
        {
            AjaxResultModel Result = new AjaxResultModel();

            try
            {
                TB_REGISTERS t = Registers_Service.GetById(reg_id);
                t.RegisterStatus = reg_status;
                if (Registers_Service.UpdateStatus(t.RegisterId, reg_status))
                {
                    Result.Code   = 000;
                    Result.Result = "Thành công";
                }
                else
                {
                    Result.Code   = 001;
                    Result.Result = "Không thành công";
                }
            }
            catch (Exception Ex)
            {
                Result.Code   = 2000;
                Result.Result = "Có lỗi xảy ra. Vui lòng thử lại sau hoặc liên hệ với người quản trị.";
                CORE.Helpers.IOHelper.WriteLog(StartUpPath, IpAddress, "UpdatePassword :", Ex.Message, Ex.ToString());
            }

            return(Json(Result));
        }
Beispiel #2
0
        public PartialViewResult _ChiTiet(int registerId = 0)
        {
            int height = (int)(Request.Browser.ScreenPixelsHeight * 0.85);

            TB_REGISTERS r = Registers_Service.GetById(registerId);

            ViewBag.Register = r;

            return(PartialView(height));
        }
Beispiel #3
0
        public PartialViewResult _MenuListDetail(int registerId = 0)
        {
            TB_REGISTERS regis     = Registers_Service.GetById(registerId);
            int          serviceId = regis.RegisterServiceId;
            int          menuId    = regis.RegisterMenuId;

            int height = (int)(Request.Browser.ScreenPixelsHeight * 0.85);

            TB_MENUS menu = Menus_Service.GetById(menuId);

            if (menu == null)
            {
                menu = new TB_MENUS();
            }
            menu.MenuServiceId = serviceId;
            ViewBag.Menu       = menu;

            List <V_Group_Menu>        details     = Menus_Service.GetAllDetails(menuId);
            List <TB_REGISTER_DETAILS> regisDetail = Registers_Service.GetByRegisterId(registerId);
            List <V_Group_Menu>        list        = new List <V_Group_Menu>();

            foreach (var item in details)
            {
                V_Group_Menu v = new V_Group_Menu();
                v = item;

                foreach (var data in item.MgroupDetail)
                {
                    if (regisDetail.Where(x => x.RdetailMdetailId == data.MdetailId).ToList().Count > 0)
                    {
                        v.MgroupDetail = new List <V_Details_Menu>();
                        v.MgroupDetail.Add(data);
                        list.Add(v);
                        break;
                    }
                }
            }

            ViewBag.Details = list;

            return(PartialView(height));
        }