示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //验证


            if (tbName.Text.Trim() == "")
            {
                MessageBoxEx.Show("请输入员工姓名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                tbName.Focus();
                return;
            }

            if (tbPwd.Text.Trim() == "")
            {
                MessageBoxEx.Show("请输入登录密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                tbPwd.Focus();
                return;
            }



            Dong.Model.OperInfo mOper = new Dong.Model.OperInfo();
            mOper.Code = tbCode.Text.Trim();
            mOper.Name = tbName.Text.Trim();
            mOper.Pwd  = tbPwd.Text.Trim();
            mOper.Sex  = cbSex.Text;

            if (tbPhone.Text != "")
            {
                mOper.Phone = tbPhone.Text.Trim();
            }
            else
            {
                mOper.Phone = "无";
            }
            if (tbCID.Text != "")
            {
                mOper.CId = tbCID.Text.Trim();
            }
            else
            {
                mOper.CId = "无";
            }
            mOper.Role = 0;
            Dong.BLL.OperInfo bOper = new Dong.BLL.OperInfo();
            if (bOper.Update(mOper))
            {
                MessageBoxEx.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                frmUsers fUser = (frmUsers)this.Owner;
                fUser.refreshData();
                this.Close();
            }
            else
            {
                MessageBoxEx.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void btnUsers_Click(object sender, EventArgs e)
        {
            frmUsers frm = new frmUsers();

            openWindow(frm, frm.Name);
        }