Exemple #1
0
        private void button3_Click(object sender, EventArgs e) //删除商家信息
        {
            if (textBox1.Text == String.Empty)                 //输入不能为空
            {
                MessageBox.Show("输入不能为空!");
                return;
            }
            string merchant_id = textBox1.Text.ToString();

            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            if (merchant.merchantexist(textBox1.Text.ToString()))
            {
                bool result = merchant.deleteMerchant(merchant_id);
                if (result)
                {
                    MessageBox.Show("sucessful");
                }
                else
                {
                    MessageBox.Show("failed");
                }
            }
            else
            {
                MessageBox.Show("该商家不存在");
            }
        }
Exemple #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            string merchant_id = textBox1.Text.ToString();

            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            stall_merchant.Stall    stall    = new stall_merchant.Stall();
            if (stall.staffexist(textBox2.Text.ToString()))
            {
                if (Convert.ToInt32(textBox2.Text) >= 700000 && Convert.ToInt32(textBox2.Text) <= 799999)
                {
                    bool result = merchant.updateMerchant(merchant_id, textBox2.Text.ToString(), textBox3.Text.ToString(), textBox4.Text.ToString());
                    if (result)
                    {
                        merchant.showMerchant(merchant_id);
                        textBox1.Text = merchant_id;
                        textBox2.Text = merchant.staff_id;
                        textBox3.Text = merchant.name;
                        textBox4.Text = merchant.phone_number;
                        MessageBox.Show("sucessful");
                    }
                    else
                    {
                        MessageBox.Show("failed");
                    }
                }
                else
                {
                    MessageBox.Show("请输入商家管理员工id");
                }
            }
            else
            {
                MessageBox.Show("请输入正确的员工id");
            }
        }
Exemple #3
0
        private void button2_Click(object sender, EventArgs e) //修改商家信息
        {
            if (textBox1.Text == String.Empty)                 //输入不能为空
            {
                MessageBox.Show("输入不能为空!");
                return;
            }
            string merchant_id = textBox1.Text.ToString();

            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            if (merchant.merchantexist(textBox1.Text.ToString()))
            {
                bool result = merchant.showMerchant(merchant_id);
                if (result)
                {
                    mForm3_update f3 = new mForm3_update();
                    {
                        f3.Form3showMerchant(merchant_id, merchant.staff_id, merchant.name, merchant.phone_number);
                    }
                    this.Hide();
                    f3.ShowDialog();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("failed");
                }
            }
            else
            {
                MessageBox.Show("该商家不存在");
            }
        }
Exemple #4
0
 private void button4_Click(object sender, EventArgs e)  //保存信息
 {
     stall_merchant.Merchant merchant = new stall_merchant.Merchant();
     stall_merchant.Stall    stall    = new stall_merchant.Stall();
     if (stall.staffexist(textBox2.Text.ToString()))
     {
         if (Convert.ToInt32(textBox2.Text.ToString()) >= 700000 && Convert.ToInt32(textBox2.Text.ToString()) <= 799999)
         {
             bool result = merchant.addMerchant(textBox2.Text.ToString(), textBox3.Text.ToString(), textBox4.Text.ToString());
             if (result)
             {
                 textBox1.Text = merchant.merchant_id;
             }
             else
             {
                 MessageBox.Show("failed");
             }
         }
         else
         {
             MessageBox.Show("请输入商家管理员工id");
         }
     }
     else
     {
         MessageBox.Show("请输入正确的员工id");
     }
 }
Exemple #5
0
        private void button4_Click(object sender, EventArgs e)  //显示所有信息
        {
            DataSet ds = new DataSet();

            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            ds = merchant.showallMerchant();
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "merchant";
        }
Exemple #6
0
        private void button3_Click(object sender, EventArgs e)//商家ID查询
        {
            DataSet ds = new DataSet();

            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            if (merchant.merchantexist(textBox2.Text.ToString()))
            {
                ds = merchant.selectMerchantwithMerchant_id(textBox2.Text.ToString());
                dataGridView1.DataSource = ds;
                dataGridView1.DataMember = "merchant";
            }
            else
            {
                MessageBox.Show("请输入正确的商家id");
            }
        }
        private void button7_Click(object sender, EventArgs e)   //商家ID
        {
            DataSet ds = new DataSet();

            stall_merchant.Stall    stall    = new stall_merchant.Stall();
            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            if (merchant.merchantexist(textBox10.Text.ToString()))
            {
                ds = stall.selectStallwithMerchant_id(textBox10.Text.ToString());
                dataGridView1.DataSource = ds;
                dataGridView1.DataMember = "stall";
            }
            else
            {
                MessageBox.Show("该商家不存在");
            }
        }
Exemple #8
0
        private void button4_Click(object sender, EventArgs e)      //保存更改
        {
            string warehouse_id = textBox1.Text;

            stall_merchant.Merchant merchant  = new stall_merchant.Merchant();
            stall_merchant.Stall    stall     = new stall_merchant.Stall();
            Datebass.Warehouse      warehouse = new Datebass.Warehouse();
            if (merchant.merchantexist(textBox5.Text) == false)
            {
                MessageBox.Show("请输入正确的商家id");
                return;
            }
            if (Convert.ToInt32(textBox6.Text) >= 500000 && Convert.ToInt32(textBox2.Text) <= 599999)
            {
                if (stall.staffexist(textBox6.Text) == false)
                {
                    MessageBox.Show("请输入正确的员工id");
                    return;
                }
            }
            else
            {
                MessageBox.Show("该员工ID无法管理仓库,请输入正确的员工ID");
                return;
            }
            bool result = Datebass.Warehouse.UpdateAnEntry(warehouse_id, Convert.ToDouble(textBox2.Text), Convert.ToDouble(textBox3.Text), Convert.ToDouble(textBox4.Text), textBox5.Text, textBox6.Text);

            if (result)
            {
                warehouse.SearchAnEntryByID(warehouse_id);
                textBox1.Text = warehouse_id;
                textBox2.Text = warehouse.area.ToString();
                textBox3.Text = warehouse.full_capacity.ToString();
                textBox4.Text = warehouse.left_capacity.ToString();
                textBox5.Text = warehouse.merchant_id;
                textBox6.Text = warehouse.staff_id;
                MessageBox.Show("sucessful");
            }
            else
            {
                MessageBox.Show("failed");
            }
        }
Exemple #9
0
        private void button7_Click(object sender, EventArgs e)   //所属商家
        {
            if (textBox10.Text == String.Empty)
            {
                MessageBox.Show("输入不能为空!");
                return;
            }
            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            if (merchant.merchantexist(textBox10.Text) == false)
            {
                MessageBox.Show("请输入正确的商家ID!");
                return;
            }
            DataSet ds = new DataSet();

            ds = Datebass.Warehouse.SearchByMerchantID(textBox10.Text);
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "warehouse";
        }
Exemple #10
0
        private void button4_Click(object sender, EventArgs e) //保存更改
        {
            string stall_id = textBox1.Text.ToString();

            stall_merchant.Stall    stall    = new stall_merchant.Stall();
            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            if (merchant.merchantexist(textBox2.Text.ToString()) && stall.staffexist(textBox3.Text.ToString()))
            {
                if (Convert.ToInt32(textBox3.Text) >= 600000 && Convert.ToInt32(textBox3.Text) <= 699999)
                {
                    bool result = stall.updateStall(stall_id, textBox2.Text.ToString(), textBox3.Text.ToString(), textBox4.Text.ToString(), textBox5.Text.ToString(), textBox6.Text.ToString(), textBox7.Text.ToString());
                    if (result)
                    {
                        stall.showStall(stall_id);
                        textBox1.Text = stall_id;
                        textBox2.Text = stall.merchant_id;
                        textBox3.Text = stall.staff_id;
                        textBox4.Text = stall.area;
                        textBox5.Text = stall.start_time;
                        textBox6.Text = stall.end_time;
                        textBox7.Text = stall.rent_money;
                        textBox8.Text = stall.price;
                        MessageBox.Show("sucessful");
                    }
                    else
                    {
                        MessageBox.Show("failed");
                    }
                }
                else
                {
                    MessageBox.Show("请输入摊位管理员工id");
                }
            }
            else
            {
                MessageBox.Show("请输入正确的商家和员工id");
            }
        }
Exemple #11
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            login a = new login();

            stall_merchant.Merchant b = new stall_merchant.Merchant();
            if (a.staffexist(textBox2.Text) || b.merchantexist(textBox2.Text))
            {
                if (a.find(textBox2.Text, textBox1.Text) != "")
                {
                    MessageBox.Show(a.find(textBox2.Text, textBox1.Text), "您的密码是");
                    this.Hide();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("验证码错误!");
                }
            }
            else
            {
                MessageBox.Show("用户名不存在!");
            }
        }
Exemple #12
0
        private void button2_Click(object sender, EventArgs e) //员工ID查询
        {
            DataSet ds = new DataSet();

            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            stall_merchant.Stall    stall    = new stall_merchant.Stall();
            if (stall.staffexist(textBox1.Text.ToString()))
            {
                if (Convert.ToInt32(textBox1.Text) >= 700000 && Convert.ToInt32(textBox1.Text) <= 799999)
                {
                    ds = merchant.selectMerchantwithStaff_id(textBox1.Text.ToString());
                    dataGridView1.DataSource = ds;
                    dataGridView1.DataMember = "merchant";
                }
                else
                {
                    MessageBox.Show("请输入商家管理员工id");
                }
            }
            else
            {
                MessageBox.Show("请输入正确员工id");
            }
        }
Exemple #13
0
        private void button1_Click(object sender, EventArgs e)
        {
            login a = new login();

            stall_merchant.Merchant merchant = new stall_merchant.Merchant();
            if (textBox1.Text == "")
            {
                MessageBox.Show("请输入用户名");
            }
            else
            {
                if (textBox2.Text == "")
                {
                    MessageBox.Show("请输入密码");
                }
                else
                {
                    if (a.staffexist(textBox1.Text.ToString()) || merchant.merchantexist(textBox1.Text.ToString()))
                    {
                        if (a.check(textBox1.Text, textBox2.Text))
                        {
                            user_ifms.ID = textBox1.Text;
                            if (user_ifms.ID[0] == '5')//warehouse 管仓库5
                            {
                                Stall_Manage.wForm1_main p = new Stall_Manage.wForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else
                            if (user_ifms.ID[0] == '6')//管摊位信息登陆
                            {
                                Stall_Manage.sForm1_main p = new Stall_Manage.sForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else
                            if (user_ifms.ID[0] == '7')//管商家的人登陆
                            {
                                Stall_Manage.mForm1_main p = new Stall_Manage.mForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else
                            if (user_ifms.ID[0] == '8' || user_ifms.ID[0] == '9')//管理员工信息人事部登陆
                            {
                                Stall_Manage.staffForm1_main p = new Stall_Manage.staffForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else//商家登陆
                            {
                                this.Hide();
                                usermainpage pp = new usermainpage();
                                pp.ShowDialog();
                                this.Close();
                            }
                        }
                        else
                        {
                            MessageBox.Show("登录失败,请检查用户名和密码");
                        }
                    }
                    else
                    {
                        MessageBox.Show("用户名不存在");
                    }
                }
            }
        }