/// <summary> /// 选择数据库模板 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btSelectDbTempLate_Click(object sender, EventArgs e) { frmDBSet dBSet = new frmDBSet(string.Format("选取数据库模板"), string.Format("数据库存储结构,用于初始化正式库、临时库和历史库")); if (dBSet.ShowDialog() != DialogResult.OK) { return; } DBConfig dbTemplateConfig = dBSet.DbConfig; string strConfigName = dbTemplateConfig.GetConfigName(); if (m_dicTemplateDb.ContainsKey(strConfigName)) { DevExpress.XtraEditors.XtraMessageBox.Show(string.Format("当前模板列表已存在"), "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { m_dicTemplateDb.Add(strConfigName, dbTemplateConfig); CheckedListBoxItem item = new CheckedListBoxItem(); item.Value = strConfigName; item.CheckState = CheckState.Unchecked; listDbTemplate.Items.Add(item); } }
private void SetCheckBoxListSource(DataTable dt) { try { if (checkedListBoxControlEmrNode.InvokeRequired) { checkedListBoxControlEmrNode.Invoke(new Action <DataTable>(SetCheckBoxListSource), dt); } else { checkedListBoxControlEmrNode.Items.Clear(); foreach (DataRow dr in dt.Rows) { checkedListBoxControlEmrNode.Items.Add(new EmrNode(dr), false); } } if (null != checkedListBoxControlEmrNode.Items && checkedListBoxControlEmrNode.Items.Count > 0) { m_FocusedCheckItem = checkedListBoxControlEmrNode.Items[0]; SelectedIndexChanged(0); } } catch (Exception ex) { throw ex; } }
protected override Control GetEditControl(string PropertyName, object CurrentValue, object instance) { TrainingPlanHtmlExporter exporter = (TrainingPlanHtmlExporter)instance; string[] days = new string[0]; if (CurrentValue != null) { days = CurrentValue.ToString().Split(TrainingPlanHtmlExporter.DaysSeparator); } myListBox.BorderStyle = BorderStyles.NoBorder; myListBox.HotTrackItems = true; myListBox.HotTrackSelectMode = HotTrackSelectMode.SelectItemOnClick; //Creating ListBox items... //Note that as this is executed in design mode, performance is not important and there is no need to cache these items if they can change each time. myListBox.Items.Clear(); foreach (var trainingPlanDay in exporter.TrainingPlan.Days) { CheckedListBoxItem item = new CheckedListBoxItem(trainingPlanDay); item.CheckState = Array.IndexOf(days, trainingPlanDay.GlobalId.ToString()) > -1 ? CheckState.Checked : CheckState.Unchecked; item.Description = trainingPlanDay.Name; myListBox.Items.Add(item); } //myListBox.SelectedIndex = myListBox.FindString(CurrentValue.ToString()); //Select current item based on CurrentValue of the property //myListBox.Height = myListBox.PreferredHeight; return(myListBox); }
private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { CheckedListBoxItem currItem = (CheckedListBoxItem)checkedListBoxControl1.GetItem(e.Index); Privilege privilege = (Privilege)currItem.Value; string rolename = this.CurrentRole.Name; //如果选中 if (e.State == CheckState.Checked) { Impower imp = Impower.GetImpower(rolename, privilege.Id); if (imp == null) { imp = new Impower(); imp.PowerFlags = 1; imp.RoleName = rolename; imp.PrivilegeId = privilege.Id; imp.Enabled = true; imp.CreateDate = DateTime.Now; imp.ExpireTime = DateTime.Now.AddYears(15); imp.Save(); } } //如果没有选中 if (e.State == CheckState.Unchecked) { Impower imp = Impower.GetImpower(rolename, privilege.Id);; if (imp != null) { imp.Delete(); } } }
/// <summary> /// 添加按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, EventArgs e) { if (this.luOperator.EditValue == null || this.luOperator.EditValue.ToString() == "nulltext") { return; } var userId = int.Parse(this.luOperator.EditValue.ToString().Trim()); var selectedOperator = luOperator.Properties.GetDataSourceRowByKeyValue(userId) as UserInfo; CheckedListBoxItem item = new CheckedListBoxItem( value: selectedOperator.Id, description: string.Format(_operatorCheckedListBoxItemDisplayText, selectedOperator.Name, selectedOperator.Code), checkState: CheckState.Checked, enabled: true ); if (this.clbOperator.Items.Where(x => item.Value.ToString() == x.Value.ToString()).Count() == 0) { this.clbOperator.Items.Add(item); this.clbOperator.ResetBindings(); this.luOperator.EditValue = null; } }
/// <summary> /// ChooseImportFile /// </summary> /// <param name="fileDate"></param> /// <param name="txt"></param> /// <param name="chkItem"></param> private void ChooseImportFile(DateTime fileDate, DevExpress.XtraEditors.TextEdit txt, CheckedListBoxItem chkItem) { try { xtraOpenFileDialog1.Filter = "Excel | *.xls | Excelx | *.xlsx | All files (*.*) | (*.*) "; // file types, that will be allowed to upload xtraOpenFileDialog1.Multiselect = false; // allow/deny user to upload more than one file at a time //上櫃資料__請輸入交易日期 , 範本檔名稱=成交彙總表10710 //上市資料__請輸入交易日期 , 範本檔名稱=09201810 string filename = string.Format("09{0}.xls", fileDate.ToString("yyyyMM")); xtraOpenFileDialog1.FileName = filename; //default filename xtraOpenFileDialog1.InitialDirectory = Application.StartupPath; //default path if (!File.Exists(Path.Combine(Application.StartupPath, filename))) { xtraOpenFileDialog1.InitialDirectory = "C:\\"; } if (xtraOpenFileDialog1.ShowDialog() == DialogResult.OK) // if user clicked OK { txt.Text = xtraOpenFileDialog1.FileName; // get name of file chkItem.CheckState = CheckState.Checked; } else { txt.Text = ""; chkItem.CheckState = CheckState.Unchecked; } } catch (Exception ex) { WriteLog(ex); } }
/// <summary> /// 查询条件 /// </summary> /// <returns></returns> private ConditionItem[] GetConditions() { List <ConditionItem> conds = new List <ConditionItem>(); conds.Add(new ConditionItem { PropertyName = "PickedPlanCode", FindType = ConditionType.ctLike, Values = new object[] { txtPickedPlanCode.Text } }); conds.Add(new ConditionItem { PropertyName = "PickedPlanOn", FindType = ConditionType.ctBetween, Values = new object[] { DateTime.Parse(ttPickedPlanOn1.Text), DateTime.Parse(ttPickedPlanOn2.Text) } }); CheckedListBoxItem clbi = cboPickedPlanState.EditValue as CheckedListBoxItem; if (clbi != null && !clbi.Value.Equals("")) { conds.Add(new ConditionItem { PropertyName = "PickedPlanState", FindType = ConditionType.ctEqual, Values = new object[] { int.Parse(clbi.Value.ToString()) } }); } return(conds.ToArray()); }
private void InitCon() { INIClass.INIPath = GlobalVar.INI_strSysIniPath; dbsqlite = new SQLiteCon(); dbsqlite.Init(); indexer = new IndexOpt(); indexer.Init(dbsqlite.DBPath); indexer.IndexBuildFinish += IndexBuildFinishCallBack; indexer.SearchFinish += SearchFinishCallBack; netopt = new NetOpt(); netopt.RemoteSearchRequest += RemoteSearchRequestCallBack; netopt.RemoteSearchResponse += RemoteSearchResponseCallBack; List <string> listFolder = indexer.GetFolderList(); foreach (string str in listFolder) { CheckedListBoxItem chkLBi = new CheckedListBoxItem(str, false); chkListBoxFolder.Items.Add(chkLBi); } txtIndexPath.Text = indexer.GetIndexDir(); chkLocalSearch.Checked = true; }
private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { CheckedListBoxItem currItem = (CheckedListBoxItem)checkedListBoxControl1.GetItem(e.Index); 职务等级 职务等级 = (职务等级)currItem.Value; string rolename = this.CurrentRole.Name; //如果选中 if (e.State == CheckState.Checked) { RoleLevel rLevel = RoleLevel.GetRoleLevel(rolename, CurrentCompany.公司编码, 职务等级.编码); if (rLevel == null) { rLevel = new RoleLevel(); rLevel.角色 = rolename; rLevel.公司编码 = CurrentCompany.公司编码; rLevel.职务等级 = 职务等级.编码; rLevel.Save(); } } //如果没有选中 if (e.State == CheckState.Unchecked) { RoleLevel rLevel = RoleLevel.GetRoleLevel(rolename, CurrentCompany.公司编码, 职务等级.编码); if (rLevel != null) { rLevel.Delete(); } } }
protected override void BelgeDurumuYukle() { var enums = Enum.GetValues(typeof(BelgeDurumu)); foreach (BelgeDurumu entity in enums) { var item = new CheckedListBoxItem { CheckState = CheckState.Checked, Description = entity.ToName(), Value = entity }; if (entity == BelgeDurumu.Portfoyde || entity == BelgeDurumu.KismiAvukatYoluylaTahsilEtme || entity == BelgeDurumu.KismiTahsilEdildi || entity == BelgeDurumu.BankayaTahsileGonderme || entity == BelgeDurumu.AvukataGonderme || entity == BelgeDurumu.CiroEtme || entity == BelgeDurumu.BlokeyeAlma || entity == BelgeDurumu.OnayBekliyor || entity == BelgeDurumu.PortfoyeGeriIade || entity == BelgeDurumu.PortfoyeKarsiliksizIade || entity == BelgeDurumu.TahsiliImkansizHaleGelme ) { BelgeDurumlari.Properties.Items.Add(item); } } }
/// <summary> /// Key pressed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SearchText_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar != (int)Keys.Return) { return; } int i1 = CheckList.SelectedIndex; if (i1 < 0) { return; } CheckedListBoxItem clbi = CheckList.Items[i1]; // switch check state if (clbi.CheckState == CheckState.Unchecked) { clbi.CheckState = CheckState.Checked; } else { clbi.CheckState = CheckState.Unchecked; } return; }
private void MultiPrintFrm_Load(object sender, EventArgs e) { List <string> fileList = new List <string>(); //foreach (CheckedListBoxItem boxItem in chkUpFileList.Items) //{ // if (boxItem.CheckState == CheckState.Checked) // { // fileList.Add(boxItem.Value.ToString()); // } //} //if (!string.IsNullOrEmpty(ApplicationConfiguration.multiPrintNames)) //{ // IEnumerator ie = ApplicationConfiguration.multiPrintNames.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).GetEnumerator(); // while (ie.MoveNext()) // { // fileList.Add(ie.Current.ToString()); // } //} //todo Dictionary <string, MedicalDocElement> docKeyValuePairs = MedicalDocSettings.GetMedicalDocNameAndPath(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docKeyValuePairs) { CheckedListBoxItem boxItemDocCheck = new CheckedListBoxItem(keyValuePair.Key, keyValuePair.Value.Key); chkDocCheckList.Items.Add(boxItemDocCheck); if (fileList.Contains(keyValuePair.Key)) { boxItemDocCheck.CheckState = CheckState.Checked; } } }
private void frm_KQ_PC_Load(object sender, EventArgs e) { grp_ChiTietCum.Visible = false; grp_TongHopTheoLop.Visible = false; grp_TongHopTheoLop.Visible = false; splitContainerControl2.Visible = false; txt_SoCum.Focus(); //lst_Subject.DataSource = frm_Main.path_src.dt_subject; Subjects.SUBJECT = new String[frm_Main.path_src.dt.Columns.Count]; Subjects.COU_SUBJECT = 0; foreach (DataColumn Col in frm_Main.path_src.dt.Columns) { Subjects.SUBJECT[Subjects.COU_SUBJECT] = Col.ColumnName; Subjects.COU_SUBJECT++; } for (int i = 0; i < Subjects.COU_SUBJECT; i++) { for (int j = 0; j < frm_Main.path_src.dt_subject.Rows.Count; j++) { DataRow dr_subject = frm_Main.path_src.dt_subject.Rows[j]; if (Subjects.SUBJECT[i] == dr_subject[1].ToString()) { CheckedListBoxItem item = new CheckedListBoxItem(); item.Description = dr_subject[0].ToString(); item.Value = dr_subject[1].ToString(); lst_Subject.Items.Add(item); } } } }
private void frm_PhanCumChiTiet_Load(object sender, EventArgs e) { txt_SoLanLap.Text = "0"; txt_KhoangCach.Visible = txt_Cum.Visible = txt_ChoVao.Visible = txt_ChoVao1.Visible = txt_DangXet.Visible = false; Subjects.SUBJECT = new String[frm_Main.path_src.dt.Columns.Count]; Subjects.COU_SUBJECT = 0; foreach (DataColumn Col in frm_Main.path_src.dt.Columns) { Subjects.SUBJECT[Subjects.COU_SUBJECT] = Col.ColumnName; Subjects.COU_SUBJECT++; } for (int i = 0; i < Subjects.COU_SUBJECT; i++) { for (int j = 0; j < frm_Main.path_src.dt_subject.Rows.Count; j++) { DataRow dr_subject = frm_Main.path_src.dt_subject.Rows[j]; if (Subjects.SUBJECT[i] == dr_subject[1].ToString()) { CheckedListBoxItem item = new CheckedListBoxItem(); item.Description = dr_subject[0].ToString(); item.Value = dr_subject[1].ToString(); lst_Subject.Items.Add(item); } } } }
protected override void BelgeDurumuYukle() { var enums = Enum.GetValues(typeof(BelgeDurumu)); foreach (BelgeDurumu entity in enums) { var item = new CheckedListBoxItem { CheckState = CheckState.Checked, Description = entity.ToName(), Value = entity }; if (entity == BelgeDurumu.AvukatYoluylaTahsilEtme || entity == BelgeDurumu.KismiAvukatYoluylaTahsilEtme || entity == BelgeDurumu.BlokeCozumu || entity == BelgeDurumu.MahsupEtme || entity == BelgeDurumu.OdenmisOlarakIsaretleme || entity == BelgeDurumu.TahsilEtmeKasa || entity == BelgeDurumu.TahsilEtmeBanka || entity == BelgeDurumu.BankaYoluylaTahsilEtme || entity == BelgeDurumu.KismiTahsilEdildi) { BelgeDurumlari.Properties.Items.Add(item); } } }
private void checkedListBoxControlEmrNode_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { try { var obj = checkedListBoxControlEmrNode.GetItem(e.Index); CheckedListBoxItem item = (CheckedListBoxItem)obj; if (null == item) { return; } if (item.CheckState == CheckState.Unchecked) { SetCheckAllStateUnEvent(false); } else { foreach (CheckedListBoxItem subItem in checkedListBoxControlEmrNode.Items) { if (subItem.CheckState == CheckState.Unchecked) { SetCheckAllStateUnEvent(false); return; } } SetCheckAllStateUnEvent(true); } } catch (Exception ex) { DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex); } }
void LoadBieuMau(Boolean showAll = true) { chkListBieuMau.Items.Clear(); string list = string.Empty; if (!showAll) { DataTable dt = FunctionHelper.LoadDM(string.Format("select * from SystemConfig where SystemConfig_Type= N'{0}'", loaiCauHinh.Type_Report.GetNameExtension())); for (int i = 0; i < dt.Rows.Count; i++) { list += dt.Rows[i]["SystemConfig_Parameter"] + string.Empty; } } foreach (LoaiBaoCao val in Enum.GetValues(typeof(LoaiBaoCao))) { if (list.Contains(val.GetNameExtension())) { continue; } CheckedListBoxItem item = new CheckedListBoxItem(); item.Description = val.GetDescriptionExtension(); item.Value = val.GetNameExtension(); chkListBieuMau.Items.Add(item); } }
public static void PopulateCheckedListBox <T, C>(CheckedComboBoxEdit checkedComboBoxEdit, T list, T selectedList) where T : ReadOnlyBindingListBase <T, C>, ILookupObjectList where C : ILookupObject { checkedComboBoxEdit.Properties.Items.BeginUpdate(); checkedComboBoxEdit.Properties.Items.Clear(); CheckedListBoxItem clb; string editValue = string.Empty; foreach (C element in list) { clb = new CheckedListBoxItem(element); checkedComboBoxEdit.Properties.Items.Add(clb); string selected = CheckSelected <T, C>(clb, selectedList, element); if (!string.IsNullOrEmpty(selected)) { if (!string.IsNullOrEmpty(editValue)) { editValue += ", "; } editValue += selected; } } checkedComboBoxEdit.EditValue = editValue; checkedComboBoxEdit.Properties.Items.EndUpdate(); }
/// <summary> /// CheckList_ItemCheck /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CheckList_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { if (Insetup) { return; } int i1 = e.Index; if (i1 < 0) { return; } Insetup = true; CheckedListBoxItem clbi = CheckList.Items[i1]; if (clbi.CheckState == CheckState.Checked) { SearchText.Text = clbi.Description; } else { SearchText.Text = ""; } SelectedItemText.Text = SelectedItemText.ToolTip = GetCheckedListItems(); Insetup = false; return; }
private void UpdateItems() { ++_updating; try { if (GetItems != null) { // Use the adapter if the check state event is not defined. GetObjectCheckStateDelegate getItemCheckState = GetItemCheckState; if (getItemCheckState == null) { getItemCheckState = new GetObjectCheckStateDelegate(AdaptGetItemCheckState); } SetObjectCheckStateDelegate setItemCheckState = SetItemCheckState; if (setItemCheckState == null) { setItemCheckState = new SetObjectCheckStateDelegate(AdaptSetItemCheckState); } // Recycle the collection of items. ArrayList newItems = new ArrayList(base.Items.Count); using (var recycleBin = new RecycleBin <CheckedListBoxItem>()) { foreach (CheckedListBoxItem item in base.Items) { recycleBin.AddObject(item); } // Extract each item from the recycle bin. foreach (object item in GetItems()) { newItems.Add(recycleBin.Extract( new CheckedListBoxItem(item, GetItemText, getItemCheckState, setItemCheckState))); } } // Replace the items in the control. base.BeginUpdate(); try { // Make sure the same tag is selected. CheckedListBoxItem selectedItem = (CheckedListBoxItem)base.SelectedItem; object selectedTag = selectedItem == null ? null : selectedItem.Tag; base.Items.Clear(); base.Items.AddRange(newItems.ToArray()); base.SelectedIndex = IndexOfTag(selectedTag); } finally { base.EndUpdate(); } } } finally { --_updating; } }
/// <summary>绑定checkboxlist /// </summary> /// <param name="dt">数据dt</param> /// <param name="lst">CheckedListBoxControl的checkboxlist</param> /// <param name="description">显示名</param> /// <param name="value">值</param> public static void BindCheckBoxList(DataTable dt, CheckedListBoxControl lst, string description, string value) { lst.Items.Clear(); foreach (DataRow dr in dt.Rows) { var checkedListBoxItem = new CheckedListBoxItem(dr[value], dr[description].ToString()); lst.Items.Add(checkedListBoxItem); } }
private void btnAllUnVisible_Click(object sender, EventArgs e) { this.bool_0 = true; for (int i = 0; i < this.checkedListBoxControl1.Items.Count; i++) { CheckedListBoxItem item = this.checkedListBoxControl1.Items[i]; item.CheckState = CheckState.Unchecked; } }
private void btnSelectAll_Click(object sender, EventArgs e) { for (int i = 0; i < this.checkedListBoxControl1.Items.Count; i++) { CheckedListBoxItem item = this.checkedListBoxControl1.Items[i]; item.CheckState = CheckState.Checked; } this.bool_1 = false; }
private void chkListBoxPermission_Init() { QuyenTruyCapItems = new CheckedListBoxItem[QuyentruycapList.Length]; for (int i = 0; i < QuyentruycapList.Length; i++) { QuyenTruyCapItems[i] = new CheckedListBoxItem(QuyentruycapList[i]); } chkListBoxPermission.Items.AddRange(QuyenTruyCapItems); }
public override bool Equals(object obj) { if (obj.GetType() != GetType()) { return(false); } CheckedListBoxItem that = (CheckedListBoxItem)obj; return(Object.Equals(_tag, that._tag)); }
public usrWeightRepetitionsReport() { InitializeComponent(); foreach (var value in Enum.GetValues(typeof(SetType))) { CheckedListBoxItem item = new CheckedListBoxItem(value, EnumLocalizer.Default.Translate((SetType)value), CheckState.Checked); cmbSetTypes.Properties.Items.Add(item); } }
private void loadDVBS() { dtDVBS = new DataTable(); dtDVBS = dvbus.loadDVBS(); for (int i = 0; i < dtDVBS.Rows.Count; i++) { CheckedListBoxItem item = new CheckedListBoxItem(dtDVBS.Rows[i][1].ToString(), false); checkedComboBoxEdit1.Properties.Items.Add(item); } }
private void FrmEditFault_Load(object sender, EventArgs e) { Dictionary <string, string> dic = this.PatternDic(); if (dic.Count != 0) { string[] strlist = new string[dic.Values.Count]; dic.Values.CopyTo(strlist, 0); this.checkedListBoxControl1.Items.AddRange(strlist); } if (this._dr != null) { string[] IdList = this._dr["Pattern"].ToString().Split(new char[] { ',' }); this.textEdit1.Text = this._dr["Id"].ToString(); this.textEdit2.Text = this._dr["Name"].ToString(); this.memoEdit1.Text = ((this._dr["PointMemo"] == null) ? "" : this._dr["PointMemo"].ToString()); this.checkEdit1.CheckState = ((this._dr["NormalIsBreak"].ToString() == "断路") ? CheckState.Checked : CheckState.Unchecked); this.labelControl5.Text = "故障点编辑"; this.textEdit1.Enabled = false; IEnumerator enumerator = this.checkedListBoxControl1.Items.GetEnumerator(); try { while (enumerator.MoveNext()) { CheckedListBoxItem item = (CheckedListBoxItem)enumerator.Current; if (IdList.Contains(item.Value.ToString())) { item.CheckState = CheckState.Checked; } } return; } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } string sql = "select max(id) from faultpoint where moduleid=" + ServerSystemInfo.SoftModuleId; DataTable dt = this.da.GetList(sql); if (dt != null && dt.Rows.Count != 0) { this.textEdit1.Text = (int.Parse(dt.Rows[0][0].ToString()) + 1).ToString(); } this.textEdit1.Enabled = false; this.labelControl5.Text = "增加故障点"; }
private void ucHangSX_Load(object sender, EventArgs e) { foreach (LoaiBaoCao val in Enum.GetValues(typeof(LoaiBaoCao))) { CheckedListBoxItem item = new CheckedListBoxItem(); item.Description = val.GetDescriptionExtension(); item.Value = val.GetNameExtension(); chkListBieuMau.Items.Add(item); } CommandData(); FormStatus = EnumFormStatus.VIEW; }
private void btnRestore_Click(object sender, EventArgs e) { this.bool_0 = true; for (int i = 0; i < this.checkedListBoxControl1.Items.Count; i++) { if (this.icadDrawingLayers_0.get_OriginalDrawingLayerVisible(i)) { CheckedListBoxItem item = this.checkedListBoxControl1.Items[i]; item.CheckState = CheckState.Checked; } } }
public void SetFaxNOsFromDb(DataTable dt) { for (int i = 0; i < dt.Rows.Count; ++i) { DataRow row = dt.Rows[i]; object code = row["FAXNO"]; CheckedListBoxItem item = new CheckedListBoxItem(code); chklistFaxNos.Items.Add(item); } PopulateDropDown(cboStart); PopulateDropDown(cboEnd); LoadInitialValues(); }
private void initcheckbox(string modu_id) { IList<mModulFun> li = MainHelper.PlatformSqlMap.GetList<mModulFun>("SelectmModulFunList", " where Modu_ID='" + modu_id + "'"); foreach (mModulFun mf in li) { CheckedListBoxItem item = new CheckedListBoxItem(); item.Description = mf.FunName; item.Value = mf.FunID; rRoleFun md = (rRoleFun)MainHelper.PlatformSqlMap.GetObject("SelectrRoleFunList", " where FunID='" + mf.FunID + "' and RoleID='" + mRoleID + "'"); if (md != null) { item.CheckState = CheckState.Checked; } else { item.CheckState = CheckState.Unchecked; } checkedListBoxControl1.Items.Add(item); } }
private void InitializeControlsValue() { DataSet ds = FilterUtil.GetCommoditListFromDb(); if (ds != null) { DataTable dt = ds.Tables[0]; for (int i = 0; i < dt.Rows.Count; ++i) { DataRow row = dt.Rows[i]; object code = row["Code"]; CheckedListBoxItem item = new CheckedListBoxItem(code); cdtyList.Items.Add(item); } } PopulateDropDown(cboStart); PopulateDropDown(cboEnd); LoadInitialValues(); }
public static RepositoryItemCheckedComboBoxEdit AddTuyBienCot(BarManager barManager, Bar menuBar, PivotGridField[] choseFields, bool[] defaultCheck) { var repositoryItemCheckedCotHienThi = new RepositoryItemCheckedComboBoxEdit { AutoHeight = false, BestFitWidth = 180, Name = "repositoryItemCheckedCotHienThi" }; // // repositoryItemCheckedCotHienThi // // var barEditItemCotHienThi = new BarEditItem { Caption = "&Cột hiển thị", Edit = repositoryItemCheckedCotHienThi, Name = "barEditItemHienThi", PaintStyle = BarItemPaintStyle.CaptionGlyph, Width = 200 }; // // barEditItemCotHienThi // // barManager.Items.Add(barEditItemCotHienThi); barManager.RepositoryItems.AddRange(new RepositoryItem[] { repositoryItemCheckedCotHienThi }); // menuBar.LinksPersistInfo.Add(new LinkPersistInfo(barEditItemCotHienThi, true)); //Gán các cột vào CheckedComboBox // choseFields = choseFields.OrderBy(f => f.Caption).ToArray(); var checkedListItems = new CheckedListBoxItem[choseFields.Length]; for (int i = 0; i < choseFields.Length; i++) { PivotGridField field = choseFields[i]; var ischeck = defaultCheck[i]; var item = new CheckedListBoxItem(field, field.Caption, ischeck ? CheckState.Checked : CheckState.Unchecked); checkedListItems[i] = item; } var list = checkedListItems.OrderBy(c => c.Description); repositoryItemCheckedCotHienThi.Items.AddRange(list.ToArray()); var checkedItems = list.Where(l => l.CheckState == CheckState.Checked); var text = checkedItems.Aggregate("", (current, item) => current + (" " + item.Description + repositoryItemCheckedCotHienThi.SeparatorChar)); repositoryItemCheckedCotHienThi.SynchronizeEditValueWithCheckedItems = false; barEditItemCotHienThi.Hint = text.TrimEnd(repositoryItemCheckedCotHienThi.SeparatorChar); barEditItemCotHienThi.EditValue = barEditItemCotHienThi.Hint; //------------------------------- // repositoryItemCheckedCotHienThi.CloseUp += delegate(object sender, CloseUpEventArgs e) { var value = new StringBuilder(); foreach ( CheckedListBoxItem item in (sender as CheckedComboBoxEdit).Properties.Items) { if (item.CheckState == CheckState.Checked) { value.Append(" " + item.Description + (sender as CheckedComboBoxEdit). Properties.SeparatorChar. ToString()); ((PivotGridField)item.Value).Visible = true; } else { ((PivotGridField)item.Value).Visible = false; } } var description = value.Length > 0 ? value.ToString().Remove(value.Length - 1) : string.Empty; e.Value = text; barEditItemCotHienThi.Hint = description; }; //Set các cột hiển thị mặc định //if (choseFields != null) //{ // List<string> listDefaultField = new List<string>(choseFields); // StringBuilder displayText = new StringBuilder(); // for (int i = 0; i < repositoryItemCheckedCotHienThi.Items.Count; i++) // { // if (listDefaultField.Contains(repositoryItemCheckedCotHienThi.Items[i].Value.ToString())) // { // repositoryItemCheckedCotHienThi.Items[i].CheckState = CheckState.Checked; // displayText.Append(" " + repositoryItemCheckedCotHienThi.Items[i].Description + repositoryItemCheckedCotHienThi.SeparatorChar.ToString()); // } // } // if (displayText.ToString() != string.Empty) // barEditItemCotHienThi.EditValue = displayText.ToString().Remove(displayText.Length - 1); // repositoryItemCheckedCotHienThi.SynchronizeEditValueWithCheckedItems = false; // DisplayTheoTuyBienCot(gridView, repositoryItemCheckedCotHienThi); //} return repositoryItemCheckedCotHienThi; }
public void Preview() { Save(); var tabPages = xtraTabControlPublications.TabPages.Where(tabPage => tabPage.PageEnabled).OfType<IBasicOverviewOutputControl>(); var selectedProducts = new List<IBasicOverviewOutputControl>(); if (tabPages.Count() > 1) using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as IBasicOverviewOutputControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.SlideName); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) form.buttonXSelectCurrent.Tag = item; } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<IBasicOverviewOutputControl>()); } else selectedProducts.AddRange(tabPages); if (!selectedProducts.Any()) return; var previewGroups = new List<PreviewGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Preview..."); FormProgress.ShowProgress(); foreach (var productControl in selectedProducts) { var previewGroup = productControl.GetPreviewGroup(); if (productControl is PublicationBasicOverviewControl) AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewEmail(previewGroup.PresentationSourcePath, new[] { (PublicationBasicOverviewControl)productControl }); else if (productControl is BasicOverviewSummaryControl) { var summaryControl = productControl as BasicOverviewSummaryControl; summaryControl.PopulateReplacementsList(); AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewSummaryEmail(previewGroup.PresentationSourcePath, summaryControl); } previewGroups.Add(previewGroup); } Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) return; var trackAction = new Action(() => TrackOutput(selectedProducts.OfType<PublicationBasicOverviewControl>())); using (var formPreview = new FormPreview(Controller.Instance.FormMain, AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager, Controller.Instance.ShowFloater, trackAction)) { formPreview.Text = "Preview Basic Overview"; formPreview.LoadGroups(previewGroups); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; if (previewResult != DialogResult.OK) Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); } }
public void PrintPdf() { Save(); var tabPages = xtraTabControlPublications.TabPages.Where(tabPage => tabPage.PageEnabled).OfType<IBasicOverviewOutputControl>(); var selectedProducts = new List<IBasicOverviewOutputControl>(); if (tabPages.Count() > 1) using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as IBasicOverviewOutputControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.SlideName); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) form.buttonXSelectCurrent.Tag = item; } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<IBasicOverviewOutputControl>()); } else selectedProducts.AddRange(tabPages); if (!selectedProducts.Any()) return; TrackOutput(selectedProducts.OfType<PublicationBasicOverviewControl>()); FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!"); Controller.Instance.ShowFloater(() => { FormProgress.ShowProgress(); var previewGroups = new List<PreviewGroup>(); previewGroups.AddRange(selectedProducts.Select(productControl => { var previewGroup = productControl.GetPreviewGroup(); if (productControl is PublicationBasicOverviewControl) AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewEmail(previewGroup.PresentationSourcePath, new[] { (PublicationBasicOverviewControl)productControl }); else if (productControl is BasicOverviewSummaryControl) { var summaryControl = productControl as BasicOverviewSummaryControl; summaryControl.PopulateReplacementsList(); AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewSummaryEmail(previewGroup.PresentationSourcePath, summaryControl); } return previewGroup; })); var pdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), String.Format("{0}-{1}.pdf", LocalSchedule.Name, DateTime.Now.ToString("MM-dd-yy-hmmss"))); AdSchedulePowerPointHelper.Instance.BuildPdf(pdfFileName, previewGroups.Select(pg => pg.PresentationSourcePath)); if (File.Exists(pdfFileName)) try { Process.Start(pdfFileName); } catch { } FormProgress.CloseProgress(); }); }
/// <summary> /// load combo box with available items to select. /// </summary> private void PopulateCheckComboBox() { var availableItems = (IEnumerable)MemberInfo.GetValue(CurrentObject); comboControl.Properties.Items.BeginUpdate(); foreach (IXPSimpleObject o in availableItems) { var newItem = new CheckedListBoxItem(o, false); comboControl.Properties.Items.Add(newItem); } comboControl.Properties.Items.EndUpdate(); }
private void chkListBoxPermission_Init() { QuyenTruyCapItems = new CheckedListBoxItem[QuyentruycapList.Length]; for (int i = 0; i < QuyentruycapList.Length; i++) { QuyenTruyCapItems[i] = new CheckedListBoxItem(QuyentruycapList[i]); } chkListBoxPermission.Items.AddRange(QuyenTruyCapItems); }
public IList<IDashboardSlide> GetOutputSlides() { var selectedSlides = new List<IDashboardSlide>(); using (var form = new FormSelectOutputItems()) { form.Text = "Slide Output Options"; foreach (var slideControl in _slides.Where(s => s.ReadyForOutput).OfType<IDashboardSlide>()) { var item = new CheckedListBoxItem(slideControl, slideControl.SlideName, ActiveSlide.SlideType == SlideType.Cleanslate || slideControl == ActiveSlide ? CheckState.Checked : CheckState.Unchecked); form.checkedListBoxControlOutputItems.Items.Add(item); if (slideControl == ActiveSlide) form.buttonXSelectCurrent.Tag = item; } if (form.ShowDialog() == DialogResult.OK) selectedSlides.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<IDashboardSlide>()); } return selectedSlides; }
public void PrintOutput() { var tabPages = _tabPages; var selectedProducts = new List<PublicationDetailedGridControl>(); if (tabPages.Count() > 1) using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as PublicationDetailedGridControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.PrintProduct.Name); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) form.buttonXSelectCurrent.Tag = item; } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<PublicationDetailedGridControl>()); } else selectedProducts.AddRange(tabPages); if (!selectedProducts.Any()) return; TrackOutput(selectedProducts); FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!"); Controller.Instance.ShowFloater(() => { foreach (var product in selectedProducts) product.PrintOutput(); FormProgress.CloseProgress(); }); }
public void PrintPdf() { var tabPages = _tabPages; var selectedProducts = new List<PublicationDetailedGridControl>(); if (tabPages.Count() > 1) using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as PublicationDetailedGridControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.PrintProduct.Name); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) form.buttonXSelectCurrent.Tag = item; } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<PublicationDetailedGridControl>()); } else selectedProducts.AddRange(tabPages); if (!selectedProducts.Any()) return; TrackOutput(selectedProducts); FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!"); Controller.Instance.ShowFloater(() => { FormProgress.ShowProgress(); foreach (var product in selectedProducts) product.PrepareOutput(); var pdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), String.Format("{0}-{1}.pdf", LocalSchedule.Name, DateTime.Now.ToString("MM-dd-yy-hmmss"))); AdSchedulePowerPointHelper.Instance.PrepareDetailedGridGridBasedPdf(pdfFileName, selectedProducts.ToArray()); if (File.Exists(pdfFileName)) try { Process.Start(pdfFileName); } catch { } FormProgress.CloseProgress(); }); }
public void Preview() { var tabPages = _tabPages; var selectedProducts = new List<PublicationDetailedGridControl>(); if (tabPages.Count() > 1) using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as PublicationDetailedGridControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.PrintProduct.Name); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) form.buttonXSelectCurrent.Tag = item; } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<PublicationDetailedGridControl>()); } else selectedProducts.AddRange(tabPages); if (!selectedProducts.Any()) return; var tempFileName = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Preview..."); FormProgress.ShowProgress(); foreach (var product in selectedProducts) product.PrepareOutput(); AdSchedulePowerPointHelper.Instance.PrepareDetailedGridGridBasedEmail(tempFileName, selectedProducts.ToArray()); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); FormProgress.CloseProgress(); if (!File.Exists(tempFileName)) return; var trackAction = new Action(() => TrackOutput(selectedProducts)); using (var formPreview = new FormPreview(Controller.Instance.FormMain, AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager, Controller.Instance.ShowFloater, trackAction)) { formPreview.Text = "Preview Detailed Advertising Grid"; formPreview.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; if (previewResult != DialogResult.OK) Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); } }