public ActionResult CrudeDefaultRuleCreate(System.Guid?defaultUserId) { var contract = new CrudeDefaultRuleContract(); if (defaultUserId != null) { contract.DefaultUserId = (System.Guid)defaultUserId; } ViewBag.DefaultRuleTypeRcd = new SelectList(new CrudeDefaultRuleTypeRefServiceClient().FetchAll(), "DefaultRuleTypeRcd", "DefaultRuleTypeName", contract.DefaultRuleTypeRcd ); if (defaultUserId == null) { contract.DefaultUserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}"); } contract.DateTime = DateTime.UtcNow; return(View( "~/Views/Crude/Default/CrudeDefaultRule/CrudeDefaultRuleCreate.cshtml", contract )); }
// shows the form in edit modus // links: // docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77 public void ShowAsEdit(System.Guid defaultRuleId, System.Guid defaultUserId) { var service = new CrudeDefaultRuleServiceClient(); _isNew = false; try { _contract = service.FetchByDefaultRuleId(defaultRuleId); defaultRuleTypeRefCombo.Text = _contract.DefaultRuleTypeRcd != null ? _contract.DefaultRuleTypeRcd : String.Empty; textBoxAddress.Text = _contract.Address; _contract.DefaultUserId = defaultUserId; dateTimePickerDateTime.Value = _contract.DateTime != DateTime.MinValue ? _contract.DateTime : dateTimePickerDateTime.MinDate; dateTimePickerDateTime.Checked = _contract.DateTime != DateTime.MinValue; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } finally { service.Close(); } }
// 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 defaultRuleTypeRcd, string address, System.Guid defaultUserId, System.DateTime dateTime) { try { _contract = new CrudeDefaultRuleContract(); _isNew = true; _contract.DefaultRuleTypeRcd = defaultRuleTypeRcd; defaultRuleTypeRefCombo.Text = _contract.DefaultRuleTypeRcd != null ? _contract.DefaultRuleTypeRcd : String.Empty; _contract.Address = address; textBoxAddress.Text = _contract.Address; _contract.DefaultUserId = defaultUserId; _contract.DateTime = dateTime; dateTimePickerDateTime.Value = _contract.DateTime != DateTime.MinValue ? _contract.DateTime : dateTimePickerDateTime.MinDate; dateTimePickerDateTime.Checked = _contract.DateTime != DateTime.MinValue; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
public ActionResult CrudeDefaultRuleCreate([Bind()] CrudeDefaultRuleContract contract) { if (ModelState.IsValid) { new CrudeDefaultRuleServiceClient().Insert(contract); return(RedirectToAction("CrudeDefaultRuleIndex")); } return(View( "~/Views/Crude/Default/CrudeDefaultRule/CrudeDefaultRuleCreate.cshtml", contract )); }
public ActionResult CrudeDefaultRuleEdit([Bind()] CrudeDefaultRuleContract contract) { if (ModelState.IsValid) { contract.DefaultUserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}"); new CrudeDefaultRuleServiceClient().Update(contract); return(RedirectToAction("CrudeDefaultRuleIndex")); } return(View( "~/Views/Crude/Default/CrudeDefaultRule/CrudeDefaultRuleEdit.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 CrudeDefaultRuleContract(); _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 CrudeDefaultRuleContract(); _isNew = true; this.Text += " - Not Savable (DefaultUser Missing)"; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
// shows by foreign keys // links: // docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391 public void ShowAsAddByDefaultRuleType(string defaultRuleTypeRcd) { try { _contract = new CrudeDefaultRuleContract(); _isNew = true; _contract.DefaultRuleTypeRcd = defaultRuleTypeRcd; defaultRuleTypeRefCombo.Text = _contract.DefaultRuleTypeRcd != null ? _contract.DefaultRuleTypeRcd : String.Empty; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }