// 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 CrudeFinancialCurrencyContract(); _isNew = true; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
public ActionResult CrudeFinancialCurrencyEdit([Bind()] CrudeFinancialCurrencyContract contract) { if (ModelState.IsValid) { contract.DateTime = DateTime.UtcNow; new CrudeFinancialCurrencyServiceClient().Update(contract); return(RedirectToAction("CrudeFinancialCurrencyIndex")); } return(View( "~/Views/Crude/Financial/CrudeFinancialCurrency/CrudeFinancialCurrencyEdit.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 CrudeFinancialCurrencyContract(); _isNew = true; this.Text += " - Not Savable (User Missing)"; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
public ActionResult CrudeFinancialCurrencyCreate(System.Guid?userId) { var contract = new CrudeFinancialCurrencyContract(); if (userId != null) { contract.UserId = (System.Guid)userId; } ViewBag.FinancialCurrencyTypeRcd = new SelectList(new CrudeFinancialCurrencyTypeRefServiceClient().FetchAll(), "FinancialCurrencyTypeRcd", "FinancialCurrencyTypeName", contract.FinancialCurrencyTypeRcd ); ViewBag.FinancialCurrencyAgainstFinancialCurrencyTypeRcd = new SelectList(new CrudeFinancialCurrencyTypeRefServiceClient().FetchAll(), "FinancialCurrencyTypeRcd", "FinancialCurrencyTypeName", contract.FinancialCurrencyAgainstFinancialCurrencyTypeRcd ); contract.ValidFromDateTime = DateTime.UtcNow; contract.ValidUntilDateTime = DateTime.UtcNow; 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/Financial/CrudeFinancialCurrency/CrudeFinancialCurrencyCreate.cshtml", contract )); }
// 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 CrudeFinancialCurrencyContract(); _isNew = true; _contract.UserId = userId; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); 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/f5685d96-a0bb-4f7b-beaa-b3d578c7cf28 public void ShowAsAdd(string financialCurrencyTypeRcd, string financialCurrencyTypeCode, string financialCurrencyTypeName, string financialCurrencyAgainstFinancialCurrencyTypeRcd, System.DateTime validFromDateTime, System.DateTime validUntilDateTime, decimal amount, decimal equalsAmount, int decimalCount, System.Guid userId) { try { _contract = new CrudeFinancialCurrencyContract(); _isNew = true; _contract.FinancialCurrencyTypeRcd = financialCurrencyTypeRcd; financialCurrencyTypeRefCombo.Text = _contract.FinancialCurrencyTypeRcd != null ? _contract.FinancialCurrencyTypeRcd : String.Empty; _contract.FinancialCurrencyTypeCode = financialCurrencyTypeCode; textBoxFinancialCurrencyTypeCode.Text = _contract.FinancialCurrencyTypeCode; _contract.FinancialCurrencyTypeName = financialCurrencyTypeName; textBoxFinancialCurrencyTypeName.Text = _contract.FinancialCurrencyTypeName; _contract.FinancialCurrencyAgainstFinancialCurrencyTypeRcd = financialCurrencyAgainstFinancialCurrencyTypeRcd; financialCurrencyAgainstFinancialCurrencyTypeRefCombo.Text = _contract.FinancialCurrencyAgainstFinancialCurrencyTypeRcd != null ? _contract.FinancialCurrencyAgainstFinancialCurrencyTypeRcd : String.Empty; _contract.ValidFromDateTime = validFromDateTime; dateTimePickerValidFromDateTime.Value = _contract.ValidFromDateTime != DateTime.MinValue ? _contract.ValidFromDateTime : dateTimePickerValidFromDateTime.MinDate; dateTimePickerValidFromDateTime.Checked = _contract.ValidFromDateTime != DateTime.MinValue; _contract.ValidUntilDateTime = validUntilDateTime; dateTimePickerValidUntilDateTime.Value = _contract.ValidUntilDateTime != DateTime.MinValue ? _contract.ValidUntilDateTime : dateTimePickerValidUntilDateTime.MinDate; dateTimePickerValidUntilDateTime.Checked = _contract.ValidUntilDateTime != DateTime.MinValue; _contract.Amount = amount; maskedTextBoxAmount.Text = _contract.Amount.ToString(); _contract.EqualsAmount = equalsAmount; maskedTextBoxEqualsAmount.Text = _contract.EqualsAmount.ToString(); _contract.DecimalCount = decimalCount; maskedTextBoxDecimalCount.Text = _contract.DecimalCount.ToString(); _contract.UserId = userId; userPicker.SelectedValue = userId; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); 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 ShowAsAddByFinancialCurrencyType(string financialCurrencyTypeRcd) { try { _contract = new CrudeFinancialCurrencyContract(); _isNew = true; _contract.DateTime = DateTime.UtcNow; dateTimePickerDateTime.Text = _contract.DateTime.ToString(); _contract.FinancialCurrencyTypeRcd = financialCurrencyTypeRcd; financialCurrencyTypeRefCombo.Text = _contract.FinancialCurrencyTypeRcd != null ? _contract.FinancialCurrencyTypeRcd : String.Empty; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
// populates the Picker with the first match from the SOAP service // links: // docLink: http://sql2x.org/documentationLink/3e8b9e1a-39eb-444f-9632-ce3406db3534 private void txtFinancialCurrencyCode_Validating(object sender, CancelEventArgs e) { if (!DesignMode) { // empty picker on no code if (string.IsNullOrEmpty(txtFinancialCurrencyCode.Text)) { _financialCurrencyId = Guid.Empty; txtFinancialCurrencyName.Text = string.Empty; txtFinancialCurrencyCode.Text = string.Empty; return; } CrudeFinancialCurrencyServiceClient financialCurrency = null; try { financialCurrency = new CrudeFinancialCurrencyServiceClient(); CrudeFinancialCurrencyContract contract = financialCurrency.FetchByFinancialCurrencyTypeCode(txtFinancialCurrencyCode.Text); if (contract != null) { txtFinancialCurrencyCode.Text = contract.FinancialCurrencyTypeCode; txtFinancialCurrencyName.Text = contract.FinancialCurrencyTypeName; _financialCurrencyId = contract.FinancialCurrencyId; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { if (financialCurrency != null) { financialCurrency.Close(); } } if (this.Picked != null) { this.Picked(new object(), new EventArgs()); } } }