private void cmb_SelectedIndexChanged(object sender, EventArgs e) { try { if (workingYearBindingSource.Count <= 0) { return; } if (cmb.SelectedValue == null) { return; } var guid = (Guid)cmb.SelectedValue; var cn = WorkingYear.Get(guid); if (cn == null) { return; } txtConnectionString.Text = cn.ConnectionString; } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
public frmWorkingYearMain(Guid guid) { InitializeComponent(); cls = WorkingYear.Get(guid); ucHeader.Text = $"ویرایش واحد اقتصادی {cls.DbName}"; ucHeader.IsModified = true; }
private void btnSelect_Click(object sender, EventArgs e) { try { if (workingYearBindingSource.Count <= 0) { return; } if (cmb.SelectedValue == null) { return; } var guid = (Guid)cmb.SelectedValue; var cn = WorkingYear.Get(guid); if (cn == null) { return; } Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\\Software\\Arad", "BuildingCn", cn.ConnectionString); DialogResult = DialogResult.OK; Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }