Example #1
0
        private void Frm我指派的任务预览_Load(object sender, EventArgs e)
        {
            this.searchLookUpEdit1.Properties.DataSource = EmpService.findAll();
            List <String> empIds   = this.customAppointment.Assignee;
            List <EmpDto> empDtos  = EmpService.findByIds(empIds);
            List <String> empNames = new List <string>();

            foreach (EmpDto empDto in empDtos)
            {
                empNames.Add(empDto.Name);
            }

            this.searchLookUpEdit1.EditValue = string.Join(",", empNames);                                      //  name
            this.searchLookUpEdit1.ToolTip   = string.Join(",", empIds == null ? new List <String>() : empIds); //  id

            var v = this.luValues.Find(b => b.FindText == this.searchLookUpEdit1.Properties.View.FindFilterText);

            if (v == null)
            {
                v                  = new LookUpMultSelectValues();
                v.FindText         = this.searchLookUpEdit1.Properties.View.FindFilterText;
                v.SelectedValues   = new List <string>();
                v.SelectedDisplays = new List <string>();
                this.luValues.Add(v);
            }
        }
Example #2
0
        public Frm新建任务(Frm任务S form)
        {
            InitializeComponent();

            this.form     = form;
            this.owner_id = form.owner_id;

            RefrashGridcontrol();
            this.chineseLocale();
            //  选择任务模板的事件
            this.repositoryItemComboBox1.SelectedIndexChanged += TaskTemplateSelectedIndexChanged;

            //显示的数据
            this.comboBoxEmp.DisplayMember = "Name"; //name为类A的字段名
            //隐藏的数据(对于多个数据,可以用逗号隔开。例:id,name)
            this.comboBoxEmp.ValueMember = "Id";     //id为类A的字段名(对于隐藏对个数据,把数据放到一个字段用逗号隔开)
            List <String> emps = new List <string>();

            emps.Add(this.owner_id);
            this.comboBoxEmp.DataSource = EmpService.findByIds(emps);

            //  当没有选择模板
            this.nextTaskTemplates = TaskTemplateService.getByFrontTaskTemplateId(this.parentTaskTemplateId);

            this.barTaskTemp.Enabled = true;
            if (this.nextTaskTemplates.Count > 0)
            {
                foreach (NextTaskTemplate nextTaskTemplate in this.nextTaskTemplates)
                {
                    this.repositoryItemComboBox1.Items.Add(nextTaskTemplate.TaskTemplateName);
                }
                //this.barTaskTemplate.EditValue = this.nextTaskTemplates[0].TaskTemplateName;
            }

            //  初始化任务model
            this.appointmentModel = new AppointmentModel();
            this.appointmentModel.build难度(1);

            /// 参与者
            this.searchLookUpEdit1.EditValue = ""; //  name
            this.searchLookUpEdit1.ToolTip   = ""; //  id
        }