// shows the form in edit modus // links: // docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77 public void ShowAsEdit(System.Guid productId) { var service = new CrudeProductServiceClient(); _isNew = false; try { _contract = service.FetchByProductId(productId); textBoxProductName.Text = _contract.ProductName; textBoxState.Text = _contract.StateRcd; userPicker.SelectedValue = _contract.UserId; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } finally { service.Close(); } }
public ActionResult CrudeProductCreate(System.Guid?userId, System.Guid?productBecameId) { var contract = new CrudeProductContract(); if (userId != null) { contract.UserId = (System.Guid)userId; } if (productBecameId != null) { contract.ProductBecameId = (System.Guid)productBecameId; } if (userId == null) { contract.UserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}"); } ViewBag.DefaultUserName = new CrudeDefaultUserServiceClient().FetchByDefaultUserId(contract.UserId).DefaultUserName; contract.DateTime = DateTime.UtcNow; return(View( "~/Views/Crude/Product/CrudeProduct/CrudeProductCreate.cshtml", contract )); }
// shows the form with default values for comboboxes and pickers // links: // docLink: http://sql2x.org/documentationLink/f5685d96-a0bb-4f7b-beaa-b3d578c7cf28 public void ShowAsAdd(string productName, string stateRcd, System.Guid userId, System.Guid productBecameId) { try { _contract = new CrudeProductContract(); _isNew = true; _contract.ProductName = productName; textBoxProductName.Text = _contract.ProductName; _contract.StateRcd = stateRcd; textBoxState.Text = _contract.StateRcd; _contract.UserId = userId; userPicker.SelectedValue = userId; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); _contract.ProductBecameId = productBecameId; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
// bring up add form for ProductMaintenance // links: // docLink: http://sql2x.org/documentationLink/c0944961-8179-40a2-a561-c8873b691f2c public void ShowAsAdd() { _contract = new CrudeProductContract(); _isNew = true; this.Text += " - Not Savable (User Missing)"; RefreshProductMaintenance(); Show(); }
// bring up add form for ProductMaintenance by foreign key ProductBecame // links: // docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9 public void ShowAsAddByProductBecame(System.Guid productBecameId) { _contract = new CrudeProductContract(); _isNew = true; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); _contract.ProductBecameId = productBecameId; RefreshProductMaintenance(); Show(); }
// bring up add form for ProductMaintenance with rules // links: // docLink: http://sql2x.org/documentationLink/6018e96e-28a1-4df4-879b-01a6bda81cc7 public void ShowAsAddByRules(System.Guid userId) { _contract = new CrudeProductContract(); _isNew = true; _contract.UserId = userId; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); RefreshProductMaintenance(); Show(); }
public ActionResult CrudeProductCreate([Bind()] CrudeProductContract contract) { if (ModelState.IsValid) { new CrudeProductServiceClient().Insert(contract); return(RedirectToAction("CrudeProductIndex")); } return(View( "~/Views/Crude/Product/CrudeProduct/CrudeProductCreate.cshtml", contract )); }
// bring up add form for ProductMaintenance // links: // docLink: http://sql2x.org/documentationLink/8568fd9a-b807-4aad-ac74-7826975e3241 public void ShowAsAdd(System.Guid productBecameId, string productName, string stateRcd, System.Guid userId) { _contract = new CrudeProductContract(); _isNew = true; _contract.ProductBecameId = productBecameId; _contract.ProductName = productName; textBoxProductName.Text = _contract.ProductName; _contract.StateRcd = stateRcd; textBoxState.Text = _contract.StateRcd; _contract.UserId = userId; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); RefreshProductMaintenance(); Show(); }
public ActionResult CrudeProductEdit([Bind()] CrudeProductContract contract) { if (ModelState.IsValid) { contract.DateTime = DateTime.UtcNow; new CrudeProductServiceClient().Update(contract); return(RedirectToAction("CrudeProductIndex")); } return(View( "~/Views/Crude/Product/CrudeProduct/CrudeProductEdit.cshtml", contract )); }
// shows the form with default values for comboboxes and pickers // links: // docLink: http://sql2x.org/documentationLink/e04d0806-55ef-41cc-8669-acf0ddd850c7 public void ShowAsAdd() { try { _contract = new CrudeProductContract(); _isNew = true; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
// shows the form with default values for comboboxes and pickers // links: // docLink: http://sql2x.org/documentationLink/e04d0806-55ef-41cc-8669-acf0ddd850c7 public void ShowAsAdd() { try { _contract = new CrudeProductContract(); _isNew = true; this.Text += " - Not Savable (User Missing)"; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
// bring up edit form for ProductMaintenance // links: // docLink: http://sql2x.org/documentationLink/d7ff032d-3bcf-438f-9850-900ca0ebca98 public void ShowAsEdit(System.Guid productId) { var service = new CrudeProductServiceClient(); _isNew = false; try { _contract = service.FetchByProductId(productId); textBoxProductName.Text = _contract.ProductName; textBoxState.Text = _contract.StateRcd; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); RefreshProductMaintenance(); Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { service.Close(); } }
// shows by foreign keys // links: // docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391 public void ShowAsAddByProductBecame(System.Guid productBecameId) { try { _contract = new CrudeProductContract(); _isNew = true; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); _contract.ProductBecameId = productBecameId; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
// shows the form with default values for comboboxes and pickers // links: // docLink: http://sql2x.org/documentationLink/599dcb45-f71b-4672-bb18-46975a4fe9b3 public void ShowAsAddByRules(System.Guid userId) { try { _contract = new CrudeProductContract(); _isNew = true; _contract.UserId = userId; userPicker.SelectedValue = _contract.UserId; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }