private void cmdADD_Capacitaciones_Click(object sender, EventArgs e) { if (!mtxtCedula.ValidateMaskedTextbox()) { MessageBox.Show("Complete campo Cedula"); return; } var cap = new CapacitacionViewModel(); var frm = new workCapacitaciones() { //ContextCapacitaciones = Context, Editing = false, CedulaCandidato = mtxtCedula.Text,// Candidato.Cedula, cap = cap }; frm.ShowDialog(); if (frm.SaveData) { //Candidato.Capacitaciones.Add(cap); dictionaryCap.Add(dictionaryCap.Count + 1, cap); } fillCapacitaciones(); }
private void DgvCapacitaciones_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { var id = int.Parse(dgvCapacitaciones.Rows[e.RowIndex].Cells["ID"].Value.ToString()); var c = dictionaryCap[id].Adapt <CapacitacionViewModel>(); idCurrentCap = id; var frm = new workCapacitaciones() { Editing = true, cap = c, //ContextCapacitaciones = context, CedulaCandidato = mtxtCedula.Text }; frm.StartPosition = FormStartPosition.CenterScreen; frm.DeletingCapacitacionesEvent += DeleteCapacitacion; frm.ShowDialog(); frm.DeletingCapacitacionesEvent -= DeleteCapacitacion; if (frm.SaveData) { dictionaryCap[id] = c; } fillCapacitaciones(); }