Ejemplo n.º 1
0
        /// <summary>
        /// 通过任务信息初始化任务预览
        /// </summary>
        /// <param name="customAppointment"></param>
        /// <param name="empId"></param>
        /// <param name="isOwner">是否负责人</param>
        public Frm我指派的任务预览(Frm任务S frm, CustomAppointment customAppointment, String delegateId)
        {
            InitializeComponent();
            this.customAppointment = customAppointment;
            this.delegateId        = delegateId;

            //  补充参与者信息
            CustomAppointmentService.buildAssignee(customAppointment);
            CustomAppointmentService.taskRead(customAppointment);
            this.frm = frm;
            this.frm.RefrashGridcontrol();

            this.initViewData();    //  初始化视图的值

            this.getTaskAchievement();
            this.getTaskWorkIntensity();    //  工作强度

            //  任务分解一览
            this.treeListTask.DataSource = CustomAppointmentService.getAllById(customAppointment.TaskId);
            this.gridControl2.DataSource = this.GetDataTable();

            //  业务委托人
            //显示的数据
            this.comboBoxDelegate.DisplayMember = "Name"; //name为类A的字段名
            //隐藏的数据(对于多个数据,可以用逗号隔开。例:id,name)
            this.comboBoxDelegate.ValueMember = "Id";     //id为类A的字段名(对于隐藏对个数据,把数据放到一个字段用逗号隔开)
            this.comboBoxDelegate.DataSource  = EmpService.findAll();
        }
Ejemplo n.º 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
        }