private void btnCreate_Click(object sender, System.EventArgs e) { if (!ValidationUtility.FieldNotAllowNull(this)) { return; } NoteProjectDetail note = new NoteProjectDetail(); CoverObjectUtility.GetAutoBindingData(this, note); try { using (IUnitOfWork uow = new UnitOfWork()) { uow.NoteProjectDetailBaseRepository.Add(note); uow.Commit(); } if (insertnote != null) { insertnote(note, CRUD.Insert); } Close(); } catch { labelNotify1.SetText(UI.createfailed, ToolBoxCS.LabelNotify.EnumStatus.Failed); } }
private void gridView1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete) { DialogResult rs = FormUtility.MsgDelete(); if (rs == DialogResult.Yes) { try { NoteProjectDetail note = gridUtility.GetSelectedItem <NoteProjectDetail>(); using (IUnitOfWork uow = new UnitOfWork()) { uow.NoteProjectDetailBaseRepository.Remove(note); uow.Commit(); } //remove gridView1.DeleteSelectedRows(); labelNotify1.SetText(UI.removesuccess, ToolBoxCS.LabelNotify.EnumStatus.Success); } catch { labelNotify1.SetText(UI.removefailed, ToolBoxCS.LabelNotify.EnumStatus.Failed); } } e.Handled = true; } }
private void InsertOrUpdate(NoteProjectDetail note, CRUD cru) { if (cru == CRUD.Insert) { gridUtility.AddNewRow(note); } else { gridUtility.UpdateRow(note); } gridView1.RefreshData(); }
public int AddandGetRequestPaymentId(NoteProjectDetail entry) { throw new NotImplementedException(); }
public frmEditNote(NoteProjectDetail note) { InitializeComponent(); this.note = note; }