private void btnNextDay_Click(object sender, EventArgs e) { if (this.Dispatch == null) { return; } var copy = this.Dispatch.NewCopy(); copy.FromDateTime = copy.FromDateTime.AddDays(1); copy.ToDateTime = copy.ToDateTime.AddDays(1); var manager = DispatchManager.Create(copy); using (XF_DispatchNewEdit form = new XF_DispatchNewEdit(manager)) { var result = form.ShowDialog(); if (result == DialogResult.Yes) { this.LoadDispatch(manager.ActiveModel); } if (DispatchChanged != null) { DispatchChanged(this, new DispatchEventArgs(this.Dispatch, result)); } } }
private void btnEdit_Click(object sender, EventArgs e) { if (this.Dispatch == null) { return; } var manager = DispatchManager.Create(this.Dispatch); using (XF_DispatchNewEdit form = new XF_DispatchNewEdit(manager)) { var result = form.ShowDialog(); if (result == DialogResult.Yes) { if (form.IsDeleted) { ClearDispatch(); } else { this.LoadDispatch(manager.ActiveModel); } } if (DispatchChanged != null) { DispatchChanged(this, new DispatchEventArgs(manager.ActiveModel, result)); } } }
private void gridViewDisp_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { if (this.DesignMode) { return; } var row = gridViewDisp.GetRow(e.RowHandle) as DispatchCatalogModel; if (row != null) { xU_Dispatch.LoadDispatch(row); } if (e.Clicks == 2) { var manager = DispatchManager.CreateEdit(row.DispatchID); using (XF_DispatchNewEdit form = new XF_DispatchNewEdit(manager)) { if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { LoadDispatches(); if (form.IsDeleted) { xU_Dispatch.ClearDispatch(); } } } } }
private void btnNewDispatch_Click(object sender, EventArgs e) { DispatchModel disp = new DispatchModel(); if (this.Dispatch != null) { disp = this.Dispatch.NewCopy(); } disp.FromDateTime = DateTime.Now.Date.AddHours(9); disp.ToDateTime = disp.FromDateTime.AddHours(8); disp.CompanyID = 0; disp.LocationID = 0; var manager = DispatchManager.Create(disp); using (XF_DispatchNewEdit form = new XF_DispatchNewEdit(manager)) { var result = form.ShowDialog(); if (result == DialogResult.Yes) { this.LoadDispatch(manager.ActiveModel); } if (DispatchChanged != null) { DispatchChanged(this, new DispatchEventArgs(this.Dispatch, result)); } } }
private void gridViewDisp_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { if (this.DesignMode) return; var row = gridViewDisp.GetRow(e.RowHandle) as DispatchCatalogModel; if (row != null) { xU_Dispatch.LoadDispatch(row); } if (e.Clicks == 2) { var manager = DispatchManager.CreateEdit(row.DispatchID); using (XF_DispatchNewEdit form = new XF_DispatchNewEdit(manager)) { if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { LoadDispatches(); if (form.IsDeleted) xU_Dispatch.ClearDispatch(); } } } }