private void btnEditPORepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (LRGridView.GetFocusedRow() is Liquidations item) { UnitOfWork unitOfWork = new UnitOfWork(); item = unitOfWork.LiquidationsRepo.Find(x => x.Id == item.Id); frmAddEditLR frm = new frmAddEditLR(item, MethodType.Edit); frm.ShowDialog(); Init(); } }
private void btnDeletePQRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (LRGridView.GetFocusedRow() is Liquidations item) { if (MessageBox.Show("Do you want to delete this?", "delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } UnitOfWork unitOfWork = new UnitOfWork(); unitOfWork.LiquidationsRepo.Delete(x => x.Id == item.Id); unitOfWork.Save(); Init(); } }
private void btnPreview_Click(object sender, EventArgs e) { try { if (LRGridView.GetFocusedRow() is Liquidations item) { frmReportViewer frm = new frmReportViewer(new rptLR() { DataSource = new UnitOfWork().LiquidationsRepo.Get(x => x.Id == item.Id) }); frm.ShowDialog(); } } catch (Exception exception) { } }