private InvoiceDetailModel InitEditPanel() { InvoiceDetailModel detail = new InvoiceDetailModel(); initializareComboBox(); foreach (DataGridViewRow row in dataGridViewDetalii.SelectedRows) { tbAmount.Text = row.Cells[5].Value.ToString(); detail.InvoiceDetailId = Convert.ToInt32(row.Cells[0].Value.ToString()); tbObservations.Text = row.Cells[6].Value.ToString(); tbPrice.Text = row.Cells[4].Value.ToString(); tbQtty.Text = row.Cells[3].Value.ToString(); tbAmount.Text = ((Convert.ToDecimal(row.Cells[4].Value.ToString())) * (Convert.ToDecimal(row.Cells[3].Value.ToString()))).ToString(); DataTable items = new DataTable(); BLItems blItems = new BLItems(); try { items = blItems.GetItemNameById(Convert.ToInt32(row.Cells[2].Value.ToString())); cbItems.Text = items.Rows[0]["ItemName"].ToString(); } catch (Exception ex) { Console.WriteLine("Eroare INIT PANEL!! " + ex.Message); } } return(detail); }