public void HienThiComboBox(String namHoc, String lop, ComboBoxEx comboBox)
 {
     MonHocData m_MHData = new MonHocData();
        comboBox.DataSource = m_MHData.LayDsMonHoc(namHoc, lop);
        comboBox.DisplayMember = "TenMonHoc";
        comboBox.ValueMember = "MaMonHoc";
 }
 private void InitializeContentCombobox(ComboBoxEx cbo)
 {
     // Load unit
     var defines = _defineRepository.GetContentUnit();
     defines.Insert(0, new Define() { Id = 0, Name = "" });
     cbo.DataSource = defines;
 }
 public void HienThiComboBoxMaHS(String namHoc, String lop, ComboBoxEx comboBox)
 {
     HocSinhData m_HSData = new HocSinhData();
        comboBox.DataSource = m_HSData.LayDsHocSinhTheoLop(namHoc, lop);
        comboBox.DisplayMember = "MaHocSinh";
        comboBox.ValueMember = "MaHocSinh";
 }
 public static void CrossThreadInvoke(ComboBoxEx t, MethodInvoker m)
 {
     if (t.InvokeRequired)
     {
         t.Invoke(m);
     }
 }
        public void HienThi(DataGridViewX dGV,
            BindingNavigator bN,
            TextBoxX txtSTT,
            ComboBoxEx cmbNamHoc,
            ComboBoxEx cmbLop,
            ComboBoxEx cmbMonHoc,
            ComboBoxEx cmbGiaoVien)
        {
            BindingSource bS = new BindingSource();
               bS.DataSource = m_PhanCongData.LayDsPhanCong();

               txtSTT.DataBindings.Clear();
               txtSTT.DataBindings.Add("Text", bS, "STT");

               cmbNamHoc.DataBindings.Clear();
               cmbNamHoc.DataBindings.Add("SelectedValue", bS, "MaNamHoc");

               cmbLop.DataBindings.Clear();
               cmbLop.DataBindings.Add("SelectedValue", bS, "MaLop");

               cmbMonHoc.DataBindings.Clear();
               cmbMonHoc.DataBindings.Add("SelectedValue", bS, "MaMonHoc");

               cmbGiaoVien.DataBindings.Clear();
               cmbGiaoVien.DataBindings.Add("SelectedValue", bS, "MaGiaoVien");

               bN.BindingSource = bS;
               dGV.DataSource = bS;
        }
 private void InitializeComponent()
 {
     ComponentResourceManager manager = new ComponentResourceManager(typeof(AutoRefreshOptionControl));
     PropertyValue value2 = new PropertyValue();
     this.lblSlowVolumeAutoRefresh = new Label();
     this.cmbSlowVolumeAutoRefresh = new ComboBoxEx();
     this.ValuesWatcher = new PropertyValuesWatcher();
     TableLayoutPanel panel = new TableLayoutPanel();
     panel.SuspendLayout();
     ((ISupportInitialize) this.ValuesWatcher).BeginInit();
     base.SuspendLayout();
     manager.ApplyResources(panel, "tlpBack");
     panel.Controls.Add(this.lblSlowVolumeAutoRefresh, 0, 0);
     panel.Controls.Add(this.cmbSlowVolumeAutoRefresh, 1, 0);
     panel.Name = "tlpBack";
     manager.ApplyResources(this.lblSlowVolumeAutoRefresh, "lblSlowVolumeAutoRefresh");
     this.lblSlowVolumeAutoRefresh.Name = "lblSlowVolumeAutoRefresh";
     manager.ApplyResources(this.cmbSlowVolumeAutoRefresh, "cmbSlowVolumeAutoRefresh");
     this.cmbSlowVolumeAutoRefresh.DropDownStyle = ComboBoxStyle.DropDownList;
     this.cmbSlowVolumeAutoRefresh.FormattingEnabled = true;
     this.cmbSlowVolumeAutoRefresh.MinimumSize = new Size(110, 0);
     this.cmbSlowVolumeAutoRefresh.Name = "cmbSlowVolumeAutoRefresh";
     value2.DataObject = this.cmbSlowVolumeAutoRefresh;
     value2.PropertyName = "SelectedIndex";
     this.ValuesWatcher.Items.AddRange(new PropertyValue[] { value2 });
     manager.ApplyResources(this, "$this");
     base.AutoScaleMode = AutoScaleMode.Font;
     base.Controls.Add(panel);
     base.Name = "AutoRefreshOptionControl";
     panel.ResumeLayout(false);
     panel.PerformLayout();
     ((ISupportInitialize) this.ValuesWatcher).EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public DataGridViewComboBoxExColumn()
        {            
            CellTemplate = new DataGridViewComboBoxExCell();            

            _ComboBoxEx = new ComboBoxEx();
            _ComboBoxEx.Col1Width = this.Col1Width;
            _ComboBoxEx.Col2Width = this.Col2Width;
            _ComboBoxEx.Col3Width = this.Col3Width;

            _ComboBoxEx.RenderBorder = false;
            _ComboBoxEx.Visible = false;

            HookEvents(true);
        }
        /// <summary>
        /// ComboBox 用
        /// </summary>
        /// <param name="strValue"></param>
        /// <param name="obj"></param>
        /// <param name="logObjName"></param>
        /// <returns></returns>
        public ComboBoxEx SetFormData(string strValue, ComboBoxEx obj, string logObjName)
        {
            if (string.IsNullOrEmpty(strValue))
            {
                obj.Text = "";
                _prlp.SetBeforeSaveText(logObjName, "");
            }
            else
            {
                obj.Text = strValue;
                _prlp.SetBeforeSaveText(logObjName, strValue);
            }

            return obj;
        }
        /// <summary>
        /// 创建人:唐春奎
        /// 用于三级联动绑定省份数据的方法
        /// </summary>
        /// <param name="ControlName"></param>
        /// <param name="typename"></param>
        public static void BindProviceComBox(ComboBoxEx ControlName, string typename)
        {
            List<ListItem> list = new List<ListItem>();
            list.Add(new ListItem("", typename));
            string sqlWhere = " AREA_LEVEL=0 ";
            DataTable dt_Provice = DBHelper.GetTable("查询区域表省份信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "AREA_CODE,AREA_NAME", sqlWhere, "", " order by AREA_CODE ");
            if (dt_Provice != null && dt_Provice.Rows.Count > 0)
            {
                foreach (DataRow dr in dt_Provice.Rows)
                {
                    list.Add(new ListItem(dr["AREA_CODE"].ToString(), dr["AREA_NAME"].ToString()));
                }
            }
            ControlName.DisplayMember = "Text";
            ControlName.ValueMember = "Value";
            ControlName.DataSource = list;

        }
Exemple #10
0
        /// <summary>
        /// 创建人:唐春奎
        /// 从字典码表中获取信息,绑定ComboBox下拉框
        /// </summary>
        /// <param name="ControlName"></param>
        /// <param name="dic_code"></param>
        /// <param name="typename"></param>
        public static void BindComBoxDataSource(ComboBoxEx ControlName, string dic_code, string typename)
        {
            List <ListItem> list = new List <ListItem>();

            list.Add(new ListItem("", typename));
            string    sqlWhere = " parent_id in (select dic_id from sys_dictionaries where dic_code='" + dic_code + "' and enable_flag=1)";
            DataTable dt_dic   = DBHelper.GetTable("查询字典码表信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_dictionaries", "dic_id,dic_name", sqlWhere, "", " order by dic_code ");

            if (dt_dic != null && dt_dic.Rows.Count > 0)
            {
                foreach (DataRow dr in dt_dic.Rows)
                {
                    list.Add(new ListItem(dr["dic_id"], dr["dic_name"].ToString()));
                }
            }
            ControlName.DisplayMember = "Text";
            ControlName.ValueMember   = "Value";
            ControlName.DataSource    = list;
        }
Exemple #11
0
        /// <summary>
        /// 创建人:唐春奎
        /// 用于三级联动绑定省份数据的方法
        /// </summary>
        /// <param name="ControlName"></param>
        /// <param name="typename"></param>
        public static void BindProviceComBox(ComboBoxEx ControlName, string typename)
        {
            List <ListItem> list = new List <ListItem>();

            list.Add(new ListItem("", typename));
            string    sqlWhere   = " AREA_LEVEL=0 ";
            DataTable dt_Provice = DBHelper.GetTable("查询区域表省份信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "AREA_CODE,AREA_NAME", sqlWhere, "", " order by AREA_CODE ");

            if (dt_Provice != null && dt_Provice.Rows.Count > 0)
            {
                foreach (DataRow dr in dt_Provice.Rows)
                {
                    list.Add(new ListItem(dr["AREA_CODE"].ToString(), dr["AREA_NAME"].ToString()));
                }
            }
            ControlName.DisplayMember = "Text";
            ControlName.ValueMember   = "Value";
            ControlName.DataSource    = list;
        }
Exemple #12
0
        public static void SetCombox(ComboBoxEx _control)
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select EmpId,EmpName from tb_empinfo where Active= 1";

            ds = dbl.GetDatasetReport(sql, "tb_EmpInfo");
            List <string> listArr = new List <string>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    _control.DataSource    = ds.Tables[0];
                    _control.DisplayMember = "EmpName";
                    _control.ValueMember   = "EmpId";
                }
            }
        }
Exemple #13
0
        public static void SetGrpCombox(ComboBoxEx _control)
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select GroupId,Name from BaseGroup where isstop =  0 order by GroupId";

            ds = dbl.GetDatasetReport(sql, "BaseGroup");
            List <string> listArr = new List <string>();

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    _control.DataSource    = ds.Tables[0];
                    _control.DisplayMember = "Name";
                    _control.ValueMember   = "GroupId";
                }
            }
        }
Exemple #14
0
        /*
         * public void HienThi(DataGridViewX dGV,
         *                  BindingNavigator bN,
         *                  ComboBoxEx cmbMaCanHoDK
         *                  )
         * {
         *  BindingSource bS = new BindingSource();
         *  bS.DataSource = m_CanHoData.LayDsCanHo();
         *
         *  DataTable dT = m_CanHoData.LayDsCanHo();
         *
         *  cmbMaCanHoDK.DataBindings.Clear();
         *  cmbMaCanHoDK.DataBindings.Add("SelectedValue", bS, "MaCanHo");
         *
         *  bN.BindingSource = bS;
         *  dGV.DataSource = bS;
         * }
         */

        public void TimKiemCanHo(TextBoxX txtMaCanHo,
                                 ComboBoxEx cmbTheoTenNguoiDan,
                                 TextBoxX txtTenNguoiDan,
                                 ComboBoxEx cmbTheoDichVu,
                                 ComboBoxEx cmbMaDichVu,
                                 ComboBoxEx cmbMaCanHoDK,
                                 DataGridViewX dGV,
                                 BindingNavigator bN)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_CanHoData.TimKiemCanHo(txtMaCanHo.Text, cmbTheoTenNguoiDan.Text, txtTenNguoiDan.Text, cmbTheoDichVu.Text, cmbMaDichVu.Text);

            cmbMaCanHoDK.DataBindings.Clear();
            cmbMaCanHoDK.DataBindings.Add("SelectedValue", bS, "MaCanHo");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Exemple #15
0
        /// <summary>
        /// 创建人:孙亚楠
        /// 从角色表中获取角色信息,绑定ComboBox下拉框
        /// </summary>
        /// <param name="ControlName"></param>
        /// <param name="role_id"></param>
        /// <param name="role_ame"></param>
        public static void BindRoleComBox(ComboBoxEx ControlName, string role_id, string role_ame)
        {
            List <ListItem> list = new List <ListItem>();

            list.Add(new ListItem("", role_ame));
            string    sqlWhere = "state='1' and enable_flag='1'";
            DataTable dt_dic   = DBHelper.GetTable("查询字典码表信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_role", "role_id,role_name", sqlWhere, "", " order by role_code ");

            if (dt_dic != null && dt_dic.Rows.Count > 0)
            {
                foreach (DataRow dr in dt_dic.Rows)
                {
                    list.Add(new ListItem(dr["role_id"], dr["role_name"].ToString()));
                }
            }
            ControlName.DisplayMember = "Text";
            ControlName.ValueMember   = "Value";
            ControlName.DataSource    = list;
        }
Exemple #16
0
        public static void SetCombox(string _class, ComboBoxEx _control)
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select FBaseID,FBaseName from tb_base where FClass =  '" + _class + "' order by FBaseID";

            ds = dbl.GetDatasetReport(sql, "tb_base");
            List <string> listArr = new List <string>();

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    _control.DataSource    = ds.Tables[0];
                    _control.DisplayMember = "FBaseName";
                    _control.ValueMember   = "FBaseID";
                }
            }
        }
        /// <summary>
        /// 初始化波特率下拉框
        /// </summary>
        /// <param name="cmb"></param>
        private void InitBandrateComboBox(ComboBoxEx cmb)
        {
            cmb.Items.Clear();

            cmb.DisplayMember = "Text";
            cmb.ValueMember   = "Value";

            cmb.Items.Add(new DataItem("1200"));
            cmb.Items.Add(new DataItem("4800"));
            cmb.Items.Add(new DataItem("9600"));
            cmb.Items.Add(new DataItem("14400"));
            cmb.Items.Add(new DataItem("19200"));
            cmb.Items.Add(new DataItem("38400"));
            cmb.Items.Add(new DataItem("56000"));
            cmb.Items.Add(new DataItem("57600"));
            cmb.Items.Add(new DataItem("115200"));

            cmb.SelectedIndex = 0;
        }
        /// <summary>
        /// This routine handles "LastName" related edit changes.
        /// </summary>
        /// <param name="e"></param>
        private void LastNameEditValueChanged(GridFilterEditValueChangedEventArgs e)
        {
            ComboBoxEx cb = e.FilterPanel.Control as ComboBoxEx;

            if (cb != null)
            {
                // We only want to handle selections for our
                // items, so make sure it is one of our items.

                MyItem item = cb.SelectedItem as MyItem;

                if (item != null)
                {
                    string s = ((string)e.NewValue).Replace("to", "and");

                    e.NewExpr = "LastName between " + s;
                }
            }
        }
        public ServerExplorerCtrl()
        {
            m_CubeBrowser = new CubeBrowserCtrl();

            Grid LayoutRoot = new Grid();

            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition());

            var cubesComboHeader = new HeaderControl(UriResources.Images.Cube16, Localization.MdxDesigner_Cube)
            {
                Margin = new Thickness(0, 0, 0, 3)
            };

            Cubes_ComboBox = new ComboBoxEx();
            Cubes_ComboBox.SelectionChanged += new SelectionChangedEventHandler(Cubes_ComboBox_SelectionChanged);
            Cubes_ComboBox.Height            = 22;
            Cubes_ComboBox.Margin            = new Thickness(0, 0, 0, 5);

            LayoutRoot.Children.Add(cubesComboHeader);
            LayoutRoot.Children.Add(Cubes_ComboBox);
            Grid.SetRow(Cubes_ComboBox, 1);
            LayoutRoot.Children.Add(m_CubeBrowser);
            Grid.SetRow(m_CubeBrowser, 2);

            base.Content = LayoutRoot;

            m_OlapDataLoader = GetOlapDataLoader();

            m_CubeBrowser.OlapDataLoader = GetOlapDataLoader();

            m_CubeBrowser.SelectedItemChanged += new EventHandler <ItemEventArgs>(m_CubeBrowser_SelectedItemChanged);

            Cubes_ComboBox.IsEnabled = false;
            m_CubeBrowser.IsEnabled  = false;
        }
Exemple #20
0
        //
        public bool CheckInput(TextBoxX tendaily, ComboBoxEx cmbxa, TextBoxX diachi)
        {
            if (tendaily.Text == "")
            {
                MessageBox.Show("Chưa nhập tên đại lý !", "Chú ý", MessageBoxButtons.OK);
                tendaily.Focus();
                return(false);
            }
            else
            {
                if (tendaily.Text.Length > 50)
                {
                    MessageBox.Show("Nhập tên đại lý không quá 50 ký tự !", "Chú ý", MessageBoxButtons.OK);
                    tendaily.Focus();
                    return(false);
                }
            }

            if (cmbxa.SelectedIndex < 0)
            {
                cmbxa.Focus();
                MessageBox.Show("Chưa chọn Xã !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (diachi.Text == "")
            {
                MessageBox.Show("Chưa nhập địa chỉ !", "Chú ý", MessageBoxButtons.OK);
                diachi.Focus();
                return(false);
            }
            else
            {
                if (diachi.Text.Length > 200)
                {
                    MessageBox.Show("Nhập địa chỉ không quá 200 ký tự ", "Chú ý", MessageBoxButtons.OK);
                    diachi.Focus();
                    return(false);
                }
                return(true);
            }
        }
Exemple #21
0
        public void HienThi(DataGridViewX dGV,
                            TextBoxX txtMaLop,
                            TextBoxX txtTenLop,
                            ComboBoxEx cmbKhoiLop,
                            ComboBoxEx cmbNamHoc,
                            IntegerInput iniSiSo,
                            ComboBoxEx cmbGiaoVien)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_LopData.LayDsLop();

            dGV.DataSource = bS;

            txtMaLop.DataBindings.Clear();


            txtMaLop.DataBindings.Add("Text", bS, "MaLop");

            txtTenLop.DataBindings.Clear();

            txtTenLop.DataBindings.Add("Text", bS, "TenLop");

            cmbKhoiLop.DataBindings.Clear();

            cmbKhoiLop.DataBindings.Add("SelectedValue", bS, "MaKhoiLop");


            cmbNamHoc.DataBindings.Clear();

            cmbNamHoc.DataBindings.Add("SelectedValue", bS, "MaNamHoc");

            iniSiSo.DataBindings.Clear();


            iniSiSo.DataBindings.Add("Text", bS, "SiSo");

            cmbGiaoVien.DataBindings.Clear();


            cmbGiaoVien.DataBindings.Add("SelectedValue", bS, "MaGiaoVien");
        }
//         public static OutputForm aa;
//
//         public GetDataFromDatabase(OutputForm bb)
//         {
//             aa = bb;
//         }


        public static bool SetCustomerData(ComboBoxEx CusComboBox)
        {
            try
            {
                //IList<Sys_Customer> customerName = session.QueryOver<Sys_Customer>().List<Sys_Customer>();
                IList <Sys_Customer> customerName = new List <Sys_Customer>();
                CaxSQL.GetListCustomer(out customerName);
                CusComboBox.DisplayMember = "customerName";
                //CusComboBox.ValueMember = "customerSrNo";
                foreach (Sys_Customer i in customerName)
                {
                    CusComboBox.Items.Add(i);
                }
            }
            catch (System.Exception ex)
            {
                return(false);
            }
            return(true);
        }
Exemple #23
0
        private void ComboBoxEx_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBoxEx comboBox = sender as ComboBoxEx;

            if (comboBox != null && comboBox.Items.Count > 0)
            {
                if (comboBox.SelectedItem as AscmMaterialItem != null)
                {
                    comboBox.Text = ((AscmMaterialItem)comboBox.SelectedItem).docNumber;
                }
                else if (comboBox.SelectedItem as AscmMarkTaskLog != null)
                {
                    comboBox.Text = ((AscmMarkTaskLog)comboBox.SelectedItem).id.ToString();
                }
                else if (comboBox.SelectedItem as AscmWarehouse != null)
                {
                    comboBox.Text = ((AscmWarehouse)comboBox.SelectedItem).id;
                }
            }
        }
        public static string GetExamId(ComboBoxEx ctl)
        {
            if (ctl.InvokeRequired)
            {
                return(ctl.Invoke(new Func <ComboBoxEx, string>(GetExamId), ctl).ToString());
            }
            else
            {
                JHExamRecord jh = (ctl.SelectedItem as JHExamRecord);

                if (jh == null)
                {
                    return("");
                }
                else
                {
                    return(jh.ID);
                }
            }
        }
Exemple #25
0
 /// <summary>
 /// 参数保存到INI
 /// </summary>
 /// <param name="ctrl"></param>
 public void SetInfo(Control ctrl)
 {
     foreach (Control c in ctrl.Controls)
     {
         if (c.HasChildren)
         {
             SetInfo(c);
         }
         if (c is TextBox)
         {
             TextBox txt = c as TextBox;
             DisposeINIW(txt.Name, txt.Text);
         }
         if (c is ComboBoxEx) // 控件
         {
             ComboBoxEx cb = c as ComboBoxEx;
             DisposeINIW(cb.Name, cb.Text);
         }
     }
 }
 /// <summary>
 /// 创建人:唐春奎
 /// 用于三级联动绑定城市数据的方法
 /// </summary>
 /// <param name="ControlName"></param>
 /// <param name="ProviceID"></param>
 /// <param name="typename"></param>
 public static void BindCityComBox(ComboBoxEx ControlName, string ProviceID, string typename)
 {
     List<ListItem> list = new List<ListItem>();
     list.Add(new ListItem("", typename));
     if (!string.IsNullOrEmpty(ProviceID))
     {
         string sqlWhere = " PARENT_CODE=" + ProviceID + "";
         DataTable dt_City = DBHelper.GetTable("查询区域表城市信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "AREA_CODE,AREA_NAME", sqlWhere, "", " order by AREA_CODE ");
         if (dt_City != null && dt_City.Rows.Count > 0)
         {
             foreach (DataRow dr in dt_City.Rows)
             {
                 list.Add(new ListItem(dr["AREA_CODE"].ToString(), dr["AREA_NAME"].ToString()));
             }
         }
     }
     ControlName.DisplayMember = "Text";
     ControlName.ValueMember = "Value";
     ControlName.DataSource = list;
 }
Exemple #27
0
 //清空查询
 private void btnClear_Click(object sender, EventArgs e)
 {
     foreach (Control ctr in pnlSearch.Controls)
     {
         if (ctr is TextBoxEx)
         {
             TextBoxEx txt = (TextBoxEx)ctr;
             txt.Caption = string.Empty;
         }
         else if (ctr is ComboBoxEx)
         {
             ComboBoxEx cbo = (ComboBoxEx)ctr;
             if (cbo.Items.Count > 0)
             {
                 cbo.SelectedIndex = 0;
             }
             else
             {
                 cbo.SelectedItem = null;
             }
         }
         else if (ctr is TextChooser)
         {
             TextChooser txtc = (TextChooser)ctr;
             txtc.Text = string.Empty;
             txtc.Tag  = null;
         }
         else if (ctr is CheckBox)
         {
             CheckBox cb = (CheckBox)ctr;
             cb.Checked = false;
         }
         else if (ctr is DateInterval)
         {
             DateInterval di = (DateInterval)ctr;
             di.Empty();
             di.StartDate = DateTime.Now.ToString("yyyy-MM-01");
             di.EndDate   = DateTime.Now.ToString("yyyy-MM-dd");
         }
     }
 }
        /// <summary>
        /// Examine every TextBox & ComboBox that the user could have entered data
        /// into and store this information in the module-level mRespInfoArray object.
        /// </summary>
        private void SaveUserInput()
        {
            foreach (Control ctrl in panelTopics.Contents.Controls)
            {
                bool   possValToSave = true;
                string propName;
                string newval = null;
                int    idx    = -1;

                if (ctrl.GetType().Name == "TextBoxEx")
                {
                    TextBoxEx textBox = ctrl as TextBoxEx;
                    propName = (textBox.Tag as RespondentInfo).PropName;
                    idx      = (textBox.Tag as RespondentInfo).Index;
                    newval   = textBox.Text;
                }
                else if (ctrl.GetType().Name == "ComboBoxEx")
                {
                    ComboBoxEx comboBox = ctrl as ComboBoxEx;
                    propName = (comboBox.Tag as RespondentInfo).PropName;
                    idx      = (comboBox.Tag as RespondentInfo).Index;
                    newval   = comboBox.Text;
                }
                else
                {
                    // A label, so just ignore
                    possValToSave = false;
                }

                if (possValToSave)
                {
                    // See if we have a new value to store
                    string oldval = (mRespInfoArray[idx] as RespondentInfo).Value;
                    if (oldval != newval)
                    {
                        (mRespInfoArray[idx] as RespondentInfo).Value = newval;
                        IsDirty = true;
                    }
                }
            }
        }
Exemple #29
0
        protected override void InitializeControls()
        {
            var chart = new FlexChart();

            Chart = chart;

            cbX                       = new ComboBoxEx("X");
            cbX.DataSource            = new string[] { "Red", "Green", "Blue" };
            cbX.SelectedValueChanged += (se, ar) =>
            {
                chart.BeginUpdate();
                var sel = cbX.SelectedValue.ToString();
                chart.AxisX.Title = sel;
                chart.BindingX    = sel[0].ToString();
                chart.EndUpdate();
            };
            pnlControls.Controls.Add(cbX);

            cbY                       = new ComboBoxEx("Y");
            cbY.DataSource            = new string[] { "Red", "Green", "Blue" };
            cbY.SelectedValueChanged += (se, ar) =>
            {
                chart.BeginUpdate();
                var sel = cbY.SelectedValue.ToString();
                chart.AxisY.Title = sel;
                chart.Binding     = sel[0].ToString();
                UpdateSizeBinding();
                chart.EndUpdate();
            };
            pnlControls.Controls.Add(cbY);

            cbSize                       = new ComboBoxEx("Size");
            cbSize.DataSource            = new string[] { "None", "Red", "Green", "Blue" };
            cbSize.SelectedValueChanged += (se, ar) => UpdateSizeBinding();
            pnlControls.Controls.Add(cbSize);

            var cbGroup = new CheckBoxEx("Legend Groups");

            cbGroup.CheckedChanged += (s, a) => GroupSeries(cbGroup.Checked);
            pnlControls.Controls.Add(cbGroup);
        }
Exemple #30
0
        protected override void InitializeControls()
        {
            flexChart1 = new FlexChart();
            this.Chart = flexChart1;

            _cbPoints = new ComboBoxEx("Points")
            {
                DataSource = new int[] { 100, 1000, 10000, 50000 }
            };
            _cbPoints.SelectedIndexChanged += (s, e) => { flexChart1.DataSource = DataService.CreateDataPoints(x => x, _yFunc, int.Parse(_cbPoints.SelectedItem.ToString())); };

            _chbSVGOrDirectX = new CheckBoxEx("DirectX Rendering");
            _chbSVGOrDirectX.CheckedChanged += (s, e) => { flexChart1.RenderMode = _chbSVGOrDirectX.Checked ? RenderMode.DirectX : RenderMode.Default; };

            _lTimeElapsed = new LabelEx("Elapsed Time");
            _stopwatch    = new Stopwatch();

            this.pnlControls.Controls.Add(_cbPoints);
            this.pnlControls.Controls.Add(_chbSVGOrDirectX);
            this.pnlControls.Controls.Add(_lTimeElapsed);
        }
Exemple #31
0
 protected void ChangeComponentSource()
 {
     foreach (Control ctrl in this.Controls)
     {
         if (ctrl is ComboBoxEx)
         {
             ComboBoxEx comb = (ComboBoxEx)ctrl;
             comb.BOID = m_boId;
         }
         else if (ctrl is TextBoxEx)
         {
             TextBoxEx txt = (TextBoxEx)ctrl;
             txt.TableSource = m_tableSource;
         }
         else if (ctrl is RichTextBoxEx)
         {
             RichTextBoxEx richTxt = (RichTextBoxEx)ctrl;
             richTxt.BOID = m_boId;
         }
     }
 }
Exemple #32
0
        protected override void InitializeControls()
        {
            flexChart1 = new FlexChart();
            this.Chart = flexChart1;

            _cbChartType = new ComboBoxEx("Chart Type")
            {
                DataSource = _chartTypes
            };
            _cbChartType.SelectedIndexChanged += (s, e) => { flexChart1.ChartType = (ChartType)Enum.Parse(typeof(ChartType), _cbChartType.SelectedValue.ToString()); };

            _chbInterpolateNulls = new CheckBoxEx("Interpolate Nulls");
            _chbInterpolateNulls.CheckedChanged += (s, e) => { flexChart1.Options.InterpolateNulls = _chbInterpolateNulls.Checked; };

            _chbLegendToggle = new CheckBoxEx("Allow Legend Toggle");
            _chbLegendToggle.CheckedChanged += (s, e) => { flexChart1.LegendToggle = _chbLegendToggle.Checked; };

            this.pnlControls.Controls.Add(_cbChartType);
            this.pnlControls.Controls.Add(_chbInterpolateNulls);
            this.pnlControls.Controls.Add(_chbLegendToggle);
        }
Exemple #33
0
        /// <summary>
        /// 获取公司组织信息并绑定
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="companyId"></param>
        /// <param name="typename"></param>
        public static void BindOrganizeComBox(ComboBoxEx cmb, string companyId, string typename)
        {
            List <ListItem> list = new List <ListItem>();

            list.Add(new ListItem("", typename));

            string    sqlWhere = string.Format(" enable_flag='1' and com_id='{0}'", companyId);
            DataTable dt_Org   = DBHelper.GetTable("查询公司信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_organization", "org_id,org_name", sqlWhere, "", " order by create_time ");

            if (dt_Org != null && dt_Org.Rows.Count > 0)
            {
                foreach (DataRow dr in dt_Org.Rows)
                {
                    list.Add(new ListItem(dr["org_id"].ToString(), dr["org_name"].ToString()));
                }
            }

            cmb.DisplayMember = "Text";
            cmb.ValueMember   = "Value";
            cmb.DataSource    = list;
        }
Exemple #34
0
        /// <summary>
        /// 创建人:唐春奎
        /// 用于三级联动绑定城市数据的方法
        /// </summary>
        /// <param name="ControlName"></param>
        /// <param name="ProviceID"></param>
        /// <param name="typename"></param>
        public static void BindCityComBox(ComboBoxEx ControlName, string ProviceID, string typename)
        {
            List <ListItem> list = new List <ListItem>();

            list.Add(new ListItem("", typename));
            if (!string.IsNullOrEmpty(ProviceID))
            {
                string    sqlWhere = " PARENT_CODE=" + ProviceID + "";
                DataTable dt_City  = DBHelper.GetTable("查询区域表城市信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "AREA_CODE,AREA_NAME", sqlWhere, "", " order by AREA_CODE ");
                if (dt_City != null && dt_City.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt_City.Rows)
                    {
                        list.Add(new ListItem(dr["AREA_CODE"].ToString(), dr["AREA_NAME"].ToString()));
                    }
                }
            }
            ControlName.DisplayMember = "Text";
            ControlName.ValueMember   = "Value";
            ControlName.DataSource    = list;
        }
Exemple #35
0
        public void TimKiemNguoiDan(TextBoxX txtTenNguoiDan,
                                    ComboBoxEx cmbTheoCanHo,
                                    ComboBoxEx cmbMaCanHo,

                                    ComboBoxEx cmbTheoNgheNghiep,
                                    ComboBoxEx cmbNgheNghiep,
                                    ComboBoxEx cmbTheoDanToc,
                                    ComboBoxEx cmbDanToc,
                                    ComboBoxEx cmbTheoTonGiao,
                                    ComboBoxEx cmbTonGiao,

                                    DataGridViewX dND,
                                    BindingNavigator bND)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_NguoiDanData.TimKiemNguoiDan(txtTenNguoiDan.Text, cmbTheoCanHo.Text, cmbMaCanHo.Text, cmbTheoNgheNghiep.Text, cmbNgheNghiep.Text, cmbTheoDanToc.Text, cmbDanToc.Text, cmbTheoTonGiao.Text, cmbTonGiao.Text);

            bND.BindingSource = bS;
            dND.DataSource    = bS;
        }
Exemple #36
0
        public SemesterSelector(ComboBoxEx schoolyear, ComboBoxEx semester)
        {
            SchoolYear = schoolyear;
            Semester   = semester;

            SchoolYear.TextChanged += delegate
            {
                if (ValidateSchoolYear())
                {
                    SemesterChanged(this, EventArgs.Empty);
                }
            };

            Semester.TextChanged += delegate
            {
                if (ValidateSemester())
                {
                    SemesterChanged(this, EventArgs.Empty);
                }
            };
        }
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaNhanVien,
                            TextBoxX txtTenNhanVien,
                            TextBoxX txtGioiTinh,
                            RadioButton opbNam,
                            RadioButton opbNu,
                            DateTimeInput dtpNgaySinh,
                            TextBoxX txtDiaChi,
                            TextBoxX txtDienThoai,
                            ComboBoxEx cmbChucVu)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_NhanVienData.LayDsNhanVien();

            txtMaNhanVien.DataBindings.Clear();
            txtMaNhanVien.DataBindings.Add("Text", bS, "MaNhanVien");

            txtTenNhanVien.DataBindings.Clear();
            txtTenNhanVien.DataBindings.Add("Text", bS, "TenNhanVien");

            dtpNgaySinh.DataBindings.Clear();
            dtpNgaySinh.DataBindings.Add("Value", bS, "NgaySinh");

            txtGioiTinh.DataBindings.Clear();
            txtGioiTinh.DataBindings.Add("Text", bS, "GioiTinh");

            txtDiaChi.DataBindings.Clear();
            txtDiaChi.DataBindings.Add("Text", bS, "DiaChi");

            txtDienThoai.DataBindings.Clear();
            txtDienThoai.DataBindings.Add("Text", bS, "DienThoai");

            cmbChucVu.DataBindings.Clear();
            cmbChucVu.DataBindings.Add("SelectedValue", bS, "MaChucVu");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
        /// <summary>
        /// 对图元编码
        /// </summary>
        /// <param name="pMapControl"></param>
        /// <param name="cbxLayerName"></param>
        public void PrimitiveCode(IMap pMapControl, ComboBoxEx cbxLayerName)
        {
            IFeatureLayer pFeatureLayer = (IFeatureLayer)pClsCom.GetLayerByName(pMapControl, cbxLayerName.Text);

            string elemid = "ELEMID";

            //遍历字段
            if (pFeatureLayer != null)
            {
                progressbar = new FrmProgressBar(pFeatureLayer.FeatureClass.FeatureCount(null) * 2);
                progressbar.Show();

                IField  pField  = null;
                IFields pFields = pFeatureLayer.FeatureClass.Fields;

                bool pPrimitiveCode = false;

                for (int i = 0; i < pFields.FieldCount - 1; i++)
                {
                    pField = pFields.get_Field(i);
                    if (pField.Name == elemid)
                    {
                        pPrimitiveCode = true;
                    }
                }

                if (!pPrimitiveCode)
                {
                    MessageBox.Show("不存在图元标识码字段!");
                }

                //对图元进行编码
                CreatePrimitiveCode(pFeatureLayer, elemid, progressbar);
                MessageBox.Show("图元编码成功!");
            }
            else
            {
                MessageBox.Show("没有选中任何图层,请选择图层!");
            }
        }
        /// <summary>
        /// 加载操作元素方式
        /// </summary>
        public static void LocadLocationOpearateType(ComboBoxEx cmbOperateType, bool isNeedIframe)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("NAME");
            dt.Columns.Add("VALUE");
            dt.Rows.Add(dt.NewRow());
            List <String> lstAllTypes = new List <string>()
            {
                "点击", "赋值", "循环赋值", "弹出Iframe", "帆软表单", "其他"
            };
            List <String> lstAllTypesValue = new List <string>()
            {
                "CLICK",
                "SENDKEYS",
                "CIRCLESENDKEYS",
                "IFRAME",
                "FR",
                "QT"
            };

            for (int i = 0; i < lstAllTypes.Count; i++)
            {
                if (!isNeedIframe)
                {
                    if (lstAllTypes[i].Equals("Iframe"))
                    {
                        continue;
                    }
                }
                DataRow dr = dt.NewRow();
                dr["NAME"]  = lstAllTypes[i];
                dr["VALUE"] = lstAllTypesValue[i];
                dt.Rows.Add(dr);
            }

            cmbOperateType.DataSource    = dt;
            cmbOperateType.DisplayMember = "NAME";
            cmbOperateType.ValueMember   = "VALUE";
        }
        /// <summary>
        /// 初始化方案列表
        /// </summary>
        protected void FaNameCombInit(ComboBoxEx Item, string FaTypeString)
        {
            #region --------------加载方案信息列表----------------------------------
            List <string> _FaNames = this.GetFaNames(FaTypeString);
            Item.Items.Clear();
            if (_FaNames.Count == 0)
            {
                Item.Items.Add("没有方案...");
            }
            else
            {
                Item.Items.Add("请从下拉列表中选择...");
            }
            for (int i = 0; i < _FaNames.Count; i++)
            {
                Item.Items.Add(_FaNames[i]);
            }

            Item.SelectedIndex = 0;

            #endregion
        }
Exemple #41
0
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.itemPanelCommands = new DevComponents.DotNetBar.ItemPanel();
            this.itemPanelQat = new DevComponents.DotNetBar.ItemPanel();
            this.buttonAddToQat = new DevComponents.DotNetBar.ButtonX();
            this.buttonRemoveFromQat = new DevComponents.DotNetBar.ButtonX();
            this.comboCategories = new Controls.ComboBoxEx();
            this.labelCategories = new System.Windows.Forms.Label();
            this.checkQatBelowRibbon = new Controls.CheckBoxX();
            this.SuspendLayout();
            // 
            // itemPanelCommands
            // 
            this.itemPanelCommands.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            // 
            // 
            // 
            this.itemPanelCommands.AutoScroll = true;
            this.itemPanelCommands.BackgroundStyle.Class = DevComponents.DotNetBar.Rendering.ElementStyleClassKeys.ItemPanelKey;
            this.itemPanelCommands.Style = eDotNetBarStyle.StyleManagerControlled;
            this.itemPanelCommands.FadeEffect = false;
            this.itemPanelCommands.LayoutOrientation = DevComponents.DotNetBar.eOrientation.Vertical;
#if!TRIAL
            this.itemPanelCommands.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
#endif
            this.itemPanelCommands.Location = new System.Drawing.Point(9, 46);
            this.itemPanelCommands.Name = "itemPanelCommands";
            this.itemPanelCommands.Size = new System.Drawing.Size(173, 257);
            this.itemPanelCommands.TabIndex = 2;
            this.itemPanelCommands.Text = "itemPanelCommands";
            this.itemPanelCommands.KeyUp += new KeyEventHandler(ItemPanelKeyUp);
            this.itemPanelCommands.ItemDoubleClick += new MouseEventHandler(ItemPanelCommandsDoubleClick);
            // 
            // itemPanelQat
            // 
            this.itemPanelQat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Right)));
            // 
            // 
            // 
            this.itemPanelQat.AutoScroll = true;
            this.itemPanelQat.BackgroundStyle.Class = DevComponents.DotNetBar.Rendering.ElementStyleClassKeys.ItemPanelKey;
            this.itemPanelQat.Style = eDotNetBarStyle.StyleManagerControlled;
            this.itemPanelQat.EnableDragDrop = true;
            this.itemPanelQat.FadeEffect = false;
            this.itemPanelQat.LayoutOrientation = DevComponents.DotNetBar.eOrientation.Vertical;
            #if!TRIAL
            this.itemPanelQat.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
            #endif
            this.itemPanelQat.Location = new System.Drawing.Point(266, 46);
            this.itemPanelQat.Name = "itemPanelQat";
            this.itemPanelQat.Size = new System.Drawing.Size(173, 257);
            this.itemPanelQat.TabIndex = 5;
            this.itemPanelQat.Text = "itemPanelCommands";
            this.itemPanelQat.DragDrop += new System.Windows.Forms.DragEventHandler(this.itemPanelQat_DragDrop);
            this.itemPanelQat.UserCustomize += new EventHandler(this.itemPanelQat_UserCustomize);
            this.itemPanelQat.KeyUp += new KeyEventHandler(ItemPanelKeyUp);
            this.itemPanelQat.ItemDoubleClick += new MouseEventHandler(ItemPanelQatDoubleClick);
            // 
            // buttonAddToQat
            // 
            this.buttonAddToQat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.buttonAddToQat.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.buttonAddToQat.Location = new System.Drawing.Point(188, 126);
            this.buttonAddToQat.Name = "buttonAddToQat";
            this.buttonAddToQat.Size = new System.Drawing.Size(73, 21);
            this.buttonAddToQat.TabIndex = 3;
            this.buttonAddToQat.Text = "&Add >>";
            this.buttonAddToQat.Click += new System.EventHandler(this.buttonAddToQat_Click);
            // 
            // buttonRemoveFromQat
            // 
            this.buttonRemoveFromQat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.buttonRemoveFromQat.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.buttonRemoveFromQat.Location = new System.Drawing.Point(188, 153);
            this.buttonRemoveFromQat.Name = "buttonRemoveFromQat";
            this.buttonRemoveFromQat.Size = new System.Drawing.Size(73, 21);
            this.buttonRemoveFromQat.TabIndex = 4;
            this.buttonRemoveFromQat.Text = "&Remove";
            this.buttonRemoveFromQat.Click += new System.EventHandler(this.buttonRemoveFromQat_Click);
            // 
            // comboCategories
            // 
            this.comboCategories.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.comboCategories.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboCategories.Location = new System.Drawing.Point(9, 19);
            this.comboCategories.Name = "comboCategories";
            this.comboCategories.Size = new System.Drawing.Size(173, 21);
            this.comboCategories.Sorted = true;
            this.comboCategories.TabIndex = 1;
            this.comboCategories.SelectedIndexChanged += new System.EventHandler(this.comboCategories_SelectedIndexChanged);
            this.comboCategories.Style = eDotNetBarStyle.Office2007;
            this.comboCategories.DrawMode = DrawMode.OwnerDrawFixed;
            this.comboCategories.ThemeAware = false;
            // 
            // labelCategories
            // 
            this.labelCategories.AutoSize = true;
            this.labelCategories.BackColor = System.Drawing.Color.Transparent;
            this.labelCategories.Location = new System.Drawing.Point(6, 3);
            this.labelCategories.Name = "labelCategories";
            this.labelCategories.Size = new System.Drawing.Size(123, 13);
            this.labelCategories.TabIndex = 0;
            this.labelCategories.Text = "&Choose commands from:";
            // 
            // checkQatBelowRibbon
            // 
            this.checkQatBelowRibbon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.checkQatBelowRibbon.BackColor = System.Drawing.Color.Transparent;
            this.checkQatBelowRibbon.Location = new System.Drawing.Point(9, 311);
            this.checkQatBelowRibbon.Name = "checkQatBelowRibbon";
            this.checkQatBelowRibbon.Size = new System.Drawing.Size(420, 17);
            this.checkQatBelowRibbon.TabIndex = 6;
            this.checkQatBelowRibbon.Text = "&Place Quick Access Toolbar below the Ribbon";
            this.checkQatBelowRibbon.CheckedChangedEx += new Controls.CheckBoxXChangeEventHandler(this.checkQatBelowRibbon_CheckedChanged);
            // 
            // QatCustomizePanel
            // 
            this.BackColor = System.Drawing.Color.Transparent;
            this.Controls.Add(this.comboCategories);
            this.Controls.Add(this.checkQatBelowRibbon);
            this.Controls.Add(this.labelCategories);
            this.Controls.Add(this.buttonRemoveFromQat);
            this.Controls.Add(this.buttonAddToQat);
            this.Controls.Add(this.itemPanelQat);
            this.Controls.Add(this.itemPanelCommands);
            this.Name = "QatCustomizePanel";
            this.Size = new System.Drawing.Size(444, 334);
            this.ResumeLayout(false);
            this.PerformLayout();

        }
 public void HienThiComboBox(ComboBoxEx comboBox)
 {
     comboBox.DataSource = m_LoaiDiemData.LayDsLoaiDiem();
     comboBox.DisplayMember = "TenLoaiDiem";
     comboBox.ValueMember = "MaLoaiDiem";
 }
Exemple #43
0
        private int obtenerIndice(object item, ComboBoxEx cb)
        {
            for (int i = 0; i < cb.Items.Count; i++)
                if (cb.Items[i].ToString().CompareTo(item.ToString()) == 0)
                    return i;

            return 0;
        }
Exemple #44
0
 private void UpdateComboBoxEx(ComboBoxEx item, bool enabled)
 {
     if (item.InvokeRequired)
     {
         item.Invoke(new Action<ComboBoxEx, bool>(UpdateComboBoxEx), item, enabled);
         return;
     }
     item.Enabled = enabled;
 }
Exemple #45
0
 public void EnableComboBox(ComboBoxEx combo)
 {
     if (combo.InvokeRequired)
     {
         combo.Invoke(
             new MethodInvoker(
                 delegate { EnableComboBox(combo); }));
     }
     else
     {
         combo.Enabled = true;
     }
 }
 /// <summary>
 /// 创建人:唐春奎
 /// 从字典码表中获取信息,绑定ComboBox下拉框
 /// </summary>
 /// <param name="ControlName"></param>
 /// <param name="dic_code"></param>
 /// <param name="typename"></param>
 public static void BindComBoxDataSource(ComboBoxEx ControlName, string dic_code, string typename)
 {
     List<ListItem> list = new List<ListItem>();
     list.Add(new ListItem("", typename));
     string sqlWhere = " parent_id in (select dic_id from sys_dictionaries where dic_code='" + dic_code + "' and enable_flag=1)";
     DataTable dt_dic = DBHelper.GetTable("查询字典码表信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_dictionaries", "dic_id,dic_name", sqlWhere, "", " order by dic_code ");
     if (dt_dic != null && dt_dic.Rows.Count > 0)
     {
         foreach (DataRow dr in dt_dic.Rows)
         {
             list.Add(new ListItem(dr["dic_id"], dr["dic_name"].ToString()));
         }
     }
     ControlName.DisplayMember = "Text";
     ControlName.ValueMember = "Value";
     ControlName.DataSource = list;
 }
 /// <summary>
 /// 获取结算账户信息
 /// </summary>
 /// <param name="controlName">控件名称</param>
 /// <param name="typename"></param>
 public static void BindAccount(ComboBoxEx controlName, string typename)
 {
     string strWhere = string.Format("enable_flag='{0}' and status='{1}'", (int)DataSources.EnumEnableFlag.USING, (int)DataSources.EnumStatus.Start);
     DataTable dt = DBHelper.GetTable("", "tb_cashier_account", "cashier_account,account_name", strWhere, "", "");
     if (dt == null || dt.Rows.Count == 0)
     {
         dt = new DataTable();
         dt.Columns.Add("cashier_account");
         dt.Columns.Add("account_name");
     }
     if (!string.IsNullOrEmpty(typename))
     {
         DataRow dr1 = dt.NewRow();
         dr1["cashier_account"] = "";
         dr1["account_name"] = typename;
         dt.Rows.InsertAt(dr1, 0);
     }
     controlName.DataSource = dt;
     controlName.ValueMember = "cashier_account";
     controlName.DisplayMember = "account_name";
 }
 void SetPrintStyle(ComboBoxEx cbo, DataTable dt)
 {
     Action<DataTable> setPrintStyleAction = dtStyle =>
         {
             cbo.ValueMember = "style_url";
             cbo.DisplayMember = "style_name";
             cbo.DataSource = dtStyle;
         };
     if (cbo.InvokeRequired)
     {
         cbo.Invoke(setPrintStyleAction, dt);
     }
     else
     {
         setPrintStyleAction(dt);
     }
 }
 /// <summary> 创建人:唐春奎 绑定采购计划单查询中计划完成状态
 /// </summary>
 /// <param name="ControlName">控件名称</param>
 /// <param name="typename">true:全部, false:请选择</param>
 public static void BindPurchasePlanFinishStatus(ComboBoxEx ControlName, bool typename)
 {
     ControlName.DataSource = DataSources.EnumToList(typeof(DataSources.PurchasePlanFinishStatus), typename);
     ControlName.ValueMember = "Value";
     ControlName.DisplayMember = "Text";
 }
        /// <summary>
        /// 获取公司信息并绑定
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="typename"></param>
        public static void BindCompanyComBox(ComboBoxEx cmb, string typename, string com_id)
        {
            List<ListItem> list = new List<ListItem>();
            list.Add(new ListItem("", typename));

            string sqlWhere = " status='1' and enable_flag='1'";
            if (!string.IsNullOrEmpty(com_id))
            {
                sqlWhere += " and com_id!='" + com_id + "'";
            }
            DataTable dt_com = DBHelper.GetTable("查询公司信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_company", "com_id,com_name", sqlWhere, "", " order by create_time ");
            if (dt_com != null && dt_com.Rows.Count > 0)
            {
                foreach (DataRow dr in dt_com.Rows)
                {
                    list.Add(new ListItem(dr["com_id"].ToString(), dr["com_name"].ToString()));
                }
            }

            cmb.DisplayMember = "Text";
            cmb.ValueMember = "Value";
            cmb.DataSource = list;
        }
 public void HienThiComboBox(ComboBoxEx comboBox)
 {
     comboBox.DataSource = m_HocSinhData.LayDsHocSinh();
        comboBox.DisplayMember = "HoTen";
        comboBox.ValueMember = "MaHocSinh";
 }
        /// <summary>
        /// 获取公司组织信息并绑定
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="companyId"></param>
        /// <param name="typename"></param>
        public static void BindOrganizeComBox(ComboBoxEx cmb, string companyId, string typename)
        {
            List<ListItem> list = new List<ListItem>();
            list.Add(new ListItem("", typename));

            string sqlWhere = string.Format("  status='1' and enable_flag='1' and com_id='{0}'", companyId);
            DataTable dt_Org = DBHelper.GetTable("查询公司信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_organization", "org_id,org_name", sqlWhere, "", " order by create_time ");
            if (dt_Org != null && dt_Org.Rows.Count > 0)
            {
                foreach (DataRow dr in dt_Org.Rows)
                {
                    list.Add(new ListItem(dr["org_id"].ToString(), dr["org_name"].ToString()));
                }
            }

            cmb.DisplayMember = "Text";
            cmb.ValueMember = "Value";
            cmb.DataSource = list;
        }
 public void HienThiComboBox(ComboBoxEx comboBox)
 {
     comboBox.DataSource = m_HocLucData.LayDsHocLuc();
     comboBox.DisplayMember = "TenHocLuc";
     comboBox.ValueMember = "MaHocLuc";
 }
Exemple #54
0
        private void LoadScanItems(ComboBoxEx cb)
        {
            List<object> list = _GridColumn.ScanItems;

            int n = Math.Min(list.Count, _GridColumn.FilterPopupMaxItems);

            MyComboItem[] items = new MyComboItem[n];

            bool blankSeen = false;

            for (int i = 0; i < n; i++)
            {
                object o = list[i];

                MyComboItem bi;

                if (o is DateTime)
                {
                    DateTime dt = (DateTime)o;
                    dt = dt.Date;

                    string s = dt.ToShortDateString();

                    bi = new MyComboItem("ScanDateEntry", s, dt);
                }
                else
                {
                    string s = o.ToString();

                    bi = new MyComboItem("ScanTextEntry", s, i);

                    if (blankSeen == false && string.IsNullOrEmpty(bi.Text) == true)
                        blankSeen = true;
                }

                items[i] = bi;
            }

            if (blankSeen == false)
                cb.Items.Add("");

            cb.Items.AddRange(items);
        }
 private void InitializeComponent()
 {
     ComponentResourceManager manager = new ComponentResourceManager(typeof(FileSystemCopyDialog));
     this.btnOk = new Button();
     this.btnCancel = new Button();
     this.btnTree = new Button();
     this.tlpBack = new TableLayoutPanel();
     this.lblCopyTo = new Label();
     this.chkAsyncFileCopy = new CheckBox();
     this.chkCopyItemACL = new CheckBox();
     this.chkSkipEmptyFolders = new CheckBox();
     this.cmbCopyTo = new ComboBox();
     this.chkCheckFreeSpace = new CheckBox();
     this.chkCopyItemTime = new CheckBox();
     this.lblMode = new Label();
     this.cmbMode = new ComboBoxEx();
     this.lblFilter = new Label();
     this.chkDeleteSource = new CheckBox();
     this.cmbFilter = new FilterComboBox();
     this.bvlButtons = new Bevel();
     this.Validator = new ValidatorProvider();
     this.AutoComplete = new AutoCompleteProvider();
     TableLayoutPanel panel = new TableLayoutPanel();
     panel.SuspendLayout();
     this.tlpBack.SuspendLayout();
     base.SuspendLayout();
     manager.ApplyResources(panel, "tlpButtons");
     panel.Controls.Add(this.btnOk, 1, 0);
     panel.Controls.Add(this.btnCancel, 3, 0);
     panel.Controls.Add(this.btnTree, 2, 0);
     panel.GrowStyle = TableLayoutPanelGrowStyle.FixedSize;
     panel.Name = "tlpButtons";
     manager.ApplyResources(this.btnOk, "btnOk");
     this.btnOk.Name = "btnOk";
     this.btnOk.UseVisualStyleBackColor = true;
     this.btnOk.Click += new EventHandler(this.btnOk_Click);
     manager.ApplyResources(this.btnCancel, "btnCancel");
     this.btnCancel.DialogResult = DialogResult.Cancel;
     this.btnCancel.Name = "btnCancel";
     this.btnCancel.UseVisualStyleBackColor = true;
     manager.ApplyResources(this.btnTree, "btnTree");
     this.btnTree.Name = "btnTree";
     this.btnTree.UseVisualStyleBackColor = true;
     this.btnTree.Click += new EventHandler(this.btnTree_Click);
     manager.ApplyResources(this.tlpBack, "tlpBack");
     this.tlpBack.Controls.Add(this.lblCopyTo, 0, 0);
     this.tlpBack.Controls.Add(this.chkAsyncFileCopy, 1, 6);
     this.tlpBack.Controls.Add(this.chkCopyItemACL, 0, 6);
     this.tlpBack.Controls.Add(this.chkSkipEmptyFolders, 1, 5);
     this.tlpBack.Controls.Add(this.cmbCopyTo, 0, 1);
     this.tlpBack.Controls.Add(this.chkCheckFreeSpace, 1, 4);
     this.tlpBack.Controls.Add(this.chkCopyItemTime, 0, 5);
     this.tlpBack.Controls.Add(this.lblMode, 0, 2);
     this.tlpBack.Controls.Add(this.cmbMode, 0, 3);
     this.tlpBack.Controls.Add(this.lblFilter, 1, 2);
     this.tlpBack.Controls.Add(this.chkDeleteSource, 0, 4);
     this.tlpBack.Controls.Add(this.cmbFilter, 1, 3);
     this.tlpBack.GrowStyle = TableLayoutPanelGrowStyle.FixedSize;
     this.tlpBack.Name = "tlpBack";
     this.lblCopyTo.AutoEllipsis = true;
     this.tlpBack.SetColumnSpan(this.lblCopyTo, 2);
     manager.ApplyResources(this.lblCopyTo, "lblCopyTo");
     this.lblCopyTo.Name = "lblCopyTo";
     manager.ApplyResources(this.chkAsyncFileCopy, "chkAsyncFileCopy");
     this.chkAsyncFileCopy.Checked = true;
     this.chkAsyncFileCopy.CheckState = CheckState.Indeterminate;
     this.chkAsyncFileCopy.Name = "chkAsyncFileCopy";
     this.chkAsyncFileCopy.ThreeState = true;
     this.chkAsyncFileCopy.UseVisualStyleBackColor = true;
     manager.ApplyResources(this.chkCopyItemACL, "chkCopyItemACL");
     this.chkCopyItemACL.Name = "chkCopyItemACL";
     this.chkCopyItemACL.UseVisualStyleBackColor = true;
     manager.ApplyResources(this.chkSkipEmptyFolders, "chkSkipEmptyFolders");
     this.chkSkipEmptyFolders.Name = "chkSkipEmptyFolders";
     this.chkSkipEmptyFolders.UseVisualStyleBackColor = true;
     this.AutoComplete.SetAutoComplete(this.cmbCopyTo, true);
     this.tlpBack.SetColumnSpan(this.cmbCopyTo, 2);
     manager.ApplyResources(this.cmbCopyTo, "cmbCopyTo");
     this.cmbCopyTo.Name = "cmbCopyTo";
     this.Validator.SetValidateOn(this.cmbCopyTo, ValidateOn.TextChangedTimer);
     this.cmbCopyTo.Validating += new CancelEventHandler(this.cmbCopyTo_Validating);
     this.cmbCopyTo.SelectionChangeCommitted += new EventHandler(this.cmbCopyTo_TextUpdate);
     this.cmbCopyTo.TextUpdate += new EventHandler(this.cmbCopyTo_TextUpdate);
     manager.ApplyResources(this.chkCheckFreeSpace, "chkCheckFreeSpace");
     this.chkCheckFreeSpace.Checked = true;
     this.chkCheckFreeSpace.CheckState = CheckState.Checked;
     this.chkCheckFreeSpace.Name = "chkCheckFreeSpace";
     this.chkCheckFreeSpace.UseVisualStyleBackColor = true;
     manager.ApplyResources(this.chkCopyItemTime, "chkCopyItemTime");
     this.chkCopyItemTime.Checked = true;
     this.chkCopyItemTime.CheckState = CheckState.Checked;
     this.chkCopyItemTime.Name = "chkCopyItemTime";
     this.chkCopyItemTime.UseVisualStyleBackColor = true;
     manager.ApplyResources(this.lblMode, "lblMode");
     this.lblMode.Name = "lblMode";
     manager.ApplyResources(this.cmbMode, "cmbMode");
     this.cmbMode.DropDownStyle = ComboBoxStyle.DropDownList;
     this.cmbMode.Items.AddRange(new object[] { manager.GetString("cmbMode.Items"), manager.GetString("cmbMode.Items1"), manager.GetString("cmbMode.Items2"), manager.GetString("cmbMode.Items3"), manager.GetString("cmbMode.Items4") });
     this.cmbMode.MinimumSize = new Size(0xca, 0);
     this.cmbMode.Name = "cmbMode";
     manager.ApplyResources(this.lblFilter, "lblFilter");
     this.lblFilter.Name = "lblFilter";
     manager.ApplyResources(this.chkDeleteSource, "chkDeleteSource");
     this.chkDeleteSource.Name = "chkDeleteSource";
     this.chkDeleteSource.UseVisualStyleBackColor = true;
     this.chkDeleteSource.Click += new EventHandler(this.chkDeleteSource_Click);
     manager.ApplyResources(this.cmbFilter, "cmbFilter");
     this.cmbFilter.DrawMode = DrawMode.OwnerDrawFixed;
     this.cmbFilter.FormattingEnabled = true;
     this.cmbFilter.Name = "cmbFilter";
     manager.ApplyResources(this.bvlButtons, "bvlButtons");
     this.bvlButtons.ForeColor = SystemColors.ControlDarkDark;
     this.bvlButtons.Name = "bvlButtons";
     this.bvlButtons.Sides = Border3DSide.Top;
     this.bvlButtons.Style = Border3DStyle.Flat;
     this.Validator.Owner = this;
     this.Validator.OwnerFormValidate = FormValidate.DisableAcceptButton;
     this.AutoComplete.UseCustomSource = Settings.Default.UseACSRecentItems;
     this.AutoComplete.UseEnvironmentVariablesSource = Settings.Default.UseACSEnvironmentVariables;
     this.AutoComplete.UseFileSystemSource = Settings.Default.UseACSFileSystem;
     base.AcceptButton = this.btnOk;
     manager.ApplyResources(this, "$this");
     base.AutoScaleMode = AutoScaleMode.Font;
     this.AutoValidate = AutoValidate.EnableAllowFocusChange;
     base.CancelButton = this.btnCancel;
     base.Controls.Add(panel);
     base.Controls.Add(this.bvlButtons);
     base.Controls.Add(this.tlpBack);
     base.FixMouseWheel = Settings.Default.FixMouseWheel;
     base.FormBorderStyle = FormBorderStyle.FixedDialog;
     base.MaximizeBox = false;
     base.MinimizeBox = false;
     base.Name = "FileSystemCopyDialog";
     base.ShowInTaskbar = false;
     base.Shown += new EventHandler(this.FileSystemCopyDialog_Shown);
     panel.ResumeLayout(false);
     panel.PerformLayout();
     this.tlpBack.ResumeLayout(false);
     this.tlpBack.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
 /// <summary> 绑定结算方式
 /// </summary>
 public static void BindBalanceWay(ComboBoxEx ControlName, string typename)
 {
     List<ListItem> list = new List<ListItem>();
     list.Add(new ListItem("", typename));
     DataTable dt = DBHelper.GetTable("", "tb_balance_way", "balance_way_id,balance_way_name", " enable_flag='1' ", "", "");
     if (dt != null && dt.Rows.Count > 0)
     {
         foreach (DataRow dr in dt.Rows)
         {
             list.Add(new ListItem(dr["balance_way_id"], dr["balance_way_name"].ToString()));
         }
     }
     ControlName.DataSource = list;
     ControlName.ValueMember = "Value";
     ControlName.DisplayMember = "Text";
 }
Exemple #57
0
        static internal Size GetPreferredSize(
            GridFilter gridFilter, GridColumn gridColumn)
        {
            Size size = Size.Empty;

            FilterEditType type = gridColumn.GetFilterPanelType();

            switch (type)
            {
                case FilterEditType.ComboBox:
                    if (_sizeComboBox == null)
                        _sizeComboBox = new ComboBoxEx();

                    _sizeComboBox.Font = gridFilter.GetEffectiveStyle(gridColumn).Font;

                    size = _sizeComboBox.GetPreferredSize(Size.Empty);
                    break;

                case FilterEditType.TextBox:
                case FilterEditType.DateTime:
                    if (_sizeTextBox == null)
                        _sizeTextBox = new TextBoxX();

                    _sizeTextBox.BorderStyle = BorderStyle.None;
                    _sizeTextBox.Font = gridFilter.GetEffectiveStyle(gridColumn).Font;

                    size = _sizeTextBox.GetPreferredSize(Size.Empty);
                    break;

                case FilterEditType.CheckBox:
                    if (_sizeCheckBox == null)
                        _sizeCheckBox = new MyCheckBoxX();

                    size = new Size(20, 20);
                    break;
            }

            return (size);
        }
 /// <summary> 创建人:唐春奎  获取结算账户信息 绑定采购开单
 /// </summary>
 /// <param name="ControlName">控件名称</param>
 /// <param name="typename">true:全部, false:请选择</param>
 public static void BindAccount(ComboBoxEx ControlName,string whereStr, string typename)
 {
     string sql_where = " enable_flag=1 ";
     List<ListItem> list = new List<ListItem>();
     list.Add(new ListItem("", typename));
     if (!string.IsNullOrEmpty(whereStr))
     {
         sql_where += " and cashier_account='" + whereStr + "'";
         DataTable dt = DBHelper.GetTable("", "tb_cashier_account", "cashier_account,account_name", sql_where, "", "");
         foreach (DataRow dr in dt.Rows)
         {
             list.Add(new ListItem(dr["cashier_account"], dr["account_name"].ToString()));
         }
     }
     ControlName.DataSource = list;
     ControlName.ValueMember = "Value";
     ControlName.DisplayMember = "Text";
 }
Exemple #59
0
        private void LoadComboItems(ComboBoxEx cb)
        {
            bool blankSeen = false;

            ComboBox cbx = GridColumn.EditControl as ComboBox;

            if (cbx != null && cbx.Items.Count > 0)
            {
                MyComboItem[] items = new MyComboItem[cbx.Items.Count];

                for (int i = 0; i < cbx.Items.Count; i++)
                {
                    MyComboItem bi = new
                        MyComboItem("CbxEntry", cbx.GetItemText(cbx.Items[i]), i);

                    if (blankSeen == false && string.IsNullOrEmpty(bi.Text) == true)
                        blankSeen = true;

                    items[i] = bi;
                }

                if (blankSeen == false)
                    cb.Items.Add("");

                cb.Items.AddRange(items);
            }
        }
 /// <summary> 创建人:唐春奎 绑定销售开单类型
 /// </summary>
 /// <param name="ControlName">控件名称</param>
 /// <param name="typename">true:全部, false:请选择</param>
 public static void BindSaleOrderType(ComboBoxEx ControlName, bool isShowFrist, string typename)
 {
     ControlName.DataSource = DataSources.EnumToListByValueString(typeof(DataSources.EnumSaleOrderType), isShowFrist, typename);
     ControlName.ValueMember = "Value";
     ControlName.DisplayMember = "Text";
 }