private void cmdADD_Click(object sender, EventArgs e) { var frm = new workCapacitaciones() { //ContextCapacitaciones = context }; frm.StartPosition = FormStartPosition.CenterScreen; frm.Editing = false; frm.ShowDialog(); if (frm.SaveData) { Capacitaciones.Add(frm.cap.Adapt <Capacitaciones>()); } }
private void DgvCapacitaciones_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { var id = int.Parse(dgvCapacitaciones.Rows[e.RowIndex].Cells[0].Value.ToString()); var c = Capacitaciones[id].Adapt <CapacitacionViewModel>(); var frm = new workCapacitaciones() { Editing = true, cap = c, //ContextCapacitaciones = context, CedulaCandidato = Cedula }; frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(); }