Exemple #1
0
        public async Task <bool> UpdateModuleOperateAsync(ModuleOperate moduleOperate)
        {
            ModuleOperate newModuleOperate = null;

            newModuleOperate = await _moduleOperateRepository.UpdateAsync(moduleOperate);

            return(newModuleOperate != null);
        }
Exemple #2
0
        /// <summary>
        /// 3. 形成用户信息
        /// </summary>
        /// <param name="dtUser"></param>
        /// <returns></returns>
        private AppUser GenerateUserInfo(DataTable dtUser)
        {
            AppUser workUser = new AppUser();

            workUser.UserID        = dtUser.Rows[0]["UserID"].ToString();
            workUser.LoginName     = dtUser.Rows[0]["LoginName"].ToString();
            workUser.UserName      = dtUser.Rows[0]["UserName"].ToString();
            workUser.LastLoginTime = dtUser.Rows[0]["LastLoginTime"].ToString();
            workUser.qyID          = dtUser.Rows[0]["JGID"].ToString2();
            workUser.zzjgdm        = dtUser.Rows[0]["ZZJGDM"].ToString2();

            string userType = dtUser.Rows[0]["UserType"].ToString2();

            if (!string.IsNullOrEmpty(userType))
            {
                workUser.UserType = (UserType)Enum.Parse(typeof(UserType), userType);
            }

            //权限相关
            YhglBLL              yhglBLL = new YhglBLL(workUser);
            DataTable            dt      = yhglBLL.Get_UserRights_List().Result;
            List <ModuleOperate> list    = new List <ModuleOperate>();
            ModuleOperate        model;

            foreach (DataRow row in dt.Rows)
            {
                model             = new ModuleOperate();
                model.moduleCode  = row["ModuleCode"].ToString2();
                model.operateCode = row["OperateCode"].ToString2();
                list.Add(model);
            }
            workUser.list = list;

            //if (workUser.UserType.ToString() == UserType.监理单位.ToString()  || workUser.UserType.ToString() == UserType.代理机构.ToString() || workUser.UserType.ToString() == UserType.申报部门.ToString())
            //{
            //    DataTable dt = systemDal.GetQyInfo(workUser.UserID);
            //    if (dt.Rows.Count > 0)
            //    {
            //        workUser.qyID = dt.Rows[0]["qyID"].ToString();
            //        workUser.zzjgdm = dt.Rows[0]["zzjgdm"].ToString();
            //    }
            //}
            //else if (workUser.UserType.ToString() == UserType.实施单位.ToString())
            //{
            //    DataTable dt = systemDal.GetJsdwInfo(workUser.UserID);
            //    if (dt.Rows.Count > 0)
            //    {
            //        workUser.qyID = dt.Rows[0]["jsdwID"].ToString();
            //        workUser.zzjgdm = dt.Rows[0]["zzjgdm"].ToString();
            //    }
            //}
            //else
            //{
            //    workUser.qyID = string.Empty;
            //    workUser.zzjgdm = string.Empty;
            //}
            return(workUser);
        }
Exemple #3
0
        public async Task <bool> CreateModuleOperate(ModuleOperateDto input)
        {
            ModuleOperate newModuleOperate = new ModuleOperate()
            {
                OperateCode = input.OperateCode,
                OperateName = input.OperateName,
                ModuleId    = input.ModuleId,
                IsValid     = input.IsValid,
                Url         = input.Url,
                Icon        = input.Icon,
                Sort        = input.Sort,
            };

            return(await _moduleManager.CreateModuleOperateAsync(newModuleOperate));
        }
        //模块操作添加
        public Dictionary <string, object> OperateAdd(ModuleOperate model)
        {
            model.CreateTime     = DateTime.Now;
            model.CreateUserId   = ManageProvider.Provider.Current().UserId;
            model.CreateUserName = ManageProvider.Provider.Current().Account;
            if (model.ModuleOperateId == 0)
            {
                if (ModuleOperateBll.ModuleOperateAdd(model) > 0)
                {
                    sysLogBll.WriteLog <ModuleOperate>(model, OperationType.Add, (int)LogSatus.Success, "模块操作添加");
                    return(new Dictionary <string, object>
                    {
                        { "code", 1 },
                    });
                }
                else
                {
                    return(new Dictionary <string, object>
                    {
                        { "code", 0 },
                        { "msg", "添加失败" }
                    });
                }
            }
            else
            {
                ModuleOperate oldmodel = new ModuleOperate();
                oldmodel = ModuleOperateBll.GetModel(model.ModuleOperateId);
                if (ModuleOperateBll.ModuleOperateEdit(model) > 0)
                {
                    sysLogBll.WriteLog <ModuleOperate>(oldmodel, model, OperationType.Update, (int)LogSatus.Success, "模块操作修改");

                    return(new Dictionary <string, object>
                    {
                        { "code", 1 },
                    });
                }
                else
                {
                    return(new Dictionary <string, object>
                    {
                        { "code", 0 },
                        { "msg", "修改失败" }
                    });
                }
            }
        }
Exemple #5
0
        public ActionResult OperateAdd()
        {
            ModuleOperateBll Bll   = new ModuleOperateBll();
            ModuleOperate    model = new ModuleOperate();

            if (Request.QueryString["operateid"] != null)
            {
                model = Bll.GetModel(int.Parse(Request.QueryString["operateid"].ToString()));
            }
            else
            {
                model.ModuleId = int.Parse(Request.QueryString["moduleid"]);
                model.Enabled  = 1;
            }

            return(View(model));
        }
        public Dictionary <string, object> ModuleOperateDel()
        {
            IDatabase            database      = DataFactory.Database();
            DbTransaction        isOpenTrans   = database.BeginTrans();
            var                  context       = (HttpContextBase)Request.Properties["MS_HttpContext"];
            var                  request       = context.Request;
            string               operateidlist = request.Form["operateid"];
            List <ModuleOperate> list          = new List <ModuleOperate>();

            string[] arrid = operateidlist.Split(',');
            for (int i = 0; i < operateidlist.Length; i++)
            {
                ModuleOperate model = new ModuleOperate();
            }
            try
            {
                StringBuilder sbModuleOperateRole = new StringBuilder(" delete   ModuleOperateRole where ModuleOperateId in (" + operateidlist + ")");
                database.ExecuteBySql(sbModuleOperateRole, isOpenTrans);
                StringBuilder sbModuleOperate = new StringBuilder("delete ModuleOperate where ModuleOperateId in (" + operateidlist + ")");
                database.ExecuteBySql(sbModuleOperate, isOpenTrans);
                SysLogBll sysLogBll = new SysLogBll();
                database.Commit();
                sysLogBll.WriteLog <ModuleOperate>(list, (int)Utilities.LogSatus.Success, "模块按钮删除删除");

                return(new Dictionary <string, object>
                {
                    { "code", "1" }
                });
            }
            catch (Exception)
            {
                return(new Dictionary <string, object>
                {
                    { "code", "0" }
                });
            }
        }
        public Dictionary <string, object> ModuleAdd(Module model)
        {
            model.CreateTime   = DateTime.Now;
            model.CreateUserId = ManageProvider.Provider.Current().UserId;
            if (model.ModuleId == 0)
            {
                int newid = mduleBll.ModuleAdd(model);
                if (newid > 0)
                {
                    List <ModuleOperate> list = new List <ModuleOperate>();
                    var operate = new ModuleOperate();
                    operate.CreateTime        = model.CreateTime;
                    operate.CreateUserId      = model.CreateUserId;
                    operate.CreateUserName    = ManageProvider.Provider.Current().Account;
                    operate.ModuleId          = newid;
                    operate.ModuleOperateName = "添加";
                    operate.JsEvent           = "btn_add()";
                    operate.Sort    = 1;
                    operate.Icon    = "&#xe600";
                    operate.Enabled = 1;
                    list.Add(operate);
                    var operate1 = new ModuleOperate();
                    operate1.CreateTime        = model.CreateTime;
                    operate1.CreateUserId      = model.CreateUserId;
                    operate1.CreateUserName    = ManageProvider.Provider.Current().Account;
                    operate1.ModuleId          = newid;
                    operate1.ModuleOperateName = "编辑";
                    operate1.JsEvent           = "btn_edit()";
                    operate1.Sort    = 1;
                    operate1.Icon    = "&#xe60c";
                    operate1.Enabled = 1;
                    list.Add(operate1);
                    var operate2 = new ModuleOperate();
                    operate2.CreateUserName    = ManageProvider.Provider.Current().Account;
                    operate2.CreateTime        = model.CreateTime;
                    operate2.CreateUserId      = model.CreateUserId;
                    operate2.ModuleId          = newid;
                    operate2.ModuleOperateName = "删除";
                    operate2.JsEvent           = "btn_del()";
                    operate2.Sort    = 1;
                    operate2.Icon    = "&#xe6e2";
                    operate2.Enabled = 1;
                    list.Add(operate2);
                    ModuleOperateBll.CreateOperateAfterModuleAdd(list);

                    return(new Dictionary <string, object>
                    {
                        { "code", "1" }
                    });
                }
                else
                {
                    return(new Dictionary <string, object>
                    {
                        { "code", "0" },
                        { "msg", "添加失败" }
                    });
                }
            }
            else
            {
                if (model.Icon == null)
                {
                    model.Icon = "";
                }

                if (mduleBll.ModuleEdit(model) > 0)
                {
                    return(new Dictionary <string, object>
                    {
                        { "code", "1" }
                    });
                }
                else
                {
                    return(new Dictionary <string, object>
                    {
                        { "code", "0" },
                        { "msg", "修改失败" }
                    });
                }
            }
        }
Exemple #8
0
 public int ModuleOperateEdit(ModuleOperate model)
 {
     return(ModuleOperateDal.GetInstance().ModuleOperateEdit(model));
 }