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 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 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)); } } }
void gridViewDisp_CellValueChanged(object sender, CellValueChangedEventArgs e) { var row = gridViewDisp.GetRow(e.RowHandle) as DispatchCatalogModel; if (row != null) { var manager = DispatchManager.Create(row); var res = manager.SaveDispatch(row); if (res.Failed) { Mess.Warning(res.Message); this.TryShowPopup(res.Property); } else { LoadDispatches(); this.BoldColumn = e; } } }