private void ccb_ItemCheck(object sender, ItemCheckEventArgs e) { CCBoxItem item = cbxDbName.Items[e.Index] as CCBoxItem; WriteLog(string.Format("DB '{0}' is selected for backup{1}\r\n", item.Name, " " + e.NewValue.ToString().ToUpper())); txtOut.AppendText(string.Format("DB '{0}' is selected for backup{1}\r\n", item.Name, " " + e.NewValue.ToString().ToUpper())); }
//private void btnStep2_Click(object sender, EventArgs e) //{ // //this.cbxDbName.Items.Clear(); // if (ChkValidation()) // { // } //} private void btnSqlAuth_Click(object sender, EventArgs e) { if (ChkValidation()) { string chkDB = new DAL().dbchk(AssignData()); if (chkDB == "ok") { ////save profile //sql data only //// WriteLog("DB is authanticated.\n"); txtOut.AppendText("Auth of SQL Server Successfuly! " + DateTime.Now + " \r\n"); gBoxDoIt.Enabled = true; ////LOAD DROPDOWN WITH DBS. DbsList = new BLL().GetDbNames(AssignData()); //// this.cbxDbName.Items.Clear(); //// for (int i = 0; i < DbsList.Length; i++) { CCBoxItem item = new CCBoxItem(DbsList[i], i); cbxDbName.Items.Add(item); } // If more then 5 items, add a scroll bar to the dropdown. cbxDbName.MaxDropDownItems = 5; // Make the "Name" property the one to display, rather than the ToString() representation. cbxDbName.DisplayMember = "name"; cbxDbName.ValueSeparator = ","; // Check the first 2 items. //cbxDbName.SetItemChecked(0, true); //cbxDbName.SetItemChecked(1, true); //ccb.SetItemCheckState(1, CheckState.Indeterminate); this.cbxDbName.Focus(); MessageBox.Show("plz select DB that you want to get backup of"); } else { WriteLog(chkDB + "\n"); txtOut.AppendText(chkDB + ". " + DateTime.Now + " \r\n"); this.cbxDbName.Items.Clear(); gBoxDoIt.Enabled = false; } } }