Exemple #1
0
        private void DelProductBtn_Click(object sender, EventArgs e)
        {
            int index = dataGridViewProducts.CurrentCell.RowIndex;

              Product product = new Product();

              product.SetValues(
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["Id"].Value),
            dataGridViewProducts.Rows[index].Cells["Title"].Value.ToString(),
            Convert.ToDouble(dataGridViewProducts.Rows[index].Cells["PurchasePrice"].Value),
            Convert.ToDouble(dataGridViewProducts.Rows[index].Cells["Markup"].Value),
            Convert.ToDouble(dataGridViewProducts.Rows[index].Cells["Price"].Value),
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["DepartmentId"].Value),
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["ProduserId"].Value),
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["Quantity"].Value),
            Convert.ToBoolean(dataGridViewProducts.Rows[index].Cells["CriticalQ"].Value));

              client.DelProduct(product);
              //_waitForResponse.WaitOne();
        }
Exemple #2
0
        private void OnEditProduct(object sender, EventArgs e)
        {
            int index = dataGridViewProducts.CurrentCell.RowIndex;

              Product product = new Product();

              product.SetValues(
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["Id"].Value),
            dataGridViewProducts.Rows[index].Cells["Title"].Value.ToString(),
            Convert.ToDouble(dataGridViewProducts.Rows[index].Cells["PurchasePrice"].Value),
            Convert.ToDouble(dataGridViewProducts.Rows[index].Cells["Markup"].Value),
            Convert.ToDouble(dataGridViewProducts.Rows[index].Cells["Price"].Value),
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["DepartmentId"].Value),
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["ProduserId"].Value),
            Convert.ToInt32(dataGridViewProducts.Rows[index].Cells["Quantity"].Value),
            Convert.ToBoolean(dataGridViewProducts.Rows[index].Cells["CriticalQ"].Value));

              SetProduct(product);
        }