Ejemplo n.º 1
0
        public void deniedOrder(ClientOrder order)
        {
            order.IsDenied = true;
            int count = 0;

            Store.getInstance().Products.TryGetValue(order.Product, out count);
            Store.getInstance().addProduct(order.Product, count + order.getQuantity());
        }
Ejemplo n.º 2
0
 public void deleteOrder(ClientOrder clientOrder)
 {
     if (clientOrder.getStatus().Equals("Доставлено") || clientOrder.getStatus().Equals("Заказ отклонен"))
     {
         ClientOrderList.getInstance().Orders.Remove(clientOrder);
         return;
     }
     if (clientOrder.getIsFull())
     {
         int count = 0;
         Store.getInstance().Products.TryGetValue(clientOrder.Product, out count);
         Store.getInstance().Products.Remove(clientOrder.Product);
         Store.getInstance().Products.Add(clientOrder.Product, count + clientOrder.getQuantity());
     }
     else
     {
         int count = 0;
         Store.getInstance().Products.TryGetValue(clientOrder.Product, out count);
         Store.getInstance().Products.Remove(clientOrder.Product);
         Store.getInstance().Products.Add(clientOrder.Product, count + clientOrder.getQuantity() - clientOrder.getCountToEnd());
     }
     ClientOrderList.getInstance().Orders.Remove(clientOrder);
 }
Ejemplo n.º 3
0
 public EditOrder(ClientOrder currentOrder, string service)
 {
     InitializeComponent();
     this.currentOrder    = currentOrder;
     textBox3.Text        = currentOrder.getId().ToString();
     comboBox1.Text       = currentOrder.Product.ClassofProduct;
     comboBox2.Text       = currentOrder.Product.Category;
     comboBox3.Text       = currentOrder.Product.Type;
     textBox1.Text        = currentOrder.Product.Name;
     textBox2.Text        = currentOrder.getQuantity().ToString();
     textBox4.Text        = currentOrder.getCLient();
     textBox5.Text        = currentOrder.getAddress();
     dateTimePicker1.Text = currentOrder.Date.ToString();
     if (ClientManagerService.getInstance().isDeliver(currentOrder))
     {
         button1.Enabled  = false;
         textBox5.Enabled = false;
     }
     Text = service;
 }
Ejemplo n.º 4
0
 public BookmakerInfClientOrder(ClientOrder currentOrder, string service, int fromWho)
 {
     InitializeComponent();
     this.currentOrder    = currentOrder;
     textBox1.Text        = currentOrder.getId().ToString();
     textBox2.Text        = currentOrder.Product.ClassofProduct;
     textBox3.Text        = currentOrder.Product.Category;
     textBox4.Text        = currentOrder.Product.Type;
     textBox5.Text        = currentOrder.Product.Name;
     textBox6.Text        = currentOrder.getQuantity().ToString();
     textBox7.Text        = currentOrder.getCLient();
     textBox8.Text        = currentOrder.getAddress();
     textBox9.Text        = currentOrder.Price.ToString();
     dateTimePicker1.Text = currentOrder.Date.ToString();
     Text         = service;
     this.fromWho = fromWho;
     if (fromWho == 1)
     {
         button1.Text = "Подтвердить";
     }
     if (fromWho == 2)
     {
         button1.Text = "Отправить Курьеру";
     }
     if (fromWho == 3)
     {
         button1.Text    = "Добавить в Доставки";
         button3.Visible = true;
         button3.Text    = "Пересобрать";
     }
     if (fromWho == 4)
     {
         button1.Text    = "Доставлено";
         button3.Visible = true;
         button3.Text    = "Отмена заказа";
     }
 }