Esempio n. 1
0
        private void LoginView2_Load(object sender, EventArgs e)
        {
            this.cb_UserRole.Items.Clear();
            List <User_ListModel> userList = bllUser.GetModelList("");

            foreach (User_ListModel m in userList)
            {
                this.cb_UserRole.Items.Add(m.UserName);
            }
            //   this.cb_UserRole.Items.AddRange(new string[] {"操作员","管理员","系统维护"});
            this.cb_UserRole.SelectedIndex = 0;
        }
Esempio n. 2
0
 private void SaveUserEventHandler(object sender, UserSaveEventArgs e)
 {
     if (bllUser.IsExistUser(e.RoleId, e.UserName) == false)
     {
         User_ListModel userModel = new User_ListModel();
         userModel.RoleID       = e.RoleId;
         userModel.RoleName     = e.RoleName;
         userModel.UserName     = e.UserName;
         userModel.UserID       = e.UserID;
         userModel.UserPassWord = e.Password;
         bool saveStatus = bllUser.Update(userModel);
         if (saveStatus == true)
         {
             List <User_ListModel> userModelList = bllUser.GetModelList("");
             this.View.RefreshAllUserData(userModelList);
             if (mainPre != null)
             {
                 mainPre.ShowLog(ECAMSModel.EnumLogCategory.管理层日志, ECAMSModel.EnumLogType.提示, "用户修改成功!!");
             }
         }
         else
         {
             if (mainPre != null)
             {
                 mainPre.ShowLog(ECAMSModel.EnumLogCategory.管理层日志, ECAMSModel.EnumLogType.提示, "用户修改失败!!");
             }
         }
     }
     else
     {
         if (mainPre != null)
         {
             mainPre.View.AddLog(ECAMSModel.EnumLogCategory.管理层日志, ECAMSModel.EnumLogType.提示, "已存在同角色同名称用户!!");
         }
     }
 }