Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String id = textBox1.Text;

            try
            {
                cm = new ClassMain();
                ds = cm.DelUser(id);

                if (ds != null)
                {
                    //MessageBox.Show("删除成功");
                    ans = true;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("输入的账号不存在");
                }
            }catch (SqlException ex)
            {
                MessageBox.Show("删除成功");
                //MessageBox.Show(ex.Message);
            }
            finally
            {
                cm.Closecon();
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ClassMain mainTest = new ClassMain();

            if (mainTest.Checkin(textBoxUserID.Text, textBoxPwd.Text))
            {
                string role = mainTest.GetRole();
                if (role.Equals("管理员"))
                {
                    /*
                     * MF mf = new MF();
                     * this.Visible = false;
                     * mf.ShowDialog();
                     * this.Dispose();
                     * this.Close();
                     */
                    FormMain fm = new FormMain();
                    this.Visible = false;
                    fm.ShowDialog();
                    this.Dispose();
                    this.Close();
                }
                else if (role.Equals("采购员"))
                {
                    FormBuyer fb = new FormBuyer();
                    this.Visible = false;
                    fb.Setid(textBoxUserID.Text);
                    fb.ShowDialog();

                    this.Dispose();
                    this.Close();
                }
                else if (role.Equals("配送员"))
                {
                    FormDeliveryStaff fds = new FormDeliveryStaff();
                    this.Visible = false;
                    fds.Setid(textBoxUserID.Text);
                    fds.ShowDialog();
                    this.Dispose();
                    this.Close();
                }

                /*
                 * else if(role.Equals("客户"))
                 * {
                 *  FormUser fu=new FormUser();
                 *  this.Visible = false;
                 *  fu.Setid(textBoxUserID.Text);
                 *  fu.ShowDialog();
                 *  this.Dispose();
                 *  this.Close();
                 * }
                 */
            }


            mainTest.Closecon();
        }