protected override string GetDisplayText(object value) { ItemChanger item = new ItemChanger(); item = (ItemChanger)value; // wtf? return(base.GetDisplayText(item.Name)); }
private void ribbon_btSqlEditClick() { ItemChanger it = ICList.Items[ribbon.cmbItemChanger.SelectedItemIndex]; frmSqlEdit f = new frmSqlEdit(this); switch (ribbon.editorTypeSelect.SelectedItemIndex) { case 0: // Получить f.sql = it.GetSQL; if (DialogService.ShowDialog(f) == DialogResult.OK) { it.GetSQL = f.sql; SaveICL(); } break; case 1: // Редактировать f.sql = it.EditSql; if (DialogService.ShowDialog(f) == DialogResult.OK) { it.EditSql = f.sql; SaveICL(); } break; case 2: // Добавить f.sql = it.CreateSql; if (DialogService.ShowDialog(f) == DialogResult.OK) { it.CreateSql = f.sql; SaveICL(); } break; case 3: // Редактировать или добавить f.sql = it.CreateoreditSql; if (DialogService.ShowDialog(f) == DialogResult.OK) { it.CreateoreditSql = f.sql; SaveICL(); } break; case 4: // Удалить f.sql = it.DeleteSql; if (DialogService.ShowDialog(f) == DialogResult.OK) { it.DeleteSql = f.sql; SaveICL(); } break; default: break; } }
public void Add(ItemChanger ic) { List.Add(ic); }
public void Remove(ItemChanger ic) { List.Remove(ic); }
public static void GetObjectUniversal(Excel.Worksheet _wSheet, SqlConnection _cnt, ItemChanger _ic, bool _SaveAsSql, bool _Check) { if (!Instance.SqlInfoEventHandled) { Instance.SqlInfoEventHandled = true; _cnt.InfoMessage += _cnt_InfoMessage; } Instance.StopExecute = false; Instance.wSheet = _wSheet; Instance.cnt = _cnt; Instance.ic = _ic; Instance.SaveAsSql = _SaveAsSql; Instance.Check = _Check; //Instance.xlMain = _xlMain; Instance.bar.Style = ProgressBarStyle.Marquee; sqlparam mask = new sqlparam(); mask.WhereString = Instance.ic.GetSQLWhereString; // перенести в xml frmSelectTest fSelectTests = new frmSelectTest(mask); DialogService.ShowDialog(fSelectTests); if (fSelectTests.DialogResult == DialogResult.OK) { Instance.ic.GetSQLWhereString = ((sqlparam)fSelectTests.obj).WhereString; Instance.query = string.Format(Instance.ic.GetSQL, Instance.ic.GetSQLWhereString.Replace('*', '%')); Instance.t = new Thread(Instance.GetObjectUniversal); Instance.t.Priority = ThreadPriority.Highest; Instance.t.Start(); DialogService.ShowDialog(Instance); } }