private void btnEdit_Click(object sender, EventArgs e) { payment = new Payment(); payment.ContractorID = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[0].Value); payment.DealID = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[1].Value); payment.SalesID = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[2].Value); payment.PaymentID = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[3].Value); payment.ChargeType = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[4].Value); payment.PaymentType = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[5].Value); payment.ContrName = Convert.ToString(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[6].Value); payment.DealName = Convert.ToString(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[7].Value); payment.PaymentOID = Convert.ToString(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[8].Value); payment.PaymentDate = Convert.ToDateTime(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[9].Value); payment.PaymentSum = Convert.ToDecimal(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[10].Value); using (paymentInterrop = new PaymentInterrop(payment)) { //dealInterrop.ButtonOkClicked += new EventHandler(EditRowDeal); //paymentInterrop.FormCaption = "Редактировать"; /* * dealInterrop.ContrID = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[1].Value.ToString()); * dealInterrop.ContrTIN = gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[2].Value.ToString(); * dealInterrop.ContrName = gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[3].Value.ToString(); * dealInterrop.DealNumber = gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[4].Value.ToString(); * dealInterrop.DealDate = Convert.ToDateTime(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[5].Value.ToString()); * dealInterrop.DealName = gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[6].Value.ToString(); * dealInterrop.DueDate = Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[7].Value.ToString());*/ paymentInterrop.ShowDialog(); } }
/*работа с интерфейсом*/ private void btnAdd_Click(object sender, EventArgs e) { payment = new Payment(); using (paymentInterrop = new PaymentInterrop(payment)) { paymentInterrop.ButtonOkClicked += new EventHandler(AddRowPayment); paymentInterrop.ShowDialog(); } }