示例#1
0
        //在操作区域内部添加选项卡页,显示salerForm窗体
        private void button5_Click(object sender, EventArgs e)
        {
            //在操作区域内部添加选项卡页,显示salerForm窗体
            SalerForm salerForm = new SalerForm();

            AddTabPage("前台销售", salerForm);
        }
示例#2
0
        //在操作区域内部添加选项卡页,显示salerForm窗体
        private void tsp_sale_Click(object sender, EventArgs e)
        {
            //在操作区域内部添加选项卡页,显示salerForm窗体
            SalerForm salerForm = new SalerForm();

            salerForm.Tag = this.lbl_4.Text;
            AddTabPage("前台销售", salerForm);
        }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         //获取用户输入的用户名和密码
         string userName = this.txt_name.Text;
         string password = this.txt_pwd.Text;
         name.Name = SalemanBll.GetSalemanNameByPhone(userName);
         //职务
         string work = this.rdo_guanli.Checked ? this.rdo_guanli.Text : this.rdo_saler.Text;
         bool   flag = false;//判断是否选择权限
         if (this.rdo_guanli.Checked || this.rdo_saler.Checked)
         {
             flag = true;
         }
         //非空验证
         if (userName != "" && password != "" && flag == true)
         {
             int result = SalemanBll.LoginUserInfo(userName, password, work);
             if (result == 0)
             {
                 //账号不存在
                 MessageBox.Show("账号不存在", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             }
             if (result == 1)
             {
                 //密码错误
                 MessageBox.Show("密码错误", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             }
             if (result == 2)
             {
                 if (this.rdo_saler.Checked)
                 {
                     SalerForm sa = new SalerForm();
                     sa.Show();
                     this.Hide();
                 }
                 else
                 {
                     //登录成功
                     MainForm main = new MainForm();
                     main.Show();
                     this.Hide();
                 }
             }
         }
         else
         {
             MessageBox.Show("请正确填写登录信息", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("请正确填写登录信息", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
 }