private void btnNuevo_Click(object sender, EventArgs e) { try { FrmServicioNuevo f = new FrmServicioNuevo(); f.ShowDialog(); Model.State = EntityState.Create; Model.GetAllAsync(); } catch (Exception ex) { ErrorLogHelper.AddExcFileTxt(ex, "FrmServicio ~ btnNuevo_Click(object sender, EventArgs e)"); CIDMessageBox.ShowAlert(Messages.SystemName, Messages.ErrorMessage, TypeMessage.error); } }
private void btnModificar_Click(object sender, EventArgs e) { try { var item = ObtenerSeleccionado(); if (item != null) { Model.State = EntityState.Update; FrmServicioNuevo frn = new FrmServicioNuevo(ObtenerSeleccionado()); frn.ShowDialog(); Model.GetAllAsync(); } else { CIDMessageBox.ShowAlert(Messages.SystemName, Messages.GridSelectMessage, TypeMessage.informacion); } } catch (Exception ex) { ErrorLogHelper.AddExcFileTxt(ex, "FrmServicio ~ btnModificar_Click(object sender, EventArgs e)"); CIDMessageBox.ShowAlert(Messages.SystemName, Messages.ErrorMessage, TypeMessage.error); } }