Beispiel #1
0
        private void saveProductOrder()
        {
            productOrder productOrder = new productOrder();

            productOrder.customerID  = CustomerID;
            productOrder.status      = 1;
            productOrder.dateCarried = System.DateTime.Now;
            productOrder.dateTake    = System.DateTime.Now;
            int productOrderCode;

            productOrderCode = productOrderOP.productOrderSellAdd(productOrder);
            productListOP productListOP = new productListOP();
            productList   productList   = new productList();

            for (int i = 0; i < dataGridView3.Rows.Count - 1; i++)
            {
                productList.ProductOrderID = productOrderCode;
                productList.amount         = Convert.ToInt32(dynamicTableNew.Rows[i][6]);
                productList.discount       = Convert.ToInt32(dynamicTableNew.Rows[i][5]);
                productList.price          = Convert.ToInt32(dynamicTableNew.Rows[i][3]);
                productList.productCode    = Convert.ToInt32(dynamicTableNew.Rows[i][0]);

                productListOP.productListAdd(productList);
            }
            MessageBox.Show("Siparişiniz başarıyla alındı", "Sipariş alımı");
        }
        private void button16_Click(object sender, EventArgs e)
        {
            if (customer.code != 0)
            {
                if (dataGridView2.Rows.Count > 1)
                {
                    if (control.integerControl(textBox13.Text))
                    {
                        bool isInteger2 = control.integerControl(textBox13.Text);
                        if (isInteger2)
                        {
                            DialogResult result = MessageBox.Show("Satış yapılsın mı?", "Satış işlemi", MessageBoxButtons.YesNo);

                            if (result == DialogResult.Yes)
                            {
                                productOrder.customerID    = customer.code;   // product orderı ekliyor dbye
                                productOrder.dateTake      = System.DateTime.Now;
                                productOrder.dateCarried   = System.DateTime.Now;
                                productOrder.status        = 0;
                                productList.ProductOrderID = productOrderOP.productOrderSellAdd(productOrder);

                                for (int i = 0; i < dataGridView2.Rows.Count - 1; i++)     // ürün sayısı kadar product listesini ekliyor dbye
                                {
                                    productList.productCode = Convert.ToInt32(dynamicTable.Rows[i][0]);
                                    productList.discount    = Convert.ToInt32(dynamicTable.Rows[i][5]);
                                    productList.price       = Convert.ToDecimal(dynamicTable.Rows[i][3]);

                                    DataTable table       = stockOP.createStockTable();
                                    int       productCode = Convert.ToInt32(productList.productCode);

                                    int amount    = Convert.ToInt32(dynamicTable.Rows[i][6]);
                                    int productID = Convert.ToInt32(dynamicTable.Rows[i][0]);
                                    stockOP.stockDecrease(productID, -amount, System.DateTime.Now);

                                    productListOP.productListAdd(productList);
                                }
                                bool isInteger = control.integerControl(textBox13.Text);
                                if (textBox13.Text == String.Empty)
                                {
                                    errorProvider1.SetError(textBox13, "Boş değer Giremezsiniz");
                                }
                                else if (isInteger)
                                {
                                    if (textBox13.Text == "0")
                                    {
                                    }
                                    else
                                    {
                                        customerOP.CustomerPay(customer.code, System.DateTime.Now, Convert.ToDecimal(textBox13.Text));     // customer ödemesini yapıyor!
                                    }
                                }

                                MessageBox.Show("başarıyla gerçekleşti", "Satış İşlemi");
                                customer.code = 0;
                                formLoad();
                            }
                        }
                        else
                        {
                            errorProvider1.SetError(textBox13, "Sayı Giriniz");
                        }
                    }
                    else if (!control.integerControl(textBox13.Text))
                    {
                        errorProvider1.SetError(textBox13, "Sayı Giriniz");
                    }
                }
                else
                {
                    MessageBox.Show("Ürün Seçmediniz", "Seçim İşlemi");
                }
            }
            else
            {
                MessageBox.Show("Müşteri Seçiniz", "Müşteri Seçmediniz");
            }
        }
        private void saveProductOrder()
        {
            productOrder productOrder = new productOrder();
                    productOrder.customerID = CustomerID;
                    productOrder.status = 1;
                    productOrder.dateCarried = System.DateTime.Now;
                    productOrder.dateTake = System.DateTime.Now;
                    int productOrderCode;
                    productOrderCode = productOrderOP.productOrderSellAdd(productOrder);
                    productListOP productListOP = new productListOP();
                    productList productList = new productList();

                    for (int i = 0; i < dataGridView3.Rows.Count - 1; i++)
                    {
                        productList.ProductOrderID = productOrderCode;
                        productList.amount = Convert.ToInt32(dynamicTableNew.Rows[i][6]);
                        productList.discount = Convert.ToInt32(dynamicTableNew.Rows[i][5]);
                        productList.price = Convert.ToInt32(dynamicTableNew.Rows[i][3]);
                        productList.productCode = Convert.ToInt32(dynamicTableNew.Rows[i][0]);

                        productListOP.productListAdd(productList);
                    }
                    MessageBox.Show("Siparişiniz başarıyla alındı", "Sipariş alımı");
        }
Beispiel #4
0
        private void button16_Click(object sender, EventArgs e)
        {
            if (company.code != 0)
            {
                if (dataGridView2.Rows.Count > 1)
                {
                    productOrder.customerID    = company.code; // product orderı ekliyor dbye
                    productOrder.dateTake      = System.DateTime.Now;
                    productOrder.dateCarried   = System.DateTime.Now;
                    productOrder.status        = 0;
                    productList.ProductOrderID = productOrderOP.productOrderBuyAdd(productOrder);
                    bool isInteger = control.integerControl(textBox13.Text);
                    if (isInteger)
                    {
                        for (int i = 0; i < dataGridView2.Rows.Count - 1; i++) // ürün sayısı kadar product listesini ekliyor dbye
                        {
                            productList.productCode = Convert.ToInt32(dynamicTable.Rows[i][0]);
                            productList.discount    = Convert.ToInt32(dynamicTable.Rows[i][5]);
                            productList.price       = Convert.ToDecimal(dynamicTable.Rows[i][3]);
                            productListOP.productListAdd(productList);

                            stockOP   stockOP     = new stockOP();
                            DataTable table       = stockOP.createStockTable();
                            int       productCode = Convert.ToInt32(productList.productCode);

                            int productID = Convert.ToInt32(dynamicTable.Rows[i][0]);
                            int amount    = Convert.ToInt32(dynamicTable.Rows[i][6]);

                            stockOP.stockIncrease(productID, amount, System.DateTime.Now);
                        }
                        if (textBox13.Text == String.Empty)
                        {
                        }
                        else if (textBox13.Text == "0")
                        {
                        }
                        else
                        {
                            companyOP.companyPay(company.code, System.DateTime.Now, Convert.ToDecimal(textBox13.Text)); // customer ödemesini yapıyor!
                        }

                        MessageBox.Show("başarıyla gerçekleşti", "Satış İşlemi");

                        company.code = 0; // compandy code u sıfırlıyor ki, her seferinde bilinçli seçim yapsın
                        formLoad();       // formu baştan yüklüyor ki değişiklikler görüntülensin
                    }
                    else
                    {
                        errorProvider1.SetError(textBox13, "Sayı Giriniz");
                    }
                }
                else
                {
                    MessageBox.Show("Ürün Seçmediniz", "Seçim İşlemi");
                }
            }
            else
            {
                MessageBox.Show("Firma seçmediniz", "Lütfen firma seçiniz");
            }
        }