示例#1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txt_Pwd1.Text.Trim()))
                {
                    MessageBox.Show("密码不能为空!");
                    return;
                }

                if (string.IsNullOrEmpty(txt_Pwd2.Text.Trim()))
                {
                    MessageBox.Show("密码不能为空!");
                    return;
                }

                if (txt_Pwd1.Text.Trim() == txt_Pwd2.Text.Trim())
                {
                    ModTS_USER mod = bll.GetModel(UserInfo.userID);
                    if (mod != null)
                    {
                        mod.C_PASSWORD = Common.MD5(txt_Pwd1.Text.Trim()); //密码
                        mod.D_MOD_DT   = ServerTime.timeNow();             //系统操作时间

                        if (bll.Update(mod))
                        {
                            MessageBox.Show("密码修改成功!");
                            this.Close();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("两次密码输入不一致!");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txt_UserName.Text.Trim()))
                {
                    MessageBox.Show("姓名不能为空!");
                    return;
                }

                if (string.IsNullOrEmpty(txt_LoginName.Text.Trim()))
                {
                    MessageBox.Show("账号不能为空!");
                    return;
                }

                //if (string.IsNullOrEmpty(txt_Email.Text.Trim()))
                //{
                //    MessageBox.Show("邮箱不能为空!");
                //    return;
                //}

                //if (string.IsNullOrEmpty(txt_Tel.Text.Trim()))
                //{
                //    MessageBox.Show("电话不能为空!");
                //    return;
                //}

                ModTS_USER mod = bll.GetModel(strUserID);
                if (mod != null)
                {
                    mod.C_NAME     = txt_UserName.Text.Trim();              //姓名
                    mod.C_EMAIL    = txt_Email.Text.Trim();                 //邮箱
                    mod.C_MOBILE   = txt_Tel.Text.Trim();                   //电话
                    mod.N_STATUS   = Convert.ToInt32(icbo_State.EditValue); //状态(1正常,2,3,4冻结)
                    mod.C_EMP_ID   = UserInfo.userID;                       //系统操作人编号
                    mod.C_EMP_NAME = UserInfo.userName;                     //系统操作人姓名
                    mod.D_MOD_DT   = ServerTime.timeNow();                  //系系统操作时间

                    if (bll.Update(mod))
                    {
                        if (!string.IsNullOrEmpty(btnEdit_Dept.Text.Trim()))
                        {
                            BllTS_USER_DEPT bllUserDept = new BllTS_USER_DEPT();

                            ModTS_USER_DEPT model = bllUserDept.Get_Model(strUserID);
                            if (model != null)
                            {
                                model.C_DEPT_ID = strDeptID;
                                bllUserDept.Update(model);
                            }
                            else
                            {
                                model           = new ModTS_USER_DEPT();
                                model.C_DEPT_ID = strDeptID;
                                model.C_USER_ID = strUserID;

                                bllUserDept.Add(model);
                            }
                        }

                        MessageBox.Show("修改成功!");
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }