private void lblControlNo_Click(object sender, EventArgs e) { if (DashboardGridView.GetFocusedRow() is DocumentActions documentActions) { if (documentActions.TableName == "Obligations") { Main frm = Application.OpenForms["Main"] as Main; frm.pnlMain.Controls.Clear(); var obr = new ucObligations() { Dock = DockStyle.Fill }; obr.txtSearch.Text = documentActions.ControlNo; frm.pnlMain.Controls.Add(obr); obr.btnSearch.PerformClick(); } else { Main frm = Application.OpenForms["Main"] as Main; frm.pnlMain.Controls.Clear(); var pr = new PR.UCPurchaseRequest(documentActions.ControlNo) { Dock = DockStyle.Fill }; //pr.txtSearch.Text = documentActions.ControlNo; pr.loadAddEditPurchaseRequest.Search(documentActions.ControlNo, true); frm.pnlMain.Controls.Add(pr); pr.btnSearch.PerformClick(); } } }
private async void DashboardGridView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (DashboardGridView.GetFocusedRow() is DocumentActions item) { await Detail(item); } }
private void btnTaskDone_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (DashboardGridView.GetFocusedRow() is DocumentActions item) { frmTaskDone frm = new frmTaskDone(item); frm.ShowDialog(); Init(); } }
private void btnTaskDelete_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (DashboardGridView.GetFocusedRow() is DocumentActions item) { if (MessageBox.Show("Do you want to submit this?", "Submit", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } UnitOfWork unitOfWork = new UnitOfWork(); item = unitOfWork.DocumentActionsRepo.Find(x => x.Id == item.Id, "RoutedToUsers"); item.RoutedToUsers.Remove(unitOfWork.UsersRepo.Find(x => x.Id == User.UserId)); unitOfWork.Save(); Init(); } }
private void btnAddAction_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (DashboardGridView.GetFocusedRow() is DocumentActions item) { frmDocActions frm = new frmDocActions(MethodType.Add, new DocumentActions() { TableName = item.TableName, ActionDate = DateTime.Now, RefId = item.RefId, CreatedBy = User.UserId, DateCreated = DateTime.Now, ControlNo = item.ControlNo, Year = item.Year }); frm.ShowDialog(); Init(); } }
private void lblControlNo_Click(object sender, EventArgs e) { if (DashboardGridView.GetFocusedRow() is DocumentActions documentActions) { } }