Exemple #1
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 #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");
            }
        }