Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            UserInfo userInfo = GetModel();

            UserInfoBll bll = new UserInfoBll();

            if (UserId == 0)
            {
                DepartmentBll departmentBll = new DepartmentBll();
                DepartmentInfo departmentInfo = departmentBll.GetDepartmentById(DepartmentId);
                if (departmentInfo != null && departmentInfo.DepartmentId > 0)
                {
                    userInfo.DepartmentCode = departmentInfo.DepartmentCode;
                }
                bll.AddUserInfo(userInfo);

            }
            else
            {
                userInfo.UserId = UserId;
                bll.Update(userInfo);
            }

            Page.RegisterClientScriptBlock("", "<script>alert('保存成功');CloseWin();</script>");
        }
        private void InitData()
        {
            ProjectBll projectBll = new ProjectBll();

            ProjectInfo projectInfo = projectBll.GetProjectById(ProjectId);

            if (projectInfo != null)
            {
                lblProjectName.Text = projectInfo.ProjectName;
                if (projectInfo.CustomerId > 0)
                {
                    CustomerBll customerBll = new CustomerBll();

                    CustomerInfo customerInfo = customerBll.GetCustomerById(projectInfo.CustomerId);

                    if (customerInfo != null)
                    {
                        lblCustomerName.Text = customerInfo.CustomerName;
                    }
                }
                if (projectInfo.BussinessUserId > 0)
                {
                    UserInfoBll userInfoBll = new UserInfoBll();

                    UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.BussinessUserId);

                    if (userInfo != null)
                    {
                        lblBusinessName.Text = userInfo.UserName;
                    }
                }

                if (projectInfo.ResponseUserId > 0)
                {
                    UserInfoBll userInfoBll = new UserInfoBll();

                    UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.ResponseUserId);

                    if (userInfo != null)
                    {
                        lblResponseName.Text = userInfo.UserName;
                    }

                    hidUserId.Value = projectInfo.ResponseUserId.ToString();
                }

                if (projectInfo.CreatedUserId > 0)
                {
                    UserInfoBll userInfoBll = new UserInfoBll();

                    UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.CreatedUserId);

                    if (userInfo != null)
                    {
                        lblCreateUser.Text = userInfo.UserName;
                    }
                }

            }
        }
Пример #3
0
        private void InitGridView()
        {
            string userIdOrUserName = txtUserName.Text.Trim();
            UserInfoBll userInfoBll = new UserInfoBll();

            DataSet ds= userInfoBll.GetUserList(userIdOrUserName, DepartmentId);

            gvUserList.DataSource = ds;
            gvUserList.DataBind();
        }
Пример #4
0
        public void LoginTest()
        {
            int systemId = 0;
            int userId = 0; 
            string userName = "";
            List<RoleInfo> roleList = null;
            UserInfoBll userInfo = new UserInfoBll();
            int rlt = userInfo.Login(Consts.ConstValue.SystemCode, "admin", "admin", out systemId, out userId, out userName, out roleList);

        }
Пример #5
0
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            int userId = 0;
            int.TryParse(((System.Web.UI.WebControls.WebControl)sender).ToolTip, out userId);

            UserInfoBll userInfoBll = new UserInfoBll();

            userInfoBll.DeleteByUserId(userId);
            Page.RegisterClientScriptBlock("", "<script>alert('删除成功');</script>");
            InitGridView();
        }
Пример #6
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            UserInfoBll userInfoBll = new UserInfoBll();

            string userIdOrUserName = txtUserName.Text.Trim();
            int deparemntId = Convert.ToInt32( ddlDepartment.SelectedValue);

            DataSet ds = userInfoBll.GetUserList(userIdOrUserName, deparemntId);

            gvUserList.DataSource = ds;
            gvUserList.DataBind();
        }
Пример #7
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string userCode = "fanruiquan";// txtUserName.Text.Trim();
            string password = "123456";// txtPassword.Text.Trim();

            UserInfoBll userBll = new UserInfoBll();

            UserInfo userInfo = userBll.GetUserByCode(userCode);

            PageBase pageBase = new PageBase();

            if(pageBase.Login(userInfo,password ))
            {
                Response.Redirect("Main.aspx");
            }
        }
Пример #8
0
 private void bthlogin_Click(object sender, EventArgs e)
 {
     //登录
     if (CheakLoginNameAndPwd())
     {
      //都不为空
         UserInfoBll userBll = new UserInfoBll();
         LoginStatus result = userBll.GetUserInfoByLoginName(txtname.Text, txtpwd.Text);
         if (result == LoginStatus.LoginNameNotFound)
         {
             md.MsgDivShow("账号不存在", 1);
         }
         else if (result == LoginStatus.PasswordError)
         {
             md.MsgDivShow("密码错误了", 1);
         }
         else if (result == LoginStatus.OK)
         {
             md.MsgDivShow("登录成功", 1,Bind);
         }
     }
 }
        private void InitData()
        {
            ProjectBll projectBll = new ProjectBll();

            ProjectInfo projectInfo = projectBll.GetProjectById(ProjectId);

            if(projectInfo!=null &&projectInfo.ProjectId>0)
            {
                txtProjectName.Text = projectInfo.ProjectName;

                ddlCustomerList.SelectedValue = projectInfo.CustomerId.ToString();

                UserInfoBll userInfoBll = new UserInfoBll();

                UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.BussinessUserId);

                if(userInfo != null)
                {
                    lblBusinessName.Text = userInfo.UserName;
                    hidUserId.Value = userInfo.UserId.ToString();
                }
            }
        }
Пример #10
0
 public void Dispose()
 {
     this._DataDictionaryBll = null;
     this._EmployeeBll = null;
     this._IPBlacklistBll = null;
     this._MenuInfoBll = null;
     this._OrganizationBll = null;
     this._PurviewInfoBll = null;
     this._RoleInfoBll = null;
     this._RolePurviewBll = null;
     this._SysLogBll = null;
     this._SysLoginLogBll = null;
     this._SystemExceptionLogBll = null;
     this._SystemInfoBll = null;
     this._UserInfoBll = null;
     this._UserPurviewBll = null;
     this._UserRoleBll = null;
 }
Пример #11
0
        private void InitNotExistUserGridView()
        {
            UserInfoBll userBll = new UserInfoBll();
            List<UserInfo> userList = userBll.GetNotUserListByRoleId(RoleId,txtUserIdOrName.Text.Trim(),txtDepartment.Text.Trim());

            if (userList.Count > 0)
            {
                gvNotExistsUserList.DataSource = userList;

                gvNotExistsUserList.DataBind();
            }
            else
            {
                BindNotRecord(gvNotExistsUserList);
            }
        }
Пример #12
0
        private void InitExistGridView()
        {
            RoleBll roleBll = new RoleBll();

            RoleInfo roleInfo = roleBll.GetRoleById(RoleId);

            if (roleInfo != null)
            {
                lblCurrentRoleName.Text = roleInfo.RoleName;
            }

            UserInfoBll userBll = new UserInfoBll();

            List<UserInfo> userList = userBll.GetUserListByRoleId(RoleId);

            if (userList.Count > 0)
            {
                gvExistsUserList.DataSource = userList;

                gvExistsUserList.DataBind();
            }
            else
            {
                BindNotRecord(gvExistsUserList);
            }
        }
Пример #13
0
        private void InitData()
        {
            UserInfoBll userInfoBll = new UserInfoBll();
            UserInfo userInfo = userInfoBll.GetUserListById(UserId);

            if(userInfo!=null)
            {
                txtUserID.Text = userInfo.UserCode;
                txtUserName.Text = userInfo.UserName;
                txtTle.Text = userInfo.TelPhone;
                txtMoblie.Text = userInfo.MobilePhone;
                txtMail.Text = userInfo.EMail;
            }
        }
Пример #14
0
        /// <summary>
        /// 取消关注的方法
        /// </summary>
        private void UnSubscribe()
        {
            UserInOrOut userInorOutModel = GetUserOutModel();

            UserInfo user = new UserInfo();
            user.openid = userInorOutModel.userId;

            UserInfoBll userBll = new UserInfoBll();
            DataTable userTable = userBll.GetUserTable(user);

            userInorOutModel.userName = userTable.Rows[0]["nickname"].ToString();
            userInorOutModel.groupID = userTable.Rows[0]["groupId"].ToString();
            userInorOutModel.groupName = userTable.Rows[0]["groupName"].ToString();
            UserInOrOutBll userInOrOutBll = new UserInOrOutBll();
            userInOrOutBll.Add(userInorOutModel);

            user = new UserInfo();
            user.openid = userInorOutModel.userId;
            userBll.Del(user);
        }
Пример #15
0
        /**********  事件处理方法 **************/
        /// <summary>
        /// 关注时候的操作
        /// </summary>
        private void Subscribe()
        {
            if (IsExistUser())
                return;
            UserInOrOut userInorOutModel = GetUserInModel();

            UserInfoBll userBll = new UserInfoBll();
            UserInfo user = userBll.GetUserInfo(userInorOutModel.userId);
            userInorOutModel.userName = user.nickname;

            UserInOrOutBll userInOrOutBll = new UserInOrOutBll();
            userInOrOutBll.Add(userInorOutModel);

            user = new UserInfo();
            user = userBll.GetUserInfo(userInorOutModel.userId);
            userBll.Add(user);
        }
Пример #16
0
 /****** 获取用户关注、退出关注的信息model **************/
 private bool IsExistUser()
 {
     UserInfo user = new UserInfo();
     var root = doc.DocumentElement;
     user.openid = root.SelectSingleNode("FromUserName").InnerText;
     UserInfoBll userBll = new UserInfoBll();
     return userBll.IsExist(user);
 }