private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
 {
     detail              = new SalesDetailDTO();
     detail.SalesID      = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[10].Value);
     detail.ProductID    = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[4].Value);
     detail.CustomerName = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
     detail.ProductName  = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
     detail.Price        = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[7].Value);
     detail.SalesAmount  = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[6].Value);
 }
Beispiel #2
0
 private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (cmbDeletedData.SelectedIndex == 0)
     {
         categorydetail              = new CategoryDetailDTO();
         categorydetail.ID           = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value);
         categorydetail.CategoryName = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
     }
     else if (cmbDeletedData.SelectedIndex == 1)
     {
         customerdetail              = new CustomerDetailDTO();
         customerdetail.ID           = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value);
         customerdetail.CustomerName = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
     }
     else if (cmbDeletedData.SelectedIndex == 2)
     {
         productdetail                   = new ProductDetailDTO();
         productdetail.ProductID         = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[4].Value);
         productdetail.CategoryID        = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[5].Value);
         productdetail.ProductName       = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
         productdetail.Price             = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[3].Value);
         productdetail.isCategoryDeleted = Convert.ToBoolean(dataGridView1.Rows[e.RowIndex].Cells[6].Value);
     }
     else
     {
         salesdetail                   = new SalesDetailDTO();
         salesdetail.SalesID           = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[10].Value);
         salesdetail.ProductID         = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[4].Value);
         salesdetail.CustomerName      = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
         salesdetail.ProductName       = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
         salesdetail.Price             = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[7].Value);
         salesdetail.SalesAmount       = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[6].Value);
         salesdetail.isCategoryDeleted = Convert.ToBoolean(dataGridView1.Rows[e.RowIndex].Cells[11].Value);
         salesdetail.isCustomerDeleted = Convert.ToBoolean(dataGridView1.Rows[e.RowIndex].Cells[12].Value);
         salesdetail.isProductDeleted  = Convert.ToBoolean(dataGridView1.Rows[e.RowIndex].Cells[13].Value);
     }
 }