Пример #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ı");
        }
Пример #2
0
        public int productOrderBuyAdd(productOrder productOrder)
        {
            int ProductOrdercode;

            createConnection();
            connection.Open();
            SqlCommand command = new SqlCommand();

            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "productOrderBuyAdd";

            command.Parameters.Add("@ProductOrderID", SqlDbType.Int);
            command.Parameters["@ProductOrderID"].Direction = ParameterDirection.Output;

            command.Parameters.Add("@companyID", SqlDbType.Int, 50);
            command.Parameters["@companyID"].Value = productOrder.customerID;
            command.Parameters.Add("@dateTake", SqlDbType.DateTime);
            command.Parameters["@dateTake"].Value = productOrder.dateTake;
            command.Parameters.Add("@dateCarried", SqlDbType.DateTime);
            command.Parameters["@dateCarried"].Value = productOrder.dateCarried;
            command.Parameters.Add("@status", SqlDbType.NVarChar, 50);
            command.Parameters["@status"].Value = productOrder.status;
            command.ExecuteNonQuery();
            ProductOrdercode = Convert.ToInt32(command.Parameters["@ProductOrderID"].Value);


            connection.Close();
            return(ProductOrdercode);
        }
Пример #3
0
        private void updateProductOrder() // update productorder içini doldurucan
        {
            productOrder  productOrder  = new productOrder();
            productListOP productListOP = new productListOP();
            productList   productList   = new productList();

            productOrder.customerID       = CustomerID;
            productOrder.status           = 1;
            productOrder.dateCarried      = System.DateTime.Now;
            productOrder.dateTake         = System.DateTime.Now;
            productOrder.productOrderCode = Convert.ToInt32(dataGridView1.CurrentRow.Cells[3].Value);
            productOrderOP.productOrderSellUpdate(productOrder);


            for (int i = 0; i < dynamicTableNew.Rows.Count; i++)
            {
                productList.ProductOrderID = productOrder.productOrderCode;

                productList.amount      = Convert.ToInt32(dynamicTableUpdate.Rows[i][6]);
                productList.discount    = Convert.ToInt32(dynamicTableUpdate.Rows[i][5]);
                productList.price       = Convert.ToInt32(dynamicTableUpdate.Rows[i][3]);
                productList.productCode = Convert.ToInt32(dynamicTableUpdate.Rows[i][0]);


                productListOP.productListUpdate(productList);
            }
            MessageBox.Show("Siparişiniz başarıyla güncellendi", "Sipariş güncelleme");
        }
Пример #4
0
        public void productOrderSellUpdate(productOrder productOrder)
        {
            createConnection();
            connection.Open();
            SqlCommand command = new SqlCommand();

            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "productOrderSellUpdate";

            command.Parameters.Add("@ProductOrderID", SqlDbType.Int, 50);
            command.Parameters["@ProductOrderID"].Value = productOrder.productOrderCode;
            command.Parameters.Add("@customerID", SqlDbType.Int, 50);
            command.Parameters["@customerID"].Value = productOrder.customerID;
            command.Parameters.Add("@dateTake", SqlDbType.DateTime, 50);
            command.Parameters["@dateTake"].Value = productOrder.dateTake;
            command.Parameters.Add("@dateCarried", SqlDbType.DateTime, 50);
            command.Parameters["@dateCarried"].Value = productOrder.dateCarried;
            command.Parameters.Add("@status", SqlDbType.NVarChar, 50);
            command.Parameters["@status"].Value = productOrder.status;

            command.ExecuteNonQuery();
            connection.Close();
            connection.Dispose();
        }
        public int productOrderBuyAdd(productOrder productOrder)
        {
            int ProductOrdercode;
            createConnection();
            connection.Open();
            SqlCommand command = new SqlCommand();
            command.Connection = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "productOrderBuyAdd";

            command.Parameters.Add("@ProductOrderID", SqlDbType.Int);
            command.Parameters["@ProductOrderID"].Direction = ParameterDirection.Output;

            command.Parameters.Add("@companyID", SqlDbType.Int, 50);
            command.Parameters["@companyID"].Value = productOrder.customerID;
            command.Parameters.Add("@dateTake", SqlDbType.DateTime);
            command.Parameters["@dateTake"].Value = productOrder.dateTake;
            command.Parameters.Add("@dateCarried", SqlDbType.DateTime);
            command.Parameters["@dateCarried"].Value = productOrder.dateCarried;
            command.Parameters.Add("@status", SqlDbType.NVarChar, 50);
            command.Parameters["@status"].Value = productOrder.status;
            command.ExecuteNonQuery();
            ProductOrdercode = Convert.ToInt32(command.Parameters["@ProductOrderID"].Value);

            connection.Close();
            return ProductOrdercode;
        }
        // update productorder içini doldurucan
        private void updateProductOrder()
        {
            productOrder productOrder = new productOrder();
                    productListOP productListOP = new productListOP();
                    productList productList = new productList();

                    productOrder.customerID = CustomerID;
                    productOrder.status = 1;
                    productOrder.dateCarried = System.DateTime.Now;
                    productOrder.dateTake = System.DateTime.Now;
                    productOrder.productOrderCode = Convert.ToInt32(dataGridView1.CurrentRow.Cells[3].Value);
                    productOrderOP.productOrderSellUpdate(productOrder);

                    for (int i = 0; i < dynamicTableNew.Rows.Count; i++)
                    {
                        productList.ProductOrderID = productOrder.productOrderCode;

                        productList.amount = Convert.ToInt32(dynamicTableUpdate.Rows[i][6]);
                        productList.discount = Convert.ToInt32(dynamicTableUpdate.Rows[i][5]);
                        productList.price = Convert.ToInt32(dynamicTableUpdate.Rows[i][3]);
                        productList.productCode = Convert.ToInt32(dynamicTableUpdate.Rows[i][0]);

                        productListOP.productListUpdate(productList);
                    }
                    MessageBox.Show("Siparişiniz başarıyla güncellendi", "Sipariş güncelleme");
        }
        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ı");
        }
        public void productOrderSellUpdate(productOrder productOrder)
        {
            createConnection();
            connection.Open();
            SqlCommand command = new SqlCommand();
            command.Connection = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "productOrderSellUpdate";

            command.Parameters.Add("@ProductOrderID", SqlDbType.Int, 50);
            command.Parameters["@ProductOrderID"].Value = productOrder.productOrderCode;
            command.Parameters.Add("@customerID", SqlDbType.Int, 50);
            command.Parameters["@customerID"].Value = productOrder.customerID;
            command.Parameters.Add("@dateTake", SqlDbType.DateTime, 50);
            command.Parameters["@dateTake"].Value = productOrder.dateTake;
            command.Parameters.Add("@dateCarried", SqlDbType.DateTime, 50);
            command.Parameters["@dateCarried"].Value = productOrder.dateCarried;
            command.Parameters.Add("@status", SqlDbType.NVarChar, 50);
            command.Parameters["@status"].Value = productOrder.status;

            command.ExecuteNonQuery();
            connection.Close();
            connection.Dispose();
        }