private void SetupLookUpEditor(LookUpEditBase lookup, object dataSource, string valueMember, string displayMember, LookUpEditBase lookupOwner = null)
 {
     lookup.Properties.DataSource    = dataSource;
     lookup.Properties.ValueMember   = valueMember;
     lookup.Properties.DisplayMember = displayMember;
     lookup.CascadingOwner           = lookupOwner;
 }
Example #2
0
 public void TableVieHiddenEditor(object sender, EditorEventArgs e)
 {
     if (Editor == null)
     {
         return;
     }
     Editor.ItemsSource = Functions;
     Editor             = null;
 }
 private static void BindAllowedActivities(this LookUpEditBase editor)
 {
     if (_activities == null)
     {
         _activities = new Activity();
         _activities.LoadByUserID(CurrentContext.UserId);
     }
     editor.Properties.DataSource = _activities.DefaultView;
 }
Example #4
0
 public static bool IsEditValueValide(this LookUpEditBase Lkp)
 {
     if (Lkp.IsEditValueOfTypeInt() == false || Convert.ToInt32(Lkp.EditValue) == 0)
     {
         Lkp.ErrorText = Frm_Master.ErrorText;
         return(false);
     }
     return(true);
 }
        protected void LoadBatchInfo(LookUpEditBase combo)
        {
            List <UUT批次信息> batchLists = ViewModuleManager.ModuleOfUUT批次信息管理.GetList();
            List <string>  batchNames = new List <string>();

            batchNames.Add(null);
            for (int i = 0; i < batchLists.Count; i++)
            {
                batchNames.Add(batchLists[i].UUT批次号);
            }
            combo.Properties.DataSource = batchNames;
        }
        public static LookUpEditBase SetDefaultMode(this LookUpEditBase editor)
        {
            if (_activity == null)
            {
                _activity = new Activity();
                _activity.LoadDefaultByUser(CurrentContext.UserId);
            }

            if (_activity.RowCount > 0)
            {
                editor.EditValue = _activity.ModeID;
            }
            return(editor);
        }
        protected void LoadUUT编号(LookUpEditBase lookupEdit)
        {
            List <string> names = new List <string>();

            names.Add(null);
            for (int i = 0; i < UUT类型_Base.Count; i++)
            {
                List <UUT状态信息> uutInfos = ViewModuleManager.ModuleOfUUT状态信息.GetList(UUT类型_Base[i]);
                for (int j = 0; j < uutInfos.Count; j++)
                {
                    names.Add(uutInfos[j].UUT编号);
                }
            }
            lookupEdit.Properties.DataSource = names;
        }
Example #8
0
        public void OnTableViewShownEditor(object sender, EditorEventArgs e)
        {
            if (e.Column.FieldName != "FunctId")
            {
                return;
            }
            Editor = e.Editor as LookUpEditBase;
            if (Editor == null)
            {
                return;
            }
            TableView view   = (TableView)sender;
            int       deptId = (int)view.Grid.GetCellValue(e.RowHandle, "DeptId");

            Editor.ItemsSource = Functions.Where(function => function.DeptId == deptId).ToList();
        }
        void OnTableViewShownEditor(object sender, EditorEventArgs e)
        {
            if (e.Column.FieldName != "CityId")
            {
                return;
            }
            LookUpEditBase editor = e.Editor as LookUpEditBase;

            if (editor == null)
            {
                return;
            }
            TableView view      = (TableView)e.Source;
            int       countryId = (int)view.Grid.GetCellValue(e.RowHandle, "CountryId");

            editor.ItemsSource = Cities.Where(city => city.CountryId == countryId).ToList();
        }
        protected void Load报表名称(LookUpEditBase lookupEdit)
        {
            List <string> names = new List <string>();

            names.Add(null);

            List <TestReport测试报表信息> uutInfos = ViewModuleManager.ModuleOf数据管理.GetList();

            for (int j = 0; j < uutInfos.Count; j++)
            {
                names.Add(uutInfos[j].TestReportName);
            }
            //删除重名信息
            HashSet <string> hs      = new HashSet <string>(names); //此时已经去掉重复的数据保存在hashset中
            List <string>    reports = new List <string>();

            foreach (var item in hs)
            {
                reports.Add(item);
            }
            lookupEdit.Properties.DataSource = reports;
        }
        private void LookUpEdit1_EditValueChanged(object sender, EventArgs e)
        {
            //Display lookup editor's current value.
            LookUpEditBase lookupEditor = sender as LookUpEditBase;

            if (lookupEditor == null)
            {
                return;
            }
            LabelControl label = labelDictionary[lookupEditor];

            if (label == null)
            {
                return;
            }
            if (lookupEditor.EditValue == null)
            {
                label.Text = "Current EditValue: null";
            }
            else
            {
                label.Text = "Current EditValue: " + lookupEditor.EditValue.ToString();
            }
        }
 protected override bool ShowCustomItemInternal(LookUpEditBase editor)
 {
     return(false);
 }
Example #13
0
 public void AddButtonsToList(LookUpEditBase listObj)
 {
     AddButtonsToList(listObj.Properties.Buttons);
     listObj.Properties.ButtonClick += listObj_ButtonClick;
     //
 }
Example #14
0
        public static bool isEditValueOfTypeInt(this LookUpEditBase edit)
        {
            var val = edit.EditValue;

            return(val is int || val is byte);
        }
 public static LookUpEditBase BindAllowedPhysicalStores(this LookUpEditBase editor)
 {
     editor.Properties.DataSource = PhysicalStore.GetAllowedPhysicalStoresForUser(CurrentContext.UserId);
     return(editor);
 }