Esempio n. 1
0
        }//注册

        private void btnLogin_Click(object sender, EventArgs e) //点击登录按钮
        {
            Merchant merchant;                                  //当前即将登陆的商家


            if (int.TryParse(txtId.Text, out int id))
            {
                merchant = Merchant_Service.Login(id, txtPassword.Text);

                if (merchant == null)
                {
                    new Tip("登陆失败").ShowDialog();
                    return;
                }

                new Merchant_Form(merchant).Show();    //打开商家界面
                this.Hide();
            }
            else
            {
                //判断为五位还没写
                new Tip("账号应为5位的数字").ShowDialog();
                return;
            }
        }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentCell.RowIndex >= 0)
     {
         Merchant_Service.finishDeliver(Order_Service.GetDeliverOrderList(currentMerchant)[dataGridView1.CurrentCell.RowIndex]);
     }
 }
Esempio n. 3
0
        Point offset    = new Point(0, 0); //记录动了多少距离
        public Shoping_Form(Customer customer, Merchant merchant, Form mainForm)
        {
            form             = mainForm;
            order.Customer   = customer;
            this.merchant    = merchant;
            order.MerchantId = merchant.Id;

            merchant.CuisineTypes = Merchant_Service.getAllCuisineTypes(merchant);
            InitializeComponent();
            int i = 0;

            foreach (CuisineType cuisineType in merchant.CuisineTypes)
            {
                RadioButton radioButton = new RadioButton();
                radioButton.Name       = cuisineType.TypeName;
                radioButton.Text       = cuisineType.TypeName;
                radioButton.Appearance = Appearance.Button;
                radioButton.SetBounds(5, 60 * i + 5, 120, 60);
                radioButton.Font      = new Font("微软雅黑 Light", 12, FontStyle.Regular);
                radioButton.TextAlign = ContentAlignment.MiddleCenter;
                pnlCuisineType.Controls.Add(radioButton);
                radioButton.Click += new EventHandler(Cuisine_Form_Show);
                i++;
            }

            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Cuisine cuisine = new Cuisine(Name2.Text, Des2.Text, int.Parse(Price2.Text), Merchant_Service.getAllCuisineTypes(currentMerchant)[dataGridView1.CurrentCell.RowIndex].Id, path.Text);

            Merchant_Service.addCuisine(cuisine);
            cuisineBindingSource.DataSource = Merchant_Service.getAllCuisineTypes(currentMerchant)[dataGridView1.CurrentCell.RowIndex].Cuisines;
            cuisineBindingSource.ResetBindings(false);
        }
 private void button3_Click(object sender, EventArgs e)
 {
     if (dataGridView2.CurrentCell.RowIndex >= 0)
     {
         Merchant_Service.deleteCuisine(Merchant_Service.getAllCuisineTypes(currentMerchant)[dataGridView1.CurrentCell.RowIndex].Cuisines[dataGridView2.CurrentCell.RowIndex]);
         cuisineBindingSource.DataSource = Merchant_Service.getAllCuisineTypes(currentMerchant)[dataGridView1.CurrentCell.RowIndex].Cuisines;
         cuisineBindingSource.ResetBindings(false);
     }
 }
 private void dataGridView1_MouseClick(object sender, MouseEventArgs e)
 {
     if (Merchant_Service.getAllCuisineTypes(currentMerchant) != null)
     {
         cuisineBindingSource.DataSource = Merchant_Service.getAllCuisineTypes(currentMerchant)[dataGridView1.CurrentCell.RowIndex].Cuisines;
         //cuisineBindingSource.DataSource = currentMerchant.CuisineTypes[dataGridView1.CurrentCell.RowIndex].Cuisines;
         cuisineBindingSource.ResetBindings(false);
     }
 }
        private void button1_Click_1(object sender, EventArgs e)
        {
            CuisineType newType = new CuisineType(nameBox.Text, currentMerchant.Id);

            //currentMerchant.CuisineTypes.Add(newType);
            Merchant_Service.addCuisineType(newType);
            typeBindingSource.DataSource = Merchant_Service.getAllCuisineTypes(currentMerchant);
            //typeBindingSource.DataSource = currentMerchant.CuisineTypes;
            typeBindingSource.ResetBindings(false);
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            currentMerchant.Name          = MerchantName.Text;
            currentMerchant.Address       = MerchantAddress.Text;
            currentMerchant.BusinessHours = BusinessHours.Text;
            currentMerchant.PhoneNum      = MerchantPhone.Text;
            currentMerchant.Picture       = File.ReadAllBytes(path.Text);
            Merchant_Service.ModifyMerchant(currentMerchant);
            Merchant_Info_Form mif = new Merchant_Info_Form(MerchantAddress.Text, MerchantName.Text, MerchantPhone.Text, BusinessHours.Text, path.Text);

            mif.ShowDialog();
        }
        public Edit_Cuisine_Form(Merchant merchant)
        {
            this.currentMerchant = merchant;
            typeBindingSource    = new BindingSource();
            InitializeComponent();

            typeBindingSource.DataSource = Merchant_Service.getAllCuisineTypes(merchant);
            //typeBindingSource.DataSource = currentMerchant.CuisineTypes;
            typeBindingSource.ResetBindings(false);

            //cuisineBindingSource.DataSource = Merchant_Service.getAllCuisineTypes(merchant)[0];
            //cuisineBindingSource.DataSource = Merchant_Service.getAllCuisines(cuisineType);
            //cuisineBindingSource.DataSource = type.Cuisines;
            cuisineBindingSource.ResetBindings(false);
        }
Esempio n. 10
0
 private void btnRegister_Click(object sender, EventArgs e)
 {
     if (int.TryParse(txtId.Text, out int id))
     {
         Merchant receivedmerchant = Merchant_Service.Register(id, txtPassword.Text);
         if (receivedmerchant == null)
         {
             new Tip("注册失败,该账号已存在").ShowDialog();
         }
         new Tip("注册成功,我们去挣钱钱啦!").ShowDialog();
         this.Close();
     }
     else
     {
         //判断为五位的数字
         new Tip("账号需为5位的数字").ShowDialog();
     }
 }
Esempio n. 11
0
        public Shoping_Form(Customer customer, Merchant merchant)
        {
            order.OrderState      = "待支付";
            order.Customer        = customer;
            this.merchant         = merchant;
            merchant.CuisineTypes = Merchant_Service.getAllCuisineTypes(merchant);
            InitializeComponent();
            int i = 0;

            foreach (CuisineType cuisineType in merchant.CuisineTypes)
            {
                RadioButton radioButton = new RadioButton();
                radioButton.Name       = cuisineType.TypeName;
                radioButton.Text       = cuisineType.TypeName;
                radioButton.Appearance = Appearance.Button;
                radioButton.SetBounds(0, 100 * i, 180, 100);

                i++;
            }
        }
Esempio n. 12
0
 private void button1_Click(object sender, EventArgs e)
 {
     Merchant_Service.acceptCancel(Order_Service.GetWaitCancelOrderList(currentMerchant)[dataGridView1.CurrentCell.RowIndex]);
 }
Esempio n. 13
0
 private void button1_Click(object sender, EventArgs e)
 {
     Merchant_Service.finishMake(Order_Service.GetAcceptedOrderList(currentMerchant)[dataGridView1.CurrentCell.RowIndex]);
 }
Esempio n. 14
0
 private void acceptOrder_Click(object sender, EventArgs e)
 {
     Merchant_Service.takeAnOrder(Order_Service.GetOrderList(currentMerchant)[dataGridView3.CurrentCell.RowIndex]);
 }
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     cuisineBindingSource.DataSource = Merchant_Service.getAllCuisineTypes(currentMerchant)[dataGridView1.CurrentCell.RowIndex].Cuisines;
 }