Exemple #1
0
        private void JoinAnchorComboBox_Properties_Enter(object sender, EventArgs e)
        {
            GetCalcFieldForm();             // get latest values

            CalcField       cf = CalcField;
            CalcFieldColumn cfc;

            HashSet <MetaTable> tableSet = new HashSet <MetaTable>();

            ComboBoxItemCollection items = JoinAnchorComboBox.Properties.Items;

            items.Clear();
            items.Add("(none)");

            for (int ci = 0; ci < cf.CfCols.Count; ci++)
            {
                CalcFieldColumn cfCol = cf.CfCols[ci];
                if (cfCol.MetaColumn == null)
                {
                    continue;
                }
                MetaTable mt = cfCol.MetaColumn.MetaTable;
                if (tableSet.Contains(mt))
                {
                    continue;
                }

                tableSet.Add(mt);
                items.Add(mt.Label);
            }

            return;
        }
Exemple #2
0
        public static void DataBind(ComboBoxItemCollection collection, IEnumerable dataSource,
                                    string valueMemberName, string tagMemberName)
        {
            if (CollectionUtils.IsNullOrEmpty(dataSource))
            {
                collection.Clear();
                return;
            }
            MemberInfo valueMember = ReflectionUtils.GetInstanceMember <object>(valueMemberName);
            MemberInfo tagMember   = null;

            if (!string.IsNullOrEmpty(tagMemberName))
            {
                tagMember = ReflectionUtils.GetInstanceMember <object>(tagMemberName);
            }
            collection.BeginUpdate();
            try
            {
                throw new NotImplementedException();
            }
            finally
            {
                collection.EndUpdate();
            }
        }
Exemple #3
0
        protected void ShowForm2(Evaluator ev)
        {
            ComboBoxItemCollection cols = comboBoxEdit1.Properties.Items;

            this.ev = ev;
            cols.Clear();

            if (ev.Variables.VarDictionary.Count > 0)
            {
                cols.Add("[Variabel]");
            }

            foreach (string str in ev.ObjValues.GetListObjectName())
            {
                if (str.Length == 0)
                {
                    cols.Add("[General]");
                }
                else
                {
                    cols.Add(str);
                }
            }

            if (cols.Count > 0)
            {
                comboBoxEdit1.SelectedIndex = 0;
            }
            Show(BaseWinFramework._MdiParent);
        }
        private void CheckKart()//Kart numarasının olması durumunda numaraya göre kart sınıfının verilerini çeker.
        {
            KartlarContext contextKartlar = new KartlarContext();
            List <Kartlar> kartlar        = contextKartlar.GetAllCards();

            ComboBoxItemCollection coll = KartNoTextEdit.Properties.Items;

            coll.Clear();
            coll.BeginUpdate();
            try
            {
                foreach (Kartlar item in kartlar)
                {
                    coll.Add(item._KartNo.ToString());
                }
            }
            finally
            {
                coll.EndUpdate();
            }
            KartNoTextEdit.SelectedIndex = -1;

            if (string.IsNullOrEmpty(KartNoTextEdit.Text))//kart numarası olmadığı durumda tool'lara veri işlemek kapalıdır.
            {
                ToolBoxEdits(false);
            }
        }
        private void InitComboHtmlExportType()
        {
            ComboBoxItemCollection collExportHtml = edtExportHtmlType.Properties.Items;

            collExportHtml.BeginUpdate();
            collExportHtml.Clear();
            collExportHtml.Add(ExportRootTag.Body);
            collExportHtml.Add(ExportRootTag.Html);
            collExportHtml.EndUpdate();
            edtExportHtmlType.SelectedIndex = 0;
            htmlExportType = ExportRootTag.Body;
        }
Exemple #6
0
        /// <summary>
        /// Setup the control for specified view
        /// </summary>
        /// <param name="view"></param>

        public void Setup(
            DataTableMapMsx dataTableMap,
            EventHandler callerEditValueChangedEventHandler = null)
        {
            InSetup      = true;
            DataTableMap = dataTableMap;

            CallerEditValueChangedHandler = callerEditValueChangedEventHandler;

            QueryTablesComboBox.Text         = "";
            QueryTablesComboBox.SelectedItem = null;

            ComboBoxItemCollection items = QueryTablesComboBox.Properties.Items;

            items.Clear();

            QueryTablesComboBox.Text = "";

            AssertMx.IsNotNull(Query, "Query");

            foreach (QueryTable qtEnum in Query.Tables)
            {
                items.Add(new ComboBoxItem(new LabeledUiItem(qtEnum.ActiveLabel, qtEnum)));
            }

            items.Add(AllTablesItem);

            items.Add(NoTablesItem);

            QueryTable qt = DataTableMap?.QueryTable;

            if (dataTableMap.IsMappedToSingleQueryTable)
            {
                QueryTablesComboBox.Text         = qt.ActiveLabel;
                QueryTablesComboBox.SelectedItem = new LabeledUiItem(qt.ActiveLabel, qt);
            }

            else if (dataTableMap.IsMappedToAllQueryTables)             // if cols are mapped assume all tables
            {
                QueryTablesComboBox.Text         = AllTablesItem.Label;
                QueryTablesComboBox.SelectedItem = AllTablesItem;
            }

            else             // not mapped to any tables
            {
                QueryTablesComboBox.Text         = NoTablesItem.Label;
                QueryTablesComboBox.SelectedItem = NoTablesItem;
            }

            InSetup = false;

            return;
        }
        private void InitComboCssExportType()
        {
            ComboBoxItemCollection collCssStyle = edtCssStyleType.Properties.Items;

            collCssStyle.BeginUpdate();
            collCssStyle.Clear();
            collCssStyle.Add(CssPropertiesExportType.Style);
            collCssStyle.Add(CssPropertiesExportType.Link);
            collCssStyle.Add(CssPropertiesExportType.Inline);
            collCssStyle.EndUpdate();
            edtCssStyleType.SelectedIndex = 0;
            cssExportType = CssPropertiesExportType.Style;
        }
Exemple #8
0
        /// <summary>
        /// Gridde alanların listelenmesi ile alan isimleri de ortaya çıkar. Bu alan isimleri database'deki alan
        /// isimleri ile eşleştirme amacıyla tüm comboboxlara yüklenir. Daha sonra ekleme için, gridde'ki hangi alan
        /// database'deki hangi alana eklenecek seçilir.
        /// </summary>
        /// <param name="cmb"></param>
        private void BaslikYukle(ComboBoxEdit cmb)
        {
            ComboBoxItemCollection data = cmb.Properties.Items;

            data.Clear();
            data.BeginUpdate();
            data.Add("");
            for (int i = 0; i < gridListe.Columns.Count; i++)
            {
                data.Add(gridListe.Columns[i].FieldName);
            }
            data.EndUpdate();
            cmb.SelectedIndex = 0;
        }
Exemple #9
0
        private void CargarCiudades(Int64 idPais)
        {
            ciudades = clsParametros.ListarCiudades(idPais);

            ComboBoxItemCollection coll = cboCiudad.Properties.Items;

            coll.Clear();
            coll.Add(Utils.Utils.ObtenerPrimerItem());
            foreach (var list in ciudades)
            {
                coll.Add(list);
            }
            cboCiudad.SelectedIndex = 0;
        }
Exemple #10
0
        private void cargarComunas(Int64 idCiudad)
        {
            IList <clsComuna> comunas = clsParametros.ListarComunas(idCiudad);

            ComboBoxItemCollection coll = cboComuna.Properties.Items;

            coll.Clear();
            coll.Add(Utils.Utils.ObtenerPrimerItem());
            foreach (var list in comunas)
            {
                coll.Add(list);
            }
            cboComuna.SelectedIndex = 0;
        }
Exemple #11
0
        /// <summary>
        /// Setup a dropdown control from a dictionary
        /// </summary>
        /// <param name="items">Control item collection to fill</param>
        /// <param name="dictName">Dictionary name, null to reset control</param>

        public static void SetListControlItemsFromDictionary(
            ComboBoxItemCollection items,
            string dictName,
            bool removeDuplicates)
        {
            items.Clear();
            if (String.IsNullOrEmpty(dictName))
            {
                return;
            }

            List <string> words = DictionaryMx.GetWords(dictName, removeDuplicates);

            if (words == null)
            {
                return;
            }
            items.AddRange(words);
            return;
        }
Exemple #12
0
        private void comboBoxEdit3_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbAdapterType.SelectedIndex == (int)CANBusAdapter.COMBI ||
                cbAdapterType.SelectedIndex == (int)CANBusAdapter.ELM327 ||
                cbAdapterType.SelectedIndex == (int)CANBusAdapter.JUST4TRIONIC ||
                cbAdapterType.SelectedIndex == (int)CANBusAdapter.MXWIFI)
            {
                btnAdapterConfiguration.Enabled = true;
            }
            else
            {
                btnAdapterConfiguration.Enabled = false;
            }

            if (cbAdapterType.SelectedIndex != -1)
            {
                string[] adapters = ITrionic.GetAdapterNames((CANBusAdapter)cbAdapterType.SelectedIndex);
                ComboBoxItemCollection collection = cbAdapter.Properties.Items;
                collection.BeginUpdate();
                collection.Clear();
                foreach (string adapter in adapters)
                {
                    collection.Add(adapter);
                }
                collection.EndUpdate();

                if (adapters.Length > 0)
                {
                    cbAdapter.SelectedIndex = 0;
                    cbAdapter.Enabled       = true;
                }
                else
                {
                    cbAdapter.SelectedIndex = -1;
                    cbAdapter.Enabled       = false;
                }
            }
        }
 void CreateItems(IEnumerable<string> enumerable1, ComboBoxItemCollection boxItems) {
     boxItems.Clear();
     boxItems.AddRange(enumerable1.Select(s => new ComboBoxItem(s)).ToList());
 }
Exemple #14
0
        //private void InitPopupMenu()
        //{
        //    try
        //    {
        //        string categoryLabel = "";
        //        ArrayList categoryList = new ArrayList();
        //        //Load up an array list for unique, non-blank iterating
        //        foreach (DataRow row in clauseHeaderTable.Rows)
        //        {
        //            categoryLabel = row["Category"].ToString();
        //            if (categoryList.IndexOf(categoryLabel) == -1 &&
        //                categoryLabel.Trim().Length > 0)
        //                categoryList.Add(categoryLabel);
        //        }

        //        categoryList.Sort();
        //        BarManager bManager = new BarManager();
        //        string filterStr = "";
        //        //For each item in array list, select all items
        //        for (int i = 0; i < categoryList.Count; i++)
        //        {
        //            categoryLabel = categoryList[i].ToString();
        //            DevExpress.XtraBars.BarSubItem barSubItem = new DevExpress.XtraBars.BarSubItem(bManager, categoryLabel);

        //            filterStr = "Category = '" + categoryLabel + "'";
        //            foreach (DataRow row in clauseHeaderTable.Select(filterStr))
        //            {
        //                BarItem item = new BarButtonItem();
        //                item.Caption = row["ShortName"].ToString();
        //                item.Tag = (int)row["PrmntConfirmClauseId"];
        //                item.ItemClick += ClauseBtnClick;
        //                barSubItem.AddItem(item);
        //            }
        //            pmenuEditContract.AddItem(barSubItem);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw new Exception(FORM_NAME + ".InitPopupMenu: " + ex.Message);
        //    }
        //}

        //private string GetClauseBodyText(int APrmntConfirmClauseId)
        //{
        //    string bodyText = "";
        //    try
        //    {
        //        string filterStr = "PrmntConfirmClauseId = '" + APrmntConfirmClauseId.ToString() + "'";
        //        foreach (DataRow row in clauseBodyTable.Select(filterStr))
        //        {
        //            bodyText += row["Body"].ToString();
        //        }
        //        return bodyText;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw new Exception(FORM_NAME + ".GetClauseBodyText: " + ex.Message);
        //    }
        //}

        private void InitStatusComboBox(string ATradingSystem, string ACurrentStatusCode,
                                        bool AContractOkAccess, bool AIsLondonTrade, string APreparerCanSendFlag)
        {
            try
            {
                //Initialize
                //5/27/09 Israel -- Creator can't approve
                barComboWorkflowStatus.EditValue = ACurrentStatusCode;

                ComboBoxItemCollection collection = (barComboWorkflowStatus.Edit as RepositoryItemComboBox).Items;
                collection.BeginUpdate();

                //Israel 9/17/2015 -- previous editor was re-created, making clearing it unnecessary.
                collection.Clear();

                //Israel 9/18/2015
                barBtnWorkflowSave.Enabled     = true;
                barComboWorkflowStatus.Enabled = true;
                APreparerCanSendFlag           = (!string.IsNullOrEmpty(APreparerCanSendFlag)) ? APreparerCanSendFlag.ToUpper() : "";
                switch (ACurrentStatusCode)
                {
                case "NEW":
                    collection.Add("PREP");
                    collection.Add("EXT_REVIEW");
                    //if (isContract)
                    //  collection.Add("TRADER");
                    collection.Add("MGR");
                    if (AContractOkAccess || (APreparerCanSendFlag.Equals("Y")))
                    {
                        collection.Add("OK_TO_SEND");
                    }
                    //Override for new
                    barComboWorkflowStatus.EditValue = "PREP";
                    break;

                case "PREP":
                    collection.Add("EXT_REVIEW");
                    //if (isContract)
                    //    collection.Add("TRADER");
                    collection.Add("MGR");
                    if (AContractOkAccess || (APreparerCanSendFlag.Equals("Y")))
                    {
                        collection.Add("OK_TO_SEND");
                    }
                    break;

                case "EXT_REVIEW":
                    collection.Add("PREP");
                    //if (isContract)
                    //    collection.Add("TRADER");
                    collection.Add("MGR");
                    if (AContractOkAccess || (APreparerCanSendFlag.Equals("Y")))
                    {
                        collection.Add("OK_TO_SEND");
                    }
                    break;

                case "TRADER":
                    collection.Add("PREP");
                    collection.Add("EXT_REVIEW");
                    //if (isContract)
                    //    collection.Add("TRADER");
                    collection.Add("MGR");
                    break;

                case "MGR":
                    collection.Add("PREP");
                    collection.Add("EXT_REVIEW");
                    //if (isContract)
                    //    collection.Add("TRADER");
                    collection.Add("MGR");
                    if (AContractOkAccess || (APreparerCanSendFlag.Equals("Y")))
                    {
                        collection.Add("OK_TO_SEND");
                    }
                    break;

                case "OK_TO_SEND":
                    collection.Add("PREP");
                    collection.Add("EXT_REVIEW");
                    //if (isContract)
                    //    collection.Add("TRADER");
                    collection.Add("MGR");
                    if (AContractOkAccess || (APreparerCanSendFlag.Equals("Y")))
                    {
                        collection.Add("OK_TO_SEND");
                    }
                    break;

                default:
                    barBtnWorkflowSave.Enabled       = false;
                    barComboWorkflowStatus.EditValue = ACurrentStatusCode;
                    barComboWorkflowStatus.Enabled   = false;
                    break;
                }
                collection.EndUpdate();
            }
            catch (Exception ex)
            {
                throw new Exception("An error occurred while setting up the status display list." + Environment.NewLine +
                                    "Error CNF-241 in " + FORM_NAME + ".InitStatusComboBox(): " + ex.Message);
            }
        }
 void CreateItems(IEnumerable <string> enumerable1, ComboBoxItemCollection boxItems)
 {
     boxItems.Clear();
     boxItems.AddRange(enumerable1.Select(s => new ComboBoxItem(s)).ToList());
 }