/*Lấy ra dòng dữ liệu và gán vào các hộp text*/
 public void SelectCoDK(DNhanVien DNV, TextEdit txt1, TextEdit txt2
                           , TextEdit txt3, TextEdit txt4, ComboBoxEdit cb1
                           , TextEdit txt5, TextEdit txt6, TextEdit txt7, TextEdit txt8)
 {
     try
     {
         string path = string.Format("Select * From NhanVien Where MaNhanVien='{0}'", DNV.MaNV);
         DataTable dtt = DA.TbView(path);
         txt1.EditValue = dtt.Rows[0]["MaNhanVien"].ToString().Trim();
         txt2.EditValue = dtt.Rows[0]["TenNhanVien"].ToString().Trim();
         txt3.EditValue = dtt.Rows[0]["DiaChi"].ToString().Trim();
         txt4.EditValue = dtt.Rows[0]["SoDienThoai"].ToString().Trim();
         cb1.EditValue = dtt.Rows[0]["ChucVu"].ToString().Trim();
         txt5.EditValue = dtt.Rows[0]["TenDangNhap"].ToString().Trim();
         txt5.EditValue = dtt.Rows[0]["MatKhau"].ToString().Trim();
         txt5.EditValue = dtt.Rows[0]["AnhDaiDien"].ToString().Trim();
         txt5.EditValue = dtt.Rows[0]["Site"].ToString().Trim();
         dtt = null;
     }
     catch
     {
         XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !",
                                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
 private void LoadPrinter(ComboBoxEdit cmb)
 {
     foreach (string printer in PrinterSettings.InstalledPrinters)
     {
         cmb.Properties.Items.Add(printer);
     }
 }
Example #3
0
 /// <summary>
 /// 加载皮肤列表
 /// </summary>
 public static void LoadSkin(ComboBoxEdit owner)
 {
     foreach (DevExpress.Skins.SkinContainer skin in DevExpress.Skins.SkinManager.Default.Skins)
     {
         owner.Properties.Items.Add(skin.SkinName);
     }
 }
 /*Lấy ra dòng dữ liệu và gán vào các hộp text*/
 public void SelectCoDK(DChuyenBay DCB, TextEdit txtMaCB, ComboBoxEdit cbMaDB, ComboBoxEdit cbMaMB
                           , TimeEdit dtGioBay, TextEdit txtDiemDi, ComboBoxEdit cbDiemDen
                           , DateTimePicker dtNgayDi, DateTimePicker dtNgayDen, TextEdit txtVeL1,
                             TextEdit txtVeL2, TextEdit txtGhiChu)
 {
     try
     {
         string path = string.Format("Select * From ChuyenBay Where MaChuyenBay='{0}'", DCB.MCB);
         DataTable dtt = DA.TbView(path);
         txtMaCB.EditValue = dtt.Rows[0]["MaChuyenBay"].ToString().Trim();
         cbMaDB.EditValue = dtt.Rows[0]["MaDuongBay"].ToString().Trim();
         cbMaMB.EditValue = dtt.Rows[0]["MaMayBay"].ToString().Trim();
         dtGioBay.Text = dtt.Rows[0]["GioBay"].ToString().Trim();
         txtDiemDi.EditValue = dtt.Rows[0]["DiemDi"].ToString().Trim();
         cbDiemDen.EditValue = dtt.Rows[0]["DiemDen"].ToString().Trim();
         dtNgayDi.Text = dtt.Rows[0]["NgayDi"].ToString().Trim();
         dtNgayDen.Text = dtt.Rows[0]["NgayDen"].ToString().Trim();
         txtVeL1.EditValue = dtt.Rows[0]["SLV_Loai1"].ToString().Trim();
         txtVeL2.EditValue = dtt.Rows[0]["SLV_Loai2"].ToString().Trim();
         txtGhiChu.EditValue = dtt.Rows[0]["GhiChu"].ToString().Trim();
         //return dt.TbView(path);
     }
     catch
     {
         XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !",
                                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #5
0
 private static void InitFieldValue(ComboBoxEdit combo, TextEdit text)
 {
     combo.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
     combo.Properties.Items.Clear();
     combo.Properties.Items.Add(FieldType.undefined);
     combo.Properties.Items.Add(FieldType.uniform);
     combo.Properties.Items.Add(FieldType.nonuniform);
     combo.SelectedIndex = 0;
 }
 public static void Init(ComboBoxEdit comboBoxEdit, string dataWordTypeCode)
 {
     comboBoxEdit.Properties.Items.Clear();
     IList<DataWord> list = DataWordService.FindDataWordsByTypeCode(dataWordTypeCode);
     foreach (DataWord word in list)
     {
         comboBoxEdit.Properties.Items.Add(word.Name);
     }
 }
Example #7
0
        public static void _initPrinters(ComboBoxEdit Input)
        {
            String pkInstalledPrinters;

            for (int i = 0; i < PrinterSettings.InstalledPrinters.Count; i++)
            {
                pkInstalledPrinters = PrinterSettings.InstalledPrinters[i];
                Input.Properties.Items.Add(pkInstalledPrinters);
            }
        }
		private void InitPageCombo()
		{
			_pageSelector = MainController.Instance.MainForm.comboBoxEditHomePage;
			_pageSelector.Enabled = Pages.Count > 1;
			_pageSelector.Properties.Items.Clear();
			_pageSelector.Properties.Items.AddRange(Pages);
			_pageSelector.EditValue = ActivePage;
			_pageSelector.EditValueChanged -= OnSelectedPageChanged;
			_pageSelector.EditValueChanged += OnSelectedPageChanged;
		}
Example #9
0
 public PagingManager(GridControl gridControl, LabelControl displayPageNumber, ComboBoxEdit cmbPageSize, RandomDataSourceGenerator randomDataSourceGenerator)
 {
     _gridControl = gridControl;
     _displayPageNumber = displayPageNumber;
     _cmbPageSize = cmbPageSize;
     _randomDataSourceGenerator = randomDataSourceGenerator;
     _dataTable = _randomDataSourceGenerator.Generate(300);
     Init();
     LoadPage();
 }
		public static void MakeAutoComplete(
			ComboBoxEdit comboBoxEdit,
			AutoCompleteMode autoCompleteMode,
			AutoCompleteSource autoCompleteSource)
		{
			// http://community.devexpress.com/forums/p/81601/280039.aspx

			var tx = comboBoxEdit.MaskBox;
			tx.AutoCompleteSource = autoCompleteSource;
			tx.AutoCompleteMode = autoCompleteMode;
		}
		protected override void InitControls()
		{
			MainController.Instance.MainForm.itemContainerHomeWallbin.Visible = Pages.Any();
			_pageSelector = MainController.Instance.MainForm.comboBoxEditHomePage;
			_pageSelector.Enabled = Pages.Count > 1;
			_pageSelector.Properties.Items.Clear();
			_pageSelector.Properties.Items.AddRange(Pages);
			_pageSelector.EditValue = ActivePage;
			_pageSelector.EditValueChanged += OnSelectedPageChanged;
			MainController.Instance.MainForm.ribbonBarHomeWallbin.RecalcLayout();
			MainController.Instance.MainForm.ribbonPanelHome.PerformLayout();
		}
 /*Đẩy dữ liệu vào Vé L1=Số ghế loại 1 và Vé L2=Số ghế loại 2*/
 public void LoadLuongVe(TextEdit txtV1, TextEdit txtV2, ComboBoxEdit cbMMB)
 {
     DataTable dt = DA.TbView("select SoGheLoai1,SoGheLoai2 from MayBay Where MaMayBay='" + cbMMB.Text + "'");
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             txtV1.Text = dt.Rows[0]["SoGheLoai1"].ToString();
             txtV2.Text = dt.Rows[0]["SoGheLoai2"].ToString();
         }
     }
 }
Example #13
0
 private void ComboBoxDataBind(ComboBoxEdit cbo, int propertyId)
 {
     cbo.Properties.Items.Clear();
     var cboValueList = propertyService.GetComboBoxValueByPropertyId(propertyId);
     foreach (var item in cboValueList)
     {
         var data = new ComboBoxData();
         data.Text = item.Value;
         data.Value = item.Id.ToString();
         cbo.Properties.Items.Add(data);
     }
 }
Example #14
0
 /// <summary>
 /// 绑定ComboBoxEdit的数据源
 /// </summary>
 /// <param name="edit">ComboBoxEdit</param>
 /// <param name="dataSource">数据源</param>
 /// <param name="bindField">取值字段</param>
 public static void BindingComboEdit(ComboBoxEdit edit, object dataSource, string bindField)
 {
     try
     {
         edit.DataBindings.Clear();
         Binding b = new Binding("EditValue", dataSource, bindField);
         edit.DataBindings.Add(b);
     }
     catch (Exception ex)
     {
         Msg.ShowException(ex);
     }
 }
		private void InitControls()
		{
			_librarySelector = MainController.Instance.MainForm.comboBoxEditHomeLibrary;
			_librarySelector.Properties.Items.Clear();
			_librarySelector.Properties.Items.AddRange(Views);
			_librarySelector.EditValue = ActiveWallbin;
			_librarySelector.EditValueChanged += OnSelectedLibraryChanged;

			MainController.Instance.MainForm.itemContainerHomeWallbinLibrary.Visible = Views.Count > 1;
			MainController.Instance.MainForm.itemContainerHomeWallbinPage.Visible = !MainController.Instance.Settings.WallbinViewSettings.MultitabView;
			MainController.Instance.MainForm.ribbonBarHomeWallbin.RecalcLayout();
			MainController.Instance.MainForm.ribbonPanelHome.PerformLayout();
		}
 public static void fillPhongCombo(ComboBoxEdit cbb, List<PhongTap> l = null)
 {
     if (l == null)
     {
         l = PhongTapController.GetList();
     }
     cbb.Properties.Items.Clear();
     foreach(var p in l){
         cbb.Properties.Items.Add(p);
     }
     if (cbb.Properties.Items.Count > 0) {
         cbb.SelectedIndex = 0;
     }
 }
Example #17
0
 private ComboBoxEdit CreateComboBox(int x, int y, int id, string en_name)
 {
     var comboBoxValueList = propertyService.GetComboBoxValueByPropertyId(id);
     var cbo = new ComboBoxEdit();
     // 添加下拉框的值
     foreach (var boxvalue in comboBoxValueList)
     {
         cbo.Properties.Items.Add(boxvalue.Value);
     }
     cbo.Name = "cbo" + en_name;
     cbo.Size = new System.Drawing.Size(180, 20);
     cbo.Location = new System.Drawing.Point(x, y - 4);
     return cbo;
 }
Example #18
0
        private void Baund(DataTable dt, ComboBoxEdit cmb,string stField)
        {
            cmb.Properties.Items.Clear();

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmb.Properties.Items.Add(dt.Rows[i][stField]);
                }

                if (cmb.Properties.Items.Count > 0)
                    cmb.SelectedIndex = 0;
            }
        }
        public static ComboBoxEdit FillComboBoxEdit(string SqlString, string Campo, ComboBoxEdit CB)
        {

            OleDbCommand SentenciaSql = new OleDbCommand(SqlString, cnn);
            OleDbDataReader dr = SentenciaSql.ExecuteReader();
            while (dr.Read())
            {
                if (!CB.Properties.Items.Contains(dr[Campo].ToString()))
                {
                    CB.Properties.Items.Add(dr[Campo]);
                }
            }
            dr.Close();
            return CB;
        }
Example #20
0
 private void capturePersonPhone(TextEdit txtPersonPhone, ComboBoxEdit cmbPhoneType, ICollection<PersonPhoneDto> personPhones)
 {
     var personPhone = txtPersonPhone.Tag as PersonPhoneDto;
     if (txtPersonPhone.Text != null)
     {
         if (personPhone == null)
         {
             personPhone = new PersonPhoneDto();
         }
         personPhone.Phone = txtPersonPhone.Text;
         var phoneType = cmbPhoneType.SelectedItem as PhoneTypeDto;
         personPhone.PhoneTypeId = phoneType.Id;
         personPhones.Add(personPhone);
     }
 }
Example #21
0
        public static bool CheckUser(TextBox user, TextBox pass, ComboBoxEdit cbEdit,Button btn)
        {
            userid = 0;
            SqlConnection con = SqlCon();
             
            bool retUserst = false;
            string query = String.Empty;
            if(btn.Name == "btnSLogin")
            {
                query = "select * from sup.usertable";
                Usergroup = userGroup.Supreme;
            }
            if (btn.Name == "btnZlogin")
            {
                query = "select * from zah.usertable";
                Usergroup = userGroup.Zahid;
            }

            try
            {

                con.Open();
                SqlCommand cmd = new SqlCommand(query, con);
                SqlDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    if (dr["username"].ToString().ToLower().Trim().Equals(user.Text.Trim().ToLower()) & dr["userpass"].ToString().ToLower().Trim().Equals(pass.Text.Trim().ToLower()) & dr["usertype"].ToString().ToLower().Trim().Equals(cbEdit.SelectedItem.ToString().Trim().ToLower()))
                    {
                        retUserst = true;
                        UserLogin.UserName = dr["username"].ToString();
                        UserLogin.UserId = Convert.ToInt32(dr["userid"].ToString());
                        UserLogin.Usertype = dr["usertype"].ToString();
                        break;
                    }
                }
                dr.Close();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
            }
            return retUserst;
        }
Example #22
0
        /// <summary>
        /// 로딩작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnLoaded(object obj)
        {
            try
            {
                // 0.화면객체인스턴스화
                if (obj == null)
                {
                    return;
                }

                blk03DtlView    = obj as Blk03DtlView;
                cbMNG_CDE       = blk03DtlView.cbMNG_CDE;       //관리기관
                cbUPPER_FTR_CDE = blk03DtlView.cbUPPER_FTR_CDE; //상위블록
                cbUPPER_FTR_IDN = blk03DtlView.cbUPPER_FTR_IDN;

                btnBack   = blk03DtlView.btnBack;
                btnDelete = blk03DtlView.btnDelete;
                btnSave   = blk03DtlView.btnSave;

                //2.화면데이터객체 초기화
                InitDataBinding();


                //3.권한처리
                permissionApply();

                // 4.초기조회
                //DataTable dt = new DataTable();
                Hashtable param = new Hashtable();
                param.Add("sqlId", "SelectBlk03Dtl");
                param.Add("FTR_CDE", Dtl.FTR_CDE);
                param.Add("FTR_IDN", Dtl.FTR_IDN);

                Dtl = BizUtil.SelectObject(param) as BlkDtl;


                // cbUPPER_FTR_IDN 상위블록
                BizUtil.SetFTR_IDN(Dtl.UPPER_FTR_CDE, cbUPPER_FTR_IDN);

                // 콤보변경이벤트설정
                cbUPPER_FTR_CDE.SelectedIndexChanged += OnUpFtrCdeChanged;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #23
0
        /// <summary>
        /// 로드 바인딩
        /// </summary>
        /// <param name="obj"></param>
        private void OnLoaded(object obj)
        {
            if (obj == null)
            {
                return;
            }
            var values = (object[])obj;

            //1. 화면객체 인스턴스
            supDutListView = values[0] as SupDutListView;

            cbMNG_CDE = supDutListView.cbMNG_CDE;      //0.관리기관
            cbHJD_CDE = supDutListView.cbHJD_CDE;      //2.행정동
            cbSAA_CDE = supDutListView.cbSAA_CDE;      //7.관용도
            cbJHT_CDE = supDutListView.cbJHT_CDE;      //8.접합종류


            txtFTR_IDN = supDutListView.txtFTR_IDN;         //1.관리번호
            txtCNT_NUM = supDutListView.txtCNT_NUM;         //3.공사번호
            txtSHT_NUM = supDutListView.txtSHT_NUM;         //4.도엽번호

            txtPIP_LBL = supDutListView.txtPIP_LBL;         //9.관라벨
            txtPIP_DIP = supDutListView.txtPIP_DIP;         //10.구경

            dtIST_YMD_FROM = supDutListView.dtIST_YMD_FROM; //5.준공일자(이상)
            dtIST_YMD_TO   = supDutListView.dtIST_YMD_TO;   //6.준공일자(이하)
            dtIST_YMD_FROM.DisplayFormatString = "yyyy-MM-dd";
            dtIST_YMD_TO.DisplayFormatString   = "yyyy-MM-dd";


            //dtIST_YMD_FROM.EditValue = DateTime.Today.AddYears(-10);
            //dtIST_YMD_TO.EditValue = DateTime.Today;

            grid = supDutListView.grid;


            //2.화면데이터객체 초기화
            InitDataBinding();


            //3.권한처리
            permissionApply();

            //4.초기조회
            SearchAction(null);
        }
        private void comboBoxEdit_UUT类型_TextChanged(object sender, EventArgs e)
        {
            ComboBoxEdit combo = sender as ComboBoxEdit;

            switch (comboBoxEdit_UUT类型.Text + "-" + comboBoxEdit_测试模式.Text)
            {
            case "多遥DAM-R-自测模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DY_DAM_R_自测模式();
                break;

            case "多遥DAM-R-军检模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DY_DAM_R_军检模式();
                break;

            case "多遥DAM-R-环境试验模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DY_DAM_R_环境试验模式();
                break;

            case "小型DAM-R-自测模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DAM_R_自测模式();
                break;

            case "小型DAM-R-军检模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DAM_R_军检模式();
                break;

            case "小型DAM-R-环境试验模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DAM_R_环境试验模式();
                break;

            case "小型DAM-T-自测模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DAM_T_自测模式();
                break;

            case "小型DAM-T-军检模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DAM_T_军检模式();
                break;

            case "小型DAM-T-环境试验模式":
                ViewModuleManager.ChildModuleOf统计分析.CurrentDataCollectionModule = new DataCollection_DAM_T_环境试验模式();
                break;

            default:
                break;
            }
        }
Example #25
0
        public void LoadcbbTenNhom(ComboBoxEdit cbb)
        {
            for (int i = cbb.Properties.Items.Count - 1; i >= 0; i--)
            {
                cbb.Properties.Items.RemoveAt(i);
            }
            var nhom = from a in nhakhoa.NhomNguoiDungs
                       select new
            {
                a.TenNhom
            };

            foreach (var x in nhom)
            {
                cbb.Properties.Items.Add(x.TenNhom.Trim());
            }
        }
Example #26
0
        public void Laodcbb(ComboBoxEdit comboBoxEdit, string sql, string tencot)
        {
            SqlConnection  conn    = new SqlConnection(path);
            SqlCommand     command = new SqlCommand(sql, conn);
            SqlDataAdapter sqlData = new SqlDataAdapter(command);
            var            dt      = new DataTable();

            sqlData.Fill(dt);
            conn.Open();

            //var dr = command.ExecuteReader();
            foreach (DataRow row in dt.Rows)
            {
                comboBoxEdit.Properties.Items.Add(row[tencot]);
            }
            conn.Close();
        }
Example #27
0
        public static bool ValidarCampoVacio(ComboBoxEdit cmb, string mensaje, ToolTipController tooltip)
        {
            bool flag;

            if (string.IsNullOrEmpty(cmb.Text))
            {
                tooltip.HideHint();
                tooltip.ShowHint(mensaje, cmb, DevExpress.Utils.ToolTipLocation.LeftTop);
                flag = true;
            }
            else
            {
                flag = false;
            }

            return(flag);
        }
Example #28
0
        private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBoxEdit cb            = (ComboBoxEdit)sender;
            int          selectedIndex = cb.SelectedIndex;
            string       selectedValue = (string)cb.SelectedText;

            /*
             * thêm thông tin vào Mục thông tin hàng hóa
             */
            DMH mH = db.DMHs.FirstOrDefault(p => p.TenHang == selectedValue);

            if (mH != null)
            {
                this.txtDonGia.Text = mH.GiaBan.ToString();
                this.txtMaHang.Text = mH.MaHang.ToString();
            }
        }
Example #29
0
        public override void ObjectParse(object sender, ConvertEventArgs e)
        {
            ComboBoxEdit comboBoxEdit = ((sender as Binding).BindableComponent as ComboBoxEdit);

            if ((sender as Binding).DataSource is ReportAttribute)
            {
                ReportAttribute attr = (sender as Binding).DataSource as ReportAttribute;
                e.Value = new Font(attr.Font.Name, Math.Abs(float.Parse(comboBoxEdit.SelectedItem.ToString()
                                                                        )), attr.Font.Style);
            }
            else
            {
                TextAttibute attr = (sender as Binding).DataSource as TextAttibute;
                e.Value = new Font(attr.Font.Name, Math.Abs(float.Parse(comboBoxEdit.SelectedItem.ToString()
                                                                        )), attr.Font.Style);
            }
        }
Example #30
0
        public override void Run(object sender, System.EventArgs e)
        {
            DF2DApplication app = DF2DApplication.Application;

            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }

            ComboBoxEdit cbEdit = sender as ComboBoxEdit;
            string       scale  = cbEdit.SelectedItem.ToString();

            if (scale != null)
            {
                switch (scale)
                {
                case "1:500":
                    app.Current2DMapControl.MapScale = 500;
                    break;

                case "1:1000":
                    app.Current2DMapControl.MapScale = 1000;
                    break;

                case "1:2000":
                    app.Current2DMapControl.MapScale = 2000;
                    break;

                case "1:5000":
                    app.Current2DMapControl.MapScale = 5000;
                    break;

                case "1:10000":
                    app.Current2DMapControl.MapScale = 10000;
                    break;

                case "1:20000":
                    app.Current2DMapControl.MapScale = 20000;
                    break;
                }
                app.Current2DMapControl.Refresh();
            }
            else
            {
            }
        }
Example #31
0
        /// <summary>
        /// 部門コンボボックス項目設定
        /// </summary>
        private void CreateCbDepartment()
        {
            ComboBoxEdit cbe = new ComboBoxEdit(this.comboBoxDepartment);

            cbe.DepartmentList((comboBoxOfficeCode.Text == Sign.HQOffice) ? "DEPH" : "DEPB", 1);

            if (this.comboBoxOfficeCode.Text == Sign.HQOffice)
            {
                // 部門コンボボックス表示
                this.comboBoxDepartment.Visible = true;
            }
            else
            {
                // 部門コンボボックス非表示
                this.comboBoxDepartment.Visible = false;
            }
        }
Example #32
0
        private void create_cbDepart()
        {
            comboBoxDepartment.Visible = (comboBoxOffice.Text == Sign.HQOffice) ? true : false;

            ComboBoxEdit cbe = new ComboBoxEdit(comboBoxDepartment);

            cbe.DepartmentList((comboBoxOffice.Text == Sign.HQOffice) ? "DEPH" : "DEPB", 1);

            if (hp.OfficeCode == Sign.HQOfficeCode)
            {
                comboBoxDepartment.SelectedValue = (hp.Department == "0") ? "2" : hp.Department;
            }
            else
            {
                comboBoxDepartment.SelectedValue = "8";
            }
        }
Example #33
0
        /// <summary>
        /// 로드 바인딩
        /// </summary>
        /// <param name="obj"></param>
        private void OnLoaded(object obj)
        {
            if (obj == null)
            {
                return;
            }
            var values = (object[])obj;

            //1. 화면객체 인스턴스
            wtrTrkListView = values[0] as WtrTrkListView;

            cbMNG_CDE = wtrTrkListView.cbMNG_CDE;           //0.관리기관
            cbHJD_CDE = wtrTrkListView.cbHJD_CDE;           //2.행정동

            txtFTR_IDN = wtrTrkListView.txtFTR_IDN;         //1.관리번호
            txtSHT_NUM = wtrTrkListView.txtSHT_NUM;         //3.도엽번호

            txtRSR_NAM = wtrTrkListView.txtRSR_NAM;         //7.저수조명
            txtMNG_NAM = wtrTrkListView.txtMNG_NAM;         //8.관리자
            txtBLD_ADR = wtrTrkListView.txtBLD_ADR;         //9.BLD_ADR

            dtFNS_YMD_FROM = wtrTrkListView.dtFNS_YMD_FROM; //4.준공일자(이상)
            dtFNS_YMD_TO   = wtrTrkListView.dtFNS_YMD_TO;   //5.준공일자(이하)
            dtPMS_YMD      = wtrTrkListView.dtPMS_YMD;      //6.허가일자

            dtFNS_YMD_FROM.DisplayFormatString = "yyyy-MM-dd";
            dtFNS_YMD_TO.DisplayFormatString   = "yyyy-MM-dd";
            dtPMS_YMD.DisplayFormatString      = "yyyy-MM-dd";


            //dtFNS_YMD_FROM.EditValue = DateTime.Today.AddYears(-10);
            //dtFNS_YMD_TO.EditValue = DateTime.Today;

            grid = wtrTrkListView.grid;


            //2.화면데이터객체 초기화
            InitDataBinding();


            //3.권한처리
            permissionApply();

            //4.초기조회
            SearchAction(null);
        }
Example #34
0
        public void chkCostCenter1(Object LID, ComboBoxEdit cmb, LabelControl lbl, TextEdit txt, Panel plPanel)
        {
            try
            {
                cmb.Visible     = false;
                lbl.Visible     = false;
                plPanel.Visible = false;
                setting(cost);
                if (cost == "1")
                {
                    SqlDataAdapter sqla = new SqlDataAdapter();
                    DataSet        ds   = new DataSet();
                    // DateTime.ParseExact(dateString, format, provider)
                    sqla.SelectCommand = new SqlCommand(String.Format("Select Isnull(cstNumber,'0')cstNumber from tbl_AccountLedger where  ledgerId = '{0}' ", LID),
                                                        con);
                    sqla.Fill(ds);
                    DataTable dt;
                    dt = ds.Tables[0];
                    //if (dt != null && dt.Rows.Count > 0)
                    //{
                    //if (dt.Rows[0][0].ToString() == "1")
                    //{
                    cmb.Visible     = true;
                    lbl.Visible     = true;
                    plPanel.Visible = true;
                    loadCostCenter(cmb);
                    cmb.Focus();
                    //}
                    //else
                    //{
                    //    txt.Focus();
                    //    cmb.Visible = false;
                    //    lbl.Visible = false;

                    //}
                    // }
                }
                else
                {
                    txt.Focus();
                }
            }
            catch (Exception)
            {
            }
        }
        /// <summary>
        /// 绑定下拉列表控件为指定的数据字典列表
        /// </summary>
        /// <param name="combo">下拉列表控件</param>
        /// <param name="itemList">数据字典列表</param>
        /// <param name="defaultValue">控件默认值</param>
        /// <param name="emptyFlag">是否加入空值选项</param>
        public static void BindDictItems(this ComboBoxEdit combo, List <int> itemList, int defaultValue, bool emptyFlag = true)
        {
            combo.Properties.BeginUpdate();//可以加快
            combo.Properties.Items.Clear();
            combo.Properties.Items.AddRange(itemList);
            if (emptyFlag)
            {
                combo.Properties.Items.Insert(0, "");
            }

            if (itemList.Count > 0)
            {
                combo.SetDropDownValue(defaultValue.ToString());
            }

            combo.Properties.EndUpdate();//可以加快
        }
Example #36
0
        /// <summary>
        /// 材料编号
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="vend_code"></param>
        public static void LoadItemByVendCode(ComboBoxEdit cmb, string vend_code)
        {
            cmb.Properties.Items.Clear();
            StringBuilder sqlVendor = new StringBuilder("select item from pacsm_md_toner where fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' ");

            if (!string.IsNullOrEmpty(vend_code))
            {
                sqlVendor.Append(" and vend_code = '" + vend_code + "'");
            }
            DataTable dtVendor = OracleHelper.ExecuteDataTable(sqlVendor.ToString());

            for (int i = 0; i < dtVendor.Rows.Count; i++)
            {
                cmb.Properties.Items.Add(dtVendor.Rows[i]["item"].ToString());
            }
            cmb.SelectedIndex = -1;
        }
        public void LoadcbbTenNV(ComboBoxEdit cbb)
        {
            for (int i = cbb.Properties.Items.Count - 1; i >= 0; i--)
            {
                cbb.Properties.Items.RemoveAt(i);
            }
            var HT = from a in nhakhoa.NhanViens
                     select new
            {
                a.HoTen
            };

            foreach (var x in HT)
            {
                cbb.Properties.Items.Add(x.HoTen.Trim());
            }
        }
Example #38
0
        /// <summary>
        /// Preenche o grid de maneira assincrona e exibe uma barra de progresso durante o processo.
        /// Esse metódo deve ser chamad com o tratamento abaixo:
        /// if (this.comboBox.InvokeRequired)
        /// {
        ///     this.Invoke(new MethodInvoker(delegate{
        ///         Context.Entidade.FillGridControl(gridControl, taskName);
        ///      }));
        /// }
        /// É necessário disparar uma thread que estará em primeiro plano
        ///  new Thread(Tarefa).Start();
        /// </summary>
        /// </summary>
        /// <param name="comboBox"></param>ComboBox
        /// <param name="taskName"></param>Nome da tarefa
        public async void FillComboBoxEdit(ComboBoxEdit comboBox, string taskName = null)
        {
            XFrmWait.ShowSplashScreen(taskName);

            var lista = await FindAllAsync();

            comboBox.Properties.Items.Clear();
            comboBox.SelectedItem = null;
            comboBox.Properties.Items.AddRange(lista);

            if (lista.Count > 0)
            {
                comboBox.SelectedItem = lista[0];
            }
            //termina a barra
            XFrmWait.CloseSplashScreen();
        }
Example #39
0
        protected static int FindListControlIndex(
            ComboBoxEdit listControl,
            Predicate <object> finder)
        {
            var index = 0;

            foreach (var o in listControl.Properties.Items)
            {
                if (finder(o))
                {
                    return(index);
                }
                index++;
            }

            return(-1);
        }
Example #40
0
 /// <summary>
 /// 库位选择
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void repositoryItemComboBoxOStockLayout_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         ComboBoxEdit combo = sender as ComboBoxEdit;
         combo.Text = combo.Properties.Items[combo.SelectedIndex].ToString();
         Hashtable table = repositoryItemComboBoxOStockLayout.Tag as Hashtable;
         DataRow   row   = gvOtherInProduct.GetFocusedDataRow();
         row[gcStockLayout.FieldName] = combo.Properties.Items[combo.SelectedIndex];
         row["LayoutCode"]            = table[combo.SelectedIndex];
         gvOtherInProduct.BestFitColumns();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #41
0
        /// <summary>
        /// 로드 바인딩
        /// </summary>
        /// <param name="obj"></param>
        private void OnLoaded(object obj)
        {
            if (obj == null)
            {
                return;
            }
            var values = (object[])obj;

            //1. 화면객체 인스턴스
            cnstMngListView = values[0] as CnstMngListView;

            txtCNT_NUM      = cnstMngListView.txtCNT_NUM;
            txtCNT_NUM      = cnstMngListView.txtCNT_NUM;
            txtCNT_NAM      = cnstMngListView.txtCNT_NAM;
            txtCNT_LOC      = cnstMngListView.txtCNT_LOC;
            txtTCT_AMT_FROM = cnstMngListView.txtTCT_AMT_FROM;
            txtTCT_AMT_TO   = cnstMngListView.txtTCT_AMT_TO;
            cbCNT_CDE       = cnstMngListView.cbCNT_CDE;
            cbCTT_CDE       = cnstMngListView.cbCTT_CDE;

            dtBEG_YMD_FROM = cnstMngListView.dtBEG_YMD_FROM;
            dtBEG_YMD_TO   = cnstMngListView.dtBEG_YMD_TO;
            dtBEG_YMD_FROM.DisplayFormatString = "yyyy-MM-dd";
            dtBEG_YMD_TO.DisplayFormatString   = "yyyy-MM-dd";
            //dtBEG_YMD_FROM.EditValue = DateTime.Today.AddYears(-10);
            //dtBEG_YMD_TO.EditValue = DateTime.Today;

            dtFNS_YMD_FROM = cnstMngListView.dtFNS_YMD_FROM;
            dtFNS_YMD_TO   = cnstMngListView.dtFNS_YMD_TO;
            dtFNS_YMD_FROM.DisplayFormatString = "yyyy-MM-dd";
            dtFNS_YMD_TO.DisplayFormatString   = "yyyy-MM-dd";

            grid = cnstMngListView.grid;


            //2.화면데이터객체 초기화
            InitDataBinding();


            //3.권한처리
            permissionApply();


            //4.초기조회
            SearchAction(null);
        }
Example #42
0
        /// <summary>
        /// 초기조회 및 바인딩
        /// </summary>
        private void InitDataBinding()
        {
            try
            {
                cbMNG_CDE = valvFacListView.cbMNG_CDE;           //0.관리기관
                cbHJD_CDE = valvFacListView.cbHJD_CDE;           //2.행정동
                cbVAL_MOF = valvFacListView.cbVAL_MOF;           //7.형식
                cbVAL_MOP = valvFacListView.cbVAL_MOP;           //8.관재질
                cbVAL_FOR = valvFacListView.cbVAL_FOR;           //10.시설물형태

                txtFTR_IDN = valvFacListView.txtFTR_IDN;         //1.관리번호
                txtCNT_NUM = valvFacListView.txtCNT_NUM;         //3.공사번호
                txtSHT_NUM = valvFacListView.txtSHT_NUM;         //4.도엽번호
                txtVAL_DIP = valvFacListView.txtVAL_DIP;         //9.구경

                dtIST_YMD_FROM = valvFacListView.dtIST_YMD_FROM; //5.설치일자(이상)
                dtIST_YMD_TO   = valvFacListView.dtIST_YMD_TO;   //6.설치일자(이하)
                dtIST_YMD_FROM.DisplayFormatString = "yyyy-MM-dd";
                dtIST_YMD_TO.DisplayFormatString   = "yyyy-MM-dd";

                // cbMNG_CDE    0.관리기관
                BizUtil.SetCmbCode(cbMNG_CDE, "250101", "전체");

                // cbHJD_CDE    2.행정동
                BizUtil.SetCombo(cbHJD_CDE, "Select_ADAR_LIST", "HJD_CDE", "HJD_NAM", "전체");

                // cbVAL_MOF    7.형식
                BizUtil.SetCmbCode(cbVAL_MOF, "250016", "전체");

                // cbVAL_MOP    8.관재질
                BizUtil.SetCmbCode(cbVAL_MOP, "250015", "전체");

                // cbVAL_FOR    10.시설물형태
                BizUtil.SetCmbCode(cbVAL_FOR, "250007", "전체");


                // cbFTR_CDE 지형지물 - 변류시설만
                Func <DataRow, bool> filter = Row => (Row.Field <string>("FTR_CDE").Contains("SA2") && !Row.Field <string>("FTR_CDE").Contains("SA206"));
                BizUtil.SetCombo(valvFacListView.cbFTR_CDE, "Select_FTR_LIST", "FTR_CDE", "FTR_NAM", "전체", filter);
                //BizUtil.SetCombo(valvFacListView.cbFTR_CDE, "Select_FTR_LIST", "FTR_CDE", "FTR_NAM", "전체", Row => Row.Field<string>("FTR_CDE").Contains("SA2"));
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBoxLog(ex);
            }
        }
Example #43
0
        private void Baund(DataTable dt, ComboBoxEdit cmb, string stField)
        {
            cmb.Properties.Items.Clear();

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmb.Properties.Items.Add(dt.Rows[i][stField]);
                }

                if (cmb.Properties.Items.Count > 0)
                {
                    cmb.SelectedIndex = 0;
                }
            }
        }
Example #44
0
        public void checkhd(string active, string role, ComboBoxEdit cblhd, TextEdit txtshd, LookUpEdit ledv, SearchLookUpEdit sekh, TextEdit txtsdt, TextEdit txtfax, TextEdit txtndd, TextEdit txtcv, TextEdit txtguq, TextEdit txtsqpkd, MemoEdit txtnc, TextEdit txtltd, DateEdit dentd,
                            TextEdit txtnh, TextEdit txtstk, DateEdit denk, DateEdit denhh, TextEdit txthmn, TextEdit txthn, RadioButton rbhdnt, RadioButton rbhddh, RadioButton rbtm, RadioButton rbtc, RadioButton rbbl, MemoEdit txtddgh, DateEdit denl, DateEdit deng, DateEdit denqv, TextEdit txtnl, CheckEdit chetl, DateEdit dentl, CheckEdit chenqv, TextEdit txthmtd)
        {
            string makho       = gen.GetString("select * from Stock where StockCode='" + ledv.EditValue + "'");
            string makhach     = gen.GetString("select * from AccountingObject where AccountingObjectCode='" + sekh.EditValue + "'");
            int    loaihopdong = 1;

            if (rbhddh.Checked == true)
            {
                loaihopdong = 2;
            }
            int hinhthuc = 1;

            if (rbtc.Checked == true)
            {
                hinhthuc = 2;
            }
            else if (rbbl.Checked == true)
            {
                hinhthuc = 3;
            }
            int thanhly = 0;

            if (chetl.Checked == true)
            {
                thanhly = 1;
            }

            int ngayve = 0;

            if (chenqv.Checked == true)
            {
                ngayve = 1;
            }

            if (active == "0")
            {
                gen.ExcuteNonquery("insert ContractB(ContractID,ContractCode,ContractName,StockID,AccountingObjectID,SignerName,Position,License,IssuedBy,Change,ChangeDate,CompanyTel,CompanyFax,CompanyBankAccount,CompanyBankName,Proxy,SignedDate,EffectiveDate,DebtLimit,LimitDate,NoPay,NoContract,DeliveryPlace,Saved,Founded,Send,Received,Closed,ClosedDate,ParentContract,No,Inactive,DebtLimitMax)"
                                   + "values(newid(),N'" + txtshd.EditValue + "',N'" + cblhd.EditValue + "','" + makho + "','" + makhach + "',N'" + txtndd.EditValue + "',N'" + txtcv.EditValue + "',N'" + txtguq.EditValue + "',N'" + txtnc.EditValue + "',N'" + txtltd.EditValue + "','" + dentd.EditValue + "',N'" + txtsdt.EditValue + "',N'" + txtfax.EditValue + "',N'" + txtstk.EditValue + "',N'" + txtnh.EditValue + "',N'" + txtsqpkd.EditValue + "','" + denk.EditValue + "','" + denhh.EditValue + "',N'" + txthmn.EditValue + "',N'" + txthn.EditValue + "','" + hinhthuc + "','" + loaihopdong + "',N'" + txtddgh.EditValue + "',N'" + txtnl.EditValue + "','" + denl.EditValue + "','" + deng.EditValue + "','" + denqv.EditValue + "','" + thanhly + "','" + dentl.EditValue + "',N'" + txtshd.EditValue + "',0,'" + ngayve + "',N'" + txthmtd.EditValue.ToString().Replace(".", "") + "')");
            }
            else
            {
                gen.ExcuteNonquery("update ContractB set ContractCode=N'" + txtshd.EditValue + "',ContractName=N'" + cblhd.EditValue + "',StockID='" + makho + "',AccountingObjectID='" + makhach + "',SignerName=N'" + txtndd.EditValue + "',Position=N'" + txtcv.EditValue + "',License=N'" + txtguq.EditValue + "',IssuedBy=N'" + txtnc.EditValue + "',Change=N'" + txtltd.EditValue + "',ChangeDate=N'" + dentd.EditValue + "',CompanyTel=N'" + txtsdt.EditValue + "',CompanyFax=N'" + txtfax.EditValue + "',CompanyBankAccount=N'" + txtstk.EditValue + "',CompanyBankName=N'" + txtnh.EditValue + "',Proxy=N'" + txtsqpkd.EditValue + "',SignedDate='" + denk.EditValue + "',EffectiveDate='" + denhh.EditValue + "',DebtLimit='" + txthmn.EditValue + "',LimitDate='" + txthn.EditValue + "',NoPay=N'" + hinhthuc + "',NoContract=N'" + loaihopdong + "',DeliveryPlace=N'" + txtddgh.EditValue + "',Saved=N'" + txtnl.EditValue + "',Founded='" + denl.EditValue + "',Send='" + deng.EditValue + "',Received='" + denqv.EditValue + "',Closed='" + thanhly + "',ClosedDate='" + dentl.EditValue + "',ParentContract=N'" + txtshd.EditValue + "',Inactive='" + ngayve + "', DebtLimitMax=N'" + txthmtd.EditValue + "' where ContractID='" + role + "'");
            }
        }
Example #45
0
        public static void AlanlariTemizle(LayoutControlGroup layoutControlGroup,
                                           string[] haricTutulacakKontrolIsimleri = null)
        {
            foreach (var groupItem in layoutControlGroup.Items)
            {
                if (groupItem is LayoutControlItem)
                {
                    LayoutControlItem layoutControlItem = (LayoutControlItem)groupItem;

                    if (layoutControlItem is EmptySpaceItem)
                    {
                        continue;
                    }

                    if (!StringExistsInArray(layoutControlItem.Control.Name, haricTutulacakKontrolIsimleri))
                    {
                        if (layoutControlItem.Control is ComboBoxEdit)
                        {
                            ComboBoxEdit control = ((ComboBoxEdit)layoutControlItem.Control);

                            if (control.Properties.Items.Count > 0)
                            {
                                control.SelectedIndex = 0;
                            }
                        }
                        else if (layoutControlItem.Control is PictureEdit)
                        {
                            ((PictureEdit)layoutControlItem.Control).EditValue = null;
                        }
                        else if (layoutControlItem.Control is BaseEdit)
                        {
                            ((BaseEdit)layoutControlItem.Control).EditValue = null;
                        }
                        else
                        {
                            layoutControlItem.Control.Text = string.Empty;
                        }
                    }
                }
                else if (groupItem is LayoutControlGroup)
                {
                    AlanlariTemizle((LayoutControlGroup)groupItem, haricTutulacakKontrolIsimleri);
                }
            }
        }
 private void method_2(ComboBoxEdit comboBoxEdit_0, bool bool_0)
 {
     this.cboSourceLayer.Properties.Items.Clear();
     this.cboSourceLayer.Text = "";
     for (int i = 0; i < this.imap_0.LayerCount; i++)
     {
         ILayer layer = this.imap_0.get_Layer(i);
         if (layer is IFeatureLayer)
         {
             if ((layer as IFeatureLayer).FeatureClass != null)
             {
                 if (bool_0 && this.method_1(layer))
                 {
                     IFeatureLayer layer2 = layer as IFeatureLayer;
                     if ((layer2 as IFeatureSelection).SelectionSet.Count > 0)
                     {
                         comboBoxEdit_0.Properties.Items.Add(new LayerObjectWrap(layer));
                     }
                 }
                 else if (!bool_0)
                 {
                     if (this.chkUseBuffer.Checked)
                     {
                         if ((layer as IFeatureLayer).Selectable)
                         {
                             comboBoxEdit_0.Properties.Items.Add(new LayerObjectWrap(layer));
                         }
                     }
                     else
                     {
                         comboBoxEdit_0.Properties.Items.Add(new LayerObjectWrap(layer));
                     }
                 }
                 else
                 {
                     comboBoxEdit_0.Properties.Items.Add(new LayerObjectWrap(layer));
                 }
             }
         }
         else if (layer is IGroupLayer)
         {
             this.method_0(comboBoxEdit_0, layer as ICompositeLayer, bool_0);
         }
     }
 }
Example #47
0
        void repositoryItemComboBox1_EditValueChanged(object sender, EventArgs e)
        {
            ComboBoxEdit edit = sender as ComboBoxEdit;

            if (edit != null)
            {
                TransitionType value      = (TransitionType)edit.EditValue;
                BaseTransition transition = null;
                switch (value)
                {
                case TransitionType.Clock:
                    transition = new DevExpress.Utils.Animation.ClockTransition();
                    break;

                case TransitionType.Comb:
                    transition = new DevExpress.Utils.Animation.CombTransition();
                    break;

                case TransitionType.Cover:
                    transition = new DevExpress.Utils.Animation.CoverTransition();
                    break;

                case TransitionType.Dissolve:
                    transition = new DevExpress.Utils.Animation.DissolveTransition();
                    break;

                case TransitionType.Fade:
                    transition = new DevExpress.Utils.Animation.FadeTransition();
                    break;

                case TransitionType.Push:
                    transition = new DevExpress.Utils.Animation.PushTransition();
                    break;

                case TransitionType.Shape:
                    transition = new DevExpress.Utils.Animation.ShapeTransition();
                    break;

                case TransitionType.SlideFade:
                    transition = new DevExpress.Utils.Animation.SlideFadeTransition();
                    break;
                }
                this.workspaceManager1.TransitionType = transition;
            }
        }
Example #48
0
        /// <summary>
        /// The populate skin list combo.
        /// </summary>
        /// <param name="cmbSkinList">
        /// The cmb skin list.
        /// </param>
        public static void PopulateSkinListCombo(ComboBoxEdit cmbSkinList)
        {
            cmbSkinList.SelectedIndexChanged += CmbSkinList_SelectedIndexChanged;

            IEnumerable <string> skinList = from SkinContainer s in SkinManager.Default.Skins
                                            orderby s.SkinName
                                            select s.SkinName;

            foreach (string skinName in skinList)
            {
                if (!skinName.Contains("DevExpress") && !skinName.Contains("2008"))
                {
                    cmbSkinList.Properties.Items.Add(skinName);
                }
            }

            cmbSkinList.DataBindings.Add("Text", Get.Ui, "Skin");
        }
Example #49
0
        public static void SincronizaComboGlosa(ComboBoxEdit ComboBox, string Nombre)
        {
            string TextoCompara = "";

            ComboBox.SelectedIndex = 0;
            for (int i = 0; i < ComboBox.Properties.Items.Count; i++)
            {
                TextoCompara = ComboBox.Properties.Items[i].ToString().ToUpper();
                TextoCompara = TextoCompara.Trim();
                Nombre       = Nombre.ToUpper();
                Nombre       = Nombre.Trim();
                if (TextoCompara == Nombre)
                {
                    ComboBox.SelectedIndex = i;
                    break;
                }
            }
        }
Example #50
0
        public static void SetComboBox(ComboBoxEdit devCombobox, string value)
        {
            ComboBoxItemCollection items = devCombobox.Properties.Items;

            if (value.Length > 0)
            {
                for (int i = 0; i < items.Count; i++)
                {
                    if (items[i].ToString() == value)
                    {
                        devCombobox.SelectedIndex = i;
                        return;
                    }
                }
            }
            devCombobox.SelectedIndex = -1;
            devCombobox.Text          = value;
        }
Example #51
0
        /// <summary>
        /// 绑定下拉列表控件为指定的数据字典列表
        /// </summary>
        /// <param name="combo">下拉列表控件</param>
        /// <param name="itemList">数据字典列表</param>
        /// <param name="defaultValue">控件默认值</param>
        public static void BindDictItems(this ComboBoxEdit combo, List <CListItem> itemList, string defaultValue)
        {
            combo.Properties.BeginUpdate();//可以加快
            combo.Properties.Items.Clear();
            combo.Properties.Items.Add(new CListItem(Const.NoSeletValue.ToString(), Const.NoSelectMsg));
            combo.Properties.Items.AddRange(itemList);

            /*for (Int32 i = 0; i < itemList.Count; i++)
             * {
             *  combo.Properties.Items.Add(itemList[i]);
             * }*/

            if (!string.IsNullOrEmpty(defaultValue))
            {
                combo.SetComboBoxItem(defaultValue);
            }
            combo.Properties.EndUpdate();//可以加快
        }
 /*Thao tác đẩy các dữ liệu lên hộp combobox*/
 public void LoadCombo(DChuyenBay DCB, ComboBoxEdit cbMaDB, ComboBoxEdit cbMaMB, ComboBoxEdit cbDiemDen)
 {
     cbMaDB.Properties.Items.Clear(); cbMaMB.Properties.Items.Clear(); cbDiemDen.Properties.Items.Clear();
     DataTable dt = DA.TbView("select MaDuongBay,ViTri from DuongBay");
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             cbMaDB.Properties.Items.AddRange(new object[] { dt.Rows[i]["MaDuongBay"] });
             cbDiemDen.Properties.Items.AddRange(new object[] { dt.Rows[i]["ViTri"] });
         }
     }
     DataTable dt1 = DA.TbView("select MaMayBay from MayBay");
     if (dt1.Rows.Count > 0)
     {
         for (int i = 0; i < dt1.Rows.Count; i++)
         { cbMaMB.Properties.Items.AddRange(new object[] { dt1.Rows[i]["MaMayBay"] }); }
     }
 }
 /*Lấy ra dòng dữ liệu và gán vào các hộp text*/
 public void SelectCoDK(DDuongBay DDB, TextEdit txt1, TextEdit txt2
                           , TextEdit txt3, TextEdit txt4, ComboBoxEdit cb1)
 {
     try
     {
         string path = string.Format("Select * From DuongBay Where MaDuongBay='{0}'", DDB.MaDuongBay);
         DataTable dtt = DA.TbView(path);
         txt1.EditValue = dtt.Rows[0]["MaDuongBay"].ToString().Trim();
         txt2.EditValue = dtt.Rows[0]["ViTri"].ToString().Trim();
         txt3.EditValue = dtt.Rows[0]["ChieuDai"].ToString().Trim();
         txt4.EditValue = dtt.Rows[0]["ChieuRong"].ToString().Trim();
         cb1.EditValue = dtt.Rows[0]["TinhTrang"].ToString().Trim();
         dtt = null;
     }
     catch
     {
         XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !",
                                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #54
0
        public static string GetSelectedKeyValue(ComboBoxEdit cmb, int rowLoai)
        {
            string temp = "";
            string temp1 = "";
            foreach (var p in cmb.SelectedItems)
            {
                temp += p.ToString();
            }
            for (int i = 0; i < rowLoai; i++)
            {
                string key = cmb.GetKeyValue(i).ToString().Trim();
                if (temp.Contains(key))
                    if (temp1 == "")
                    {
                        temp1 += key;
                    }
                    else
                        temp1 = temp1 + ";" + key;
            }
            return temp1;

        }
Example #55
0
 private bool CoTrongComboBox(ComboBoxEdit cbEdit)
 {
     if (cbEdit.Properties.Items.Contains(cbEdit.SelectedItem))
     {
         return true;
     }
     return false;
 }
Example #56
0
 private void InitializeComponent()
 {
     this.cmbServers = new ComboBoxEdit();
     this.chkDefault = new CheckEdit();
     this.label1 = new Label();
     this.cmbServers.Properties.BeginInit();
     this.chkDefault.Properties.BeginInit();
     base.SuspendLayout();
     base.btOk.Location = new Point(0x40, 0x53);
     base.btOk.Name = "btOk";
     base.btCancel.Location = new Point(160, 0x53);
     base.btCancel.Name = "btCancel";
     this.cmbServers.EditValue = "";
     this.cmbServers.Location = new Point(80, 0x10);
     this.cmbServers.Name = "cmbServers";
     this.cmbServers.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
     this.cmbServers.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
     this.cmbServers.Size = new Size(0xb0, 0x15);
     this.cmbServers.TabIndex = 2;
     this.chkDefault.EditValue = true;
     this.chkDefault.Location = new Point(0x48, 0x30);
     this.chkDefault.Name = "chkDefault";
     this.chkDefault.Properties.Caption = "下次登录默认为此服务器";
     this.chkDefault.Size = new Size(0xb8, 0x13);
     this.chkDefault.TabIndex = 3;
     this.label1.AutoSize = true;
     this.label1.Location = new Point(0x19, 0x13);
     this.label1.Name = "label1";
     this.label1.Size = new Size(0x2d, 0x11);
     this.label1.TabIndex = 4;
     this.label1.Text = "服务器";
     this.AutoScaleBaseSize = new Size(6, 15);
     base.ClientSize = new Size(0x124, 0x75);
     base.Controls.Add(this.label1);
     base.Controls.Add(this.chkDefault);
     base.Controls.Add(this.cmbServers);
     base.Name = "ServerDialog";
     this.Text = "选择使用的远程服务器";
     base.Controls.SetChildIndex(this.cmbServers, 0);
     base.Controls.SetChildIndex(this.chkDefault, 0);
     base.Controls.SetChildIndex(this.label1, 0);
     base.Controls.SetChildIndex(base.btOk, 0);
     base.Controls.SetChildIndex(base.btCancel, 0);
     this.cmbServers.Properties.EndInit();
     this.chkDefault.Properties.EndInit();
     base.ResumeLayout(false);
 }
Example #57
0
 /// <summary>
 ///  自定义扩展列
 /// </summary>
 private void extendPropertyGen()
 {
     // 自动加载扩展的列
     try
     {
         document_type doctype = WcfServiceLocator.Create<IDocPropertyBuild>().getDocumentProperty(document);
         docPropertyList = doctype.DocProperty;
         int Location_y = 10;
         int actlocation = 0;
         for (int i = 0; i < docPropertyList.Count; i++)
         {
             doc_attached_property docp = docPropertyList[i];
             if (!docp.is_display) continue;
             if (actlocation % 2 == 0)
             {
                 // 为第一列
                 LabelControl lbk1 = new LabelControl();
                 lbk1.Name = "lbk1" + i;
                 lbk1.Text = docp.cn_name + ":";
                 lbk1.Size = new System.Drawing.Size(60, 15);
                 lbk1.Location = new System.Drawing.Point(25, Location_y);
                 this.DocManagement_DocModify_tabContr_AdditionalInfor.Controls.Add(lbk1);
                 if (docp.input_type == "SEL")
                 {
                     ComboBoxEdit cbx1 = new ComboBoxEdit();
                     // 添加下拉框的值
                     foreach (doc_combobox_value boxvalue in docp.ComboxValue)
                     {
                         cbx1.Properties.Items.Add(boxvalue.value);
                     }
                     cbx1.Name = docp.en_name;
                     cbx1.Size = new System.Drawing.Size(280, 20);
                     cbx1.Location = new System.Drawing.Point(108, Location_y - 4);
                     this.DocManagement_DocModify_tabContr_AdditionalInfor.Controls.Add(cbx1);
                 }
                 else
                 {
                     TextEdit txtk1 = new TextEdit();
                     txtk1.Name = docp.en_name;
                     txtk1.Size = new System.Drawing.Size(280, 20);
                     txtk1.Location = new System.Drawing.Point(108, Location_y - 4);
                     this.DocManagement_DocModify_tabContr_AdditionalInfor.Controls.Add(txtk1);
                 }
             }
             else
             {
                 // 为第二列
                 LabelControl lbk2 = new LabelControl();
                 lbk2.Name = "lbk2" + i;
                 lbk2.Text = docp.cn_name + ":";
                 lbk2.Size = new System.Drawing.Size(60, 15);
                 lbk2.Location = new System.Drawing.Point(412, Location_y);
                 this.DocManagement_DocModify_tabContr_AdditionalInfor.Controls.Add(lbk2);
                 if (docp.input_type == "SEL")
                 {
                     ComboBoxEdit cbx1 = new ComboBoxEdit();
                     // 添加下拉框的值
                     foreach (doc_combobox_value boxvalue in docp.ComboxValue)
                     {
                         cbx1.Properties.Items.Add(boxvalue.value);
                     }
                     cbx1.Name = docp.en_name;
                     cbx1.Size = new System.Drawing.Size(280, 20);
                     cbx1.Location = new System.Drawing.Point(108, Location_y - 4);
                     this.DocManagement_DocModify_tabContr_AdditionalInfor.Controls.Add(cbx1);
                 }
                 else
                 {
                     TextEdit txtk2 = new TextEdit();
                     txtk2.Name = docp.en_name;
                     txtk2.Size = new System.Drawing.Size(264, 20);
                     txtk2.Location = new System.Drawing.Point(500, Location_y - 4);
                     this.DocManagement_DocModify_tabContr_AdditionalInfor.Controls.Add(txtk2);
                 }
                 Location_y = Location_y + 30;
             }
             actlocation++;
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
 private static void PopulateTheMonthCombos(ComboBoxEdit combo)
 {
     int[] months = new int[12];
     for (int i = 0; i < 12; i++)
     {
         months[i] = i + 1;
     }
     combo.Properties.Items.AddRange(months);
 }
 private static void PopulateTheYearCombo(ComboBoxEdit combo)
 {
     int[] years = new int[25];
     for (int i = 0; i < 25; i++)
     {
         years[i] = 2003 + i;
     }
     combo.Properties.Items.AddRange(years);
 }
        private void RenderGenreMapping()
        {
            int i = 0;
            foreach (GenreMapping map in _genreMapping)
            {
                LabelControl lblSource = new LabelControl();
                lblSource.Name = "lblSource" + i;
                lblSource.Text = map.SourceGenre;
                lblSource.Dock = DockStyle.Fill;
                tableLayoutPanel1.Controls.Add(lblSource);
                ComboBoxEdit cbeGenre = new ComboBoxEdit();
                cbeGenre.Name = "cbeGenre" + i;
                cbeGenre.Text = map.DestinationGenre;
                cbeGenre.Properties.Items.AddRange(_genreList);

                // Add the genre from the plugin into the combo box if not allready there.
                if (!_genreList.Contains(map.SourceGenre))
                {
                    cbeGenre.Properties.Items.Add(map.SourceGenre);
                }

                cbeGenre.Dock = DockStyle.Fill;
                tableLayoutPanel1.Controls.Add(cbeGenre);
                RadioGroup grpActions = new RadioGroup();
                grpActions.Name = "grpActions" + i;
                grpActions.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(MapActionEnum.Ignore, "Ignore"));
                grpActions.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(MapActionEnum.Map, "Map"));
                grpActions.SelectedIndex = map.Action == MapActionEnum.Ignore ? 0 : 1;
                grpActions.Properties.Columns = 2;
                grpActions.Height = 25;
                grpActions.Dock = DockStyle.Fill;
                tableLayoutPanel1.Controls.Add(grpActions);
                i++;
            }
        }