Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pTipoAlergia"></param>
        /// <returns></returns>
        DevExpress.XtraEditors.CheckedComboBoxEdit GetCheckedCombo(TipoAlergia pTipoAlergia)
        {
            DevExpress.XtraEditors.CheckedComboBoxEdit checkedCombo = null;

            switch (pTipoAlergia)
            {
            case TipoAlergia.AnimalAllergy:
            {
                checkedCombo = checkedCombo_PetAllergy;
                break;
            }

            case TipoAlergia.ChemicalAllergy:
            {
                checkedCombo = checkedCombo_ChemicalAllergy;
                break;
            }

            case TipoAlergia.FoodAllergy:
            {
                checkedCombo = checkedCombo_FoodAllergy;
                break;
            }

            case TipoAlergia.InsectAllergy:
            {
                checkedCombo = checkedCombo_InsectAllergy;
                break;
            }

            case TipoAlergia.MedicamentsAllergy:
            {
                checkedCombo = checkedCombo_MedicamentsAllergy;
                break;
            }

            case TipoAlergia.MiteAllergy:
            {
                //checkedCombo = checkedCombo_MiteAllergies;
                break;
            }

            case TipoAlergia.PollenAllergy:
            {
                checkedCombo = checkedCombo_Pollen;
                break;
            }

            case TipoAlergia.SunAllergy:
            {
                //checkedCombo = checkedCombo_Sun;
                break;
            }
            }

            return(checkedCombo);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pTipoAlergia"></param>
        void InitializeComboBoxDatasource(TipoAlergia pTipoAlergia)
        {
            DevExpress.XtraEditors.CheckedComboBoxEdit checkedCombo = GetCheckedCombo(pTipoAlergia);
            var list = Controller.AllergiesItemTypesList.Where(p => p.IdParametroRef.Equals((int)pTipoAlergia)).ToArray <ParametroBE>();

            checkedCombo.Properties.DataSource = list;
            checkedCombo.Refresh();
            checkedCombo.RefreshEditValue();
        }
Exemplo n.º 3
0
 private void InitionData(DevExpress.XtraEditors.CheckedComboBoxEdit comboBox, string displayMember, string valueMember, string nullTest, string cnStr, object post)
 {
     comboBox.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
     comboBox.Properties.DataSource    = post;
     comboBox.Properties.DisplayMember = displayMember;
     comboBox.Properties.ValueMember   = valueMember;
     comboBox.Properties.NullText      = nullTest;
     comboBox.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] {
         new DevExpress.XtraEditors.Controls.LookUpColumnInfo(valueMember, "ID", 15, DevExpress.Utils.FormatType.None, "", false, DevExpress.Utils.HorzAlignment.Default),
         new DevExpress.XtraEditors.Controls.LookUpColumnInfo(displayMember, cnStr)
     });
 }
Exemplo n.º 4
0
        private void chk_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox chk = (CheckBox)sender;

            DevExpress.XtraEditors.CheckedComboBoxEdit checkedCombo = null;
            TipoAlergia wTipoAlergia = (TipoAlergia)Enum.Parse(typeof(TipoAlergia), chk.Tag.ToString());

            checkedCombo = GetCheckedCombo(wTipoAlergia);
            if (checkedCombo != null)
            {
                if (checkedCombo.Properties.Items.Count != 0)
                {
                    checkedCombo.Enabled = chk.Checked;
                }
            }
            textEdit1.Text = GetComboValues();
        }
Exemplo n.º 5
0
        public virtual void SetContrMoveNext(string strContrName, bool blPrev, int iSeed)
        {
            int index = arrContrSeq.IndexOf(strContrName);

            if (index == -1)
            {
                return;
            }
            if (!blPrev && index == arrContrSeq.Count - 1 || blPrev && index == 0)
            {
                return;
            }
            if (FocusedControl.GetType().ToString() == "DevExpress.XtraEditors.CheckedComboBoxEdit")
            {
                DevExpress.XtraEditors.CheckedComboBoxEdit cklis = FocusedControl as DevExpress.XtraEditors.CheckedComboBoxEdit;
                string   strText  = string.Empty;
                string[] arrTexts = cklis.Text.Split(",,".ToCharArray());

                foreach (CheckedListBoxItem item in cklis.Properties.Items)
                {
                    foreach (string strT in arrTexts)
                    {
                        string strTxt = strT.Trim();
                        if (strTxt == string.Empty)
                        {
                            continue;
                        }

                        if (item.Value.ToString().ToLower() == strTxt.ToLower() ||
                            item.Description.ToLower() == strTxt.ToLower())
                        {
                            strText += strText == string.Empty ? item.Value.ToString() : "," + item.Value.ToString();
                        }
                    }
                }
                cklis.EditValue = strText;
                cklis.RefreshEditValue();
            }

            int iFidx = 0;

            if (blPrev)
            {
                iFidx = index - iSeed < 0 ? 0 : index - iSeed;
            }
            else
            {
                iFidx = index + iSeed > arrContrSeq.Count - 1 ? arrContrSeq.Count - 1 : index + iSeed;
            }

            Control[] contrs = FocusedControl.Parent.Controls.Find(arrContrSeq[iFidx], false);
            if (contrs.Length <= 0)
            {
                return;
            }

            Control contr = contrs[0];

            if (contr is BaseEdit)
            {
                BaseEdit bse = contr as BaseEdit;
                if (bse.Properties.ReadOnly || !bse.Visible)
                {
                    SetContrMoveNext(arrContrSeq[iFidx], blPrev, 1);
                    return;
                }
            }
            else if (contr is ProduceManager.UcTxtPopup)
            {
                ProduceManager.UcTxtPopup bc = contr as ProduceManager.UcTxtPopup;
                if (bc.ReadOnly || !bc.Visible)
                {
                    SetContrMoveNext(arrContrSeq[iFidx], blPrev, 1);
                    return;
                }
            }
            else if (contr is ProduceManager.UcTreeList)
            {
                ProduceManager.UcTreeList bc = contr as ProduceManager.UcTreeList;
                if (bc.ReadOnly || !bc.Visible)
                {
                    SetContrMoveNext(arrContrSeq[iFidx], blPrev, 1);
                    return;
                }
            }
            switch (contr.GetType().ToString())
            {
            case "DevExpress.XtraEditors.TextEdit":
                DevExpress.XtraEditors.TextEdit txt = contr as DevExpress.XtraEditors.TextEdit;
                txt.Focus();
                txt.SelectAll();
                break;

            case "DevExpress.XtraEditors.MemoEdit":
                DevExpress.XtraEditors.MemoEdit mTxt = contr as DevExpress.XtraEditors.MemoEdit;
                mTxt.Focus();
                mTxt.SelectAll();
                break;

            case "DevExpress.XtraEditors.SimpleButton":
                DevExpress.XtraEditors.SimpleButton btn = contr as DevExpress.XtraEditors.SimpleButton;
                btn.Select();
                break;

            case "DevExpress.XtraEditors.LookUpEdit":
                DevExpress.XtraEditors.LookUpEdit dpl = contr as DevExpress.XtraEditors.LookUpEdit;
                dpl.Focus();
                dpl.ShowPopup();
                break;

            case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                DevExpress.XtraEditors.CheckedComboBoxEdit ckcob = contr as DevExpress.XtraEditors.CheckedComboBoxEdit;
                ckcob.Focus();
                ckcob.SelectAll();
                break;

            case "DevExpress.XtraEditors.DateEdit":
                DevExpress.XtraEditors.DateEdit dt = contr as DevExpress.XtraEditors.DateEdit;
                dt.Focus();
                dt.Select();
                break;

            case "ExtendControl.ExtPopupTree":
                ExtendControl.ExtPopupTree ext = contr as ExtendControl.ExtPopupTree;
                ext.Focus();
                ext.ShowPopup();
                break;

            case "ProduceManager.UcTxtPopup":
                ProduceManager.UcTxtPopup ucp = contr as ProduceManager.UcTxtPopup;
                ucp.Focus();
                ucp.ShowPopup();
                break;

            case "ProduceManager.UcTreeList":
                ProduceManager.UcTreeList uct = contr as ProduceManager.UcTreeList;
                uct.Focus();
                uct.ShowPopup();
                break;

            case "DevExpress.XtraEditors.ComboBoxEdit":
                DevExpress.XtraEditors.ComboBoxEdit cob = contr as DevExpress.XtraEditors.ComboBoxEdit;
                cob.Focus();
                cob.ShowPopup();
                break;

            default:
                break;
            }
        }