Example #1
0
        /// <summary>
        /// Llena el combo con los valores de la enumeración
        /// seleccionada.
        /// </summary>
        private void FillComboBox()
        {
            try
            {
                ImageComboBoxItemCollection items = this.Properties.Items;
                items.Clear();
                Type enumType =
                    Fwk.HelperFunctions.ReflectionFunctions.CreateType(
                        Fwk.UI.Common.HelperFunctions.Enumerations.GetDescription(_enumType), "Fwk.UI.Common");

                items.AddEnum(enumType);

                foreach (ImageComboBoxItem item in items)
                {
                    item.Description = Fwk.UI.Common.HelperFunctions.Enumerations.GetDescription((Enum)item.Value);
                }

                this.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            }
            catch
            {
                this.EditValue           = "Error obteniendo los valores";
                this.Properties.ReadOnly = true;
            }
        }
Example #2
0
        /// <summary>
        /// 加载审核审批状态信息
        /// </summary>
        /// <param name="imageComboBoxEditState">状态下拉框控件</param>
        /// <param name="isApproval">是否审批</param>
        protected void LoadCheckAppState(ImageComboBoxEdit imageComboBoxEditState, bool isApproval)
        {
            imageComboBoxEditState.Properties.Items.Clear();
            ImageComboBoxItemCollection itemColApprove =
                new ImageComboBoxItemCollection(imageComboBoxEditState.Properties);

            if (isApproval)
            {
                itemColApprove.Add(new ImageComboBoxItem("不需要审批", "0"));
                itemColApprove.Add(new ImageComboBoxItem("审批未提交", "1"));
                itemColApprove.Add(new ImageComboBoxItem("审批已提交", "2"));
                itemColApprove.Add(new ImageComboBoxItem("审批通过", "3"));
                itemColApprove.Add(new ImageComboBoxItem("审批不通过", "4"));
            }
            else
            {
                itemColApprove.Add(new ImageComboBoxItem("未审核", "0"));
                itemColApprove.Add(new ImageComboBoxItem("已验收", "1"));
            }

            imageComboBoxEditState.Properties.Items.AddRange(itemColApprove);
            if (imageComboBoxEditState.Properties.Items.Count > 0)
            {
                imageComboBoxEditState.SelectedIndex = 0;
            }
        }
Example #3
0
 void LocalizeComboBoxItems(ImageComboBoxItemCollection items)
 {
     foreach (ImageComboBoxItem item in items)
     {
         item.Description = LocalizeItemCaption(item.Description);
     }
 }
Example #4
0
 public void AddRange(ImageComboBoxItemCollection value)
 {
     foreach (ImageComboBoxItem item in value)
     {
         Add(item);
     }
 }
Example #5
0
        private void LoadLookups()
        {
            opts = new ImageComboBoxItemCollection(ImageComboBoxEditLoadCode.Properties);
            htls = new ImageComboBoxItemCollection(ImageComboBoxEditLoadCode.Properties);
            var agy    = from agyRec in context.AGY orderby agyRec.NO ascending select new { agyRec.NO, agyRec.NAME };
            var crus   = from airRec in context.CRU orderby airRec.CODE ascending select new { airRec.CODE, airRec.NAME };
            var cat    = from catRec in context.ROOMCOD orderby catRec.CODE ascending select new { catRec.CODE, catRec.DESC };
            var comps  = from compRec in context.COMP orderby compRec.CODE ascending select new { compRec.CODE, compRec.NAME };
            var hotels = from hotRec in context.HOTEL orderby hotRec.CODE ascending select new { hotRec.CODE, hotRec.NAME };

            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = ""
            };

            ImageComboBoxEditLoadCode.Properties.Items.Add(loadBlank);
            ImageComboBoxEditCopyCode.Properties.Items.Add(loadBlank);
            ImageComboBoxEditAgency.Properties.Items.Add(loadBlank);
            ImageComboBoxEditCategory.Properties.Items.Add(loadBlank);

            foreach (var result in agy)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.NO.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.NO.TrimEnd()
                };
                ImageComboBoxEditAgency.Properties.Items.Add(load);
            }
            foreach (var result in cat)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.DESC.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                ImageComboBoxEditCategory.Properties.Items.Add(load);
            }
            foreach (var result in comps)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditCode.Properties.Items.Add(load);
                opts.Add(load);
            }
            foreach (var result in hotels)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditAgency.Properties.Items.Add(load);
                htls.Add(load);
            }
            ImageComboBoxEditCategory.Properties.ReadOnly = true;
            ImageComboBoxEditAgency.Properties.ReadOnly   = true;
        }
Example #6
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                _ImageList        = null;
                _DefaultImage     = null;
                _DefaultImageList = null;
                _Items            = null;
            }
        }
Example #7
0
        /// <summary>
        /// 加载状态类型
        /// </summary>
        private void LoadSearchState()
        {
            this.imageComboBoxEditState.Properties.Items.Clear();
            ImageComboBoxItemCollection itemColApprove =
                new ImageComboBoxItemCollection(this.imageComboBoxEditState.Properties);

            itemColApprove.Add(new ImageComboBoxItem("未处理单据", "1"));
            itemColApprove.Add(new ImageComboBoxItem("出库确认", "3"));
            itemColApprove.Add(new ImageComboBoxItem("整单退回", "5"));
            this.imageComboBoxEditState.Properties.Items.AddRange(itemColApprove);
            if (this.imageComboBoxEditState.Properties.Items.Count > 0)
            {
                this.imageComboBoxEditState.SelectedIndex = 0;
            }
        }
Example #8
0
        /// <summary>
        /// 加载付款状态
        /// </summary>
        private void LoadPayState()
        {
            this.imageComboBoxEditPayState.Properties.Items.Clear();
            ImageComboBoxItemCollection itemColApprove =
                new ImageComboBoxItemCollection(this.imageComboBoxEditPayState.Properties);

            itemColApprove.Add(new ImageComboBoxItem("未付款", "0"));
            itemColApprove.Add(new ImageComboBoxItem("待付款", "1"));
            itemColApprove.Add(new ImageComboBoxItem("已付款", "2"));


            this.imageComboBoxEditPayState.Properties.Items.AddRange(itemColApprove);
            if (this.imageComboBoxEditPayState.Properties.Items.Count > 0)
            {
                this.imageComboBoxEditPayState.SelectedIndex = 0;
            }
        }
        public static void Populate(ImageComboBoxItemCollection items, Type enumType, params System.Enum[] excludeValues)
        {
            Array enumValues = Enum.GetValues(enumType);
            if (enumValues.Length > 0)
            {
                items.BeginUpdate();

                foreach (Enum enumValue in enumValues)
                {
                    if (Array.BinarySearch(excludeValues, enumValue) >= 0)
                        continue;

                    items.Add(new ImageComboBoxItem(enumValue.ToString(), Convert.ToInt32(enumValue), -1));
                }

                items.EndUpdate();
            }
        }
Example #10
0
        public static void Populate(ImageComboBoxItemCollection items, Type enumType, params System.Enum[] excludeValues)
        {
            Array enumValues = Enum.GetValues(enumType);

            if (enumValues.Length > 0)
            {
                items.BeginUpdate();

                foreach (Enum enumValue in enumValues)
                {
                    if (Array.BinarySearch(excludeValues, enumValue) >= 0)
                    {
                        continue;
                    }

                    items.Add(new ImageComboBoxItem(enumValue.ToString(), Convert.ToInt32(enumValue), -1));
                }

                items.EndUpdate();
            }
        }
Example #11
0
        private void LoadLookups()
        {
            hotelVals = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            compVals  = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            cruVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            airVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            carVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            pkgVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);

            setReadOnly(true);
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = ""
            };

            ImageComboBoxEditAgency.Properties.Items.Add(loadBlank);

            var air      = from airRec in context.AIR orderby airRec.CODE ascending select new { airRec.CODE, airRec.NAME };
            var pck      = from pckRec in context.PACK orderby pckRec.CODE ascending select new { pckRec.CODE, pckRec.NAME };
            var agy      = from agyRec in context.AGY orderby agyRec.NO ascending select new { agyRec.NO, agyRec.NAME };
            var hotel    = from hotRec in context.HOTEL orderby hotRec.CODE ascending select new { hotRec.CODE, hotRec.NAME };
            var comp     = from compRec in context.COMP orderby compRec.CODE ascending select new { compRec.CODE, compRec.NAME };
            var cru      = from cruRec in context.CRU orderby cruRec.CODE ascending select new { cruRec.CODE, cruRec.NAME };
            var car      = from carRec in context.CARINFO orderby carRec.CODE ascending select new { carRec.CODE, carRec.NAME };
            var airports = from portRec in context.Airport orderby portRec.Code ascending select new { portRec.Code, portRec.Name };

            foreach (var result in pck)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                pkgVals.Add(load);
                //ImageComboBoxEditOperator.Properties.Items.Add(load);
            }

            foreach (var result in hotel)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                hotelVals.Add(load);
                //ImageComboBoxEditOperator.Properties.Items.Add(load);
            }

            foreach (var result in comp)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                compVals.Add(load);
                //ImageComboBoxEditOperator.Properties.Items.Add(load);
            }

            foreach (var result in car)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                carVals.Add(load);
                //ImageComboBoxEditOperator.Properties.Items.Add(load);
            }

            foreach (var result in air)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                airVals.Add(load);
                //ImageComboBoxEditOperator.Properties.Items.Add(load);
            }

            foreach (var result in cru)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                cruVals.Add(load);
                //ImageComboBoxEditOperator.Properties.Items.Add(load);
            }
            foreach (var result in agy)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.NO.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.NO.TrimEnd()
                };
                ImageComboBoxEditAgency.Properties.Items.Add(load);
            }

            enableNavigator(false);
        }
Example #12
0
        private void LoadLookups()
        {
            hotelVals = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            compVals  = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            pkgVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            airVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            carVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            cruVals   = new ImageComboBoxItemCollection(ImageComboBoxEditCode.Properties);
            //lockGrid(true);
            var cats   = from catRec in context.ROOMCOD orderby catRec.CODE ascending select new { catRec.CODE, catRec.DESC };
            var comps  = from compRec in context.COMP orderby compRec.CODE ascending select new { compRec.CODE, compRec.NAME };
            var hotels = from hotRec in context.HOTEL orderby hotRec.CODE ascending select new { hotRec.CODE, hotRec.NAME };
            var pkgs   = from pkgRec in context.PACK orderby pkgRec.CODE ascending select new { pkgRec.CODE, pkgRec.NAME };
            var airs   = from airRec in context.AIR orderby airRec.CODE ascending select new { airRec.CODE, airRec.NAME };
            var cars   = from carRec in context.CARINFO orderby carRec.CODE ascending select new { carRec.CODE, carRec.NAME };
            var crus   = from cruRec in context.CRU orderby cruRec.CODE ascending select new { cruRec.CODE, cruRec.NAME };
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = ""
            };

            ImageComboBoxEditCategory.Properties.Items.Add(loadBlank);
            ImageComboBoxEditCode.Properties.Items.Add(loadBlank);

            foreach (var result in cats)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.DESC.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                ImageComboBoxEditCategory.Properties.Items.Add(load);
            }
            foreach (var result in comps)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditCode.Properties.Items.Add(load);
                compVals.Add(load);
            }
            foreach (var result in hotels)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditAgency.Properties.Items.Add(load);
                hotelVals.Add(load);
            }

            foreach (var result in pkgs)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditAgency.Properties.Items.Add(load);
                pkgVals.Add(load);
            }

            foreach (var result in cars)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditAgency.Properties.Items.Add(load);
                carVals.Add(load);
            }

            foreach (var result in crus)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditAgency.Properties.Items.Add(load);
                cruVals.Add(load);
            }

            foreach (var result in airs)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                //ImageComboBoxEditAgency.Properties.Items.Add(load);
                airVals.Add(load);
            }
        }
Example #13
0
 public ImageComboBox()
 {
     base.DrawMode   = DrawMode.OwnerDrawFixed;
     base.ItemHeight = 14;
     _Items          = new ImageComboBoxItemCollection(this);
 }