private void ScriptInfoDialog_Load(object sender, EventArgs e) { CheckForIllegalCrossThreadCalls = false; this.ManageOnDispose(); SCMS.Validators.Add(this); AttachEditorHandler(); if (_isnew) { string _tempseries = SCMS.GetTableSeriesNumber("scripts"); txtReferenceNo.Text = "SQL-" + SCMS.CurrentCompany.Company + "-" + _tempseries; } else { txtReferenceNo.Text = _referenceno; } btnExport.Enabled = (!_isnew); btnExport.Visible = (!_isnew); btnExecute.Enabled = (!_isnew); btnExecute.Visible = (!_isnew); txtAuthor.Text = SCMS.CurrentSystemUser.FullName; txtSystemVersion.Text = Application.ProductVersion; txtReferenceNo.ReadOnly = true; txtAuthor.ReadOnly = true; lblAutoScript.Hide(); lblExecuted.Hide(); txtTitle.SetAsRequired(); txtScript.SetAsRequired(); txtSystemVersion.SetAsRequired(); txtDescription.SetAsRequired(); if (!_isnew) { InitializeInfo(); } }
/// <summary> /// Clears the information fields for the current customer rendering it in a new instance mode. /// </summary> public void ClearInformation() { if (!_isnew) { _isnew = true; } if (_updated) { _updated = false; } if (_isshown) { _isshown = false; } if (_isinbackground) { _isinbackground = false; } Text = Text.Replace(" *", "").Replace("*", ""); txtAddress.Text = ""; txtCreditLimit.Value = 0; txtCustomerName.Text = ""; txtCustomerNo.Text = ""; txtEmail.Text = ""; txtFax.Text = ""; txtMarginPercent.Value = 0; txtMobile.Text = ""; txtNotes.Text = ""; txtPhone.Text = ""; txtPoc.Text = ""; string _seriesno = SCMS.GetTableSeriesNumber("customers"); txtCustomerNo.Text = _seriesno; try { cboBankAccount.SelectedIndex = -1; } catch { } try { cboCountry.SelectedIndex = -1; } catch { } try { cboCustomerGroup.SelectedIndex = -1; } catch { } try { cboDebtorAccount.SelectedIndex = -1; } catch { } try { cboLocation.SelectedIndex = -1; } catch { } try { cboPaymentTerms.SelectedIndex = -1; } catch { } try { cboPrepaymentAccount.SelectedIndex = -1; } catch { } tbctrl.SelectedTab = tbGeneral; tbCustomerLedger.Visible = false; tbPayments.Visible = false; tbReceivables.Visible = false; }