Esempio n. 1
0
        public void BindChkListEqpGroup(CheckedListBoxItemCollection control, string targetShopID)
        {
            control.Clear();

            SortedSet <string> list = new SortedSet <string>();

            var eqpDt = this.EqpMgr.Table;

            string eqpGrpColName = EqpGanttChartData.Eqp.Schema.EQP_GROUP_ID;

            DataRow[] filteredRows = eqpDt.Select("", eqpGrpColName);

            foreach (DataRow srow in eqpDt.Rows)
            {
                string eqpGroup = srow.GetString(eqpGrpColName);
                if (string.IsNullOrEmpty(eqpGroup))
                {
                    continue;
                }

                string shopID = srow.GetString(EqpGanttChartData.Eqp.Schema.SHOP_ID);
                if (targetShopID != Consts.ALL)
                {
                    bool isAdd = false;

                    //ARRRAY의 경우 CF PHOTO 설비는 포함 처리.
                    if (StringHelper.Equals(targetShopID, "ARRAY"))
                    {
                        string eqpGroupUpper = StringHelper.ToSafeUpper(eqpGroup);
                        if (eqpGroupUpper.Contains("PHL") || eqpGroupUpper.Contains("PHOTO"))
                        {
                            isAdd = true;
                        }
                    }

                    if (isAdd == false)
                    {
                        isAdd = shopID == targetShopID;
                    }

                    if (isAdd == false)
                    {
                        continue;
                    }
                }

                if (list.Contains(eqpGroup) == false)
                {
                    list.Add(eqpGroup);
                }
            }

            foreach (var eqpGroup in list)
            {
                control.Add(eqpGroup);
            }
        }
        private void setupRle(IDataBindingSource src, RepositoryItemCheckedComboBoxEdit rle, string fn)
        {
            //rle.DisplayMember = DisplayMember;
            //rle.ValueMember = ValueMember;
            GetFieldOptionsListEventData qd = new GetFieldOptionsListEventData {
                Data = null, FieldName = fn, DataBindingSource = src
            };

            src.EditorsHost.onGetOptionsList(this, qd);
            if (qd.Data != null)
            {
                CheckedListBoxItemCollection coll = rle.Items;
                coll.BeginUpdate();
                try
                {
                    qd.Data.Cast <object>().ToList().ForEach(o => coll.Add(o));
                }
                finally
                {
                    coll.EndUpdate();
                }
            }
        }