Пример #1
0
        public JsonResult EditInfo(RMS_Menus Mode)
        {
            Random rnd   = new Random();
            bool   IsAdd = false;

            if (!(Mode.Id != null && !Mode.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加
            {
                IsAdd = true;
            }
            if (IsAdd)
            {
                Mode.Id         = Guid.NewGuid();
                Mode.CreateTime = DateTime.Now;
                Mode.ModifyTime = DateTime.Now;
                Mode.IsEnable   = true;
                Mode.IsShow     = true;
                MDBiz.Add(Mode);
                SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "菜单管理--新增", true, WebClientIP, "菜单管理");
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            else
            {
                Mode.WhereExpression = RMS_MenusSet.Id.Equal(Mode.Id);
                //  spmodel.GroupId = GroupId;
                Mode.CreateTime = DateTime.Now;
                Mode.ModifyTime = DateTime.Now;
                if (MDBiz.Update(Mode) > 0)
                {
                    SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "菜单管理--修改", true, WebClientIP, "菜单管理");
                    return(Json("ok", JsonRequestBehavior.AllowGet));
                }
                else
                {
                    SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "菜单管理--修改", false, WebClientIP, "菜单管理");
                    return(Json("Nok", JsonRequestBehavior.AllowGet));
                }
            }
        }
Пример #2
0
        public JsonResult EditInfo(RMS_Menus Mode)
        {
            Random rnd   = new Random();
            bool   IsAdd = false;

            if (!(Mode.Id != null && !Mode.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加
            {
                IsAdd = true;
            }
            if (IsAdd)
            {
                Mode.Id         = Guid.NewGuid();
                Mode.CreateTime = DateTime.Now;
                Mode.ModifyTime = DateTime.Now;
                Mode.IsEnable   = true;
                Mode.IsShow     = true;
                MDBiz.Add(Mode);

                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            else
            {
                Mode.WhereExpression = RMS_MenusSet.Id.Equal(Mode.Id);
                //  spmodel.GroupId = GroupId;
                Mode.CreateTime = DateTime.Now;
                Mode.ModifyTime = DateTime.Now;
                if (MDBiz.Update(Mode) > 0)
                {
                    return(Json("ok", JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json("Nok", JsonRequestBehavior.AllowGet));
                }
            }
        }