void InitializeControlState() { if (PmsService.Instance.CurrentUser.Group.Name == "检测") { // BindMeasurementControl(); _ExecuteReportControlState = new ExecuteState(); _ExecuteReportControlState.Enter(this); } if (PmsService.Instance.CurrentUser.Group.Name == "评审") { //BindMeasurementControl(); //BindAuditControl(); _ExecuteReportControlState = new AuditState(); _ExecuteReportControlState.Enter(this); } if (PmsService.Instance.CurrentUser.Group.Name == "审批") { // BindMeasurementControl(); //BindAuditControl(); //BindApproveControl(); _ExecuteReportControlState = new ApproveState(); _ExecuteReportControlState.Enter(this); } }
private void OnPartTask(object i_Obj) { BeginInvoke(new MessageHanlderDelegate(i_O => { var task = i_O as Task; if (task == null) { return; } _ExecuteReportControlState = new ExecuteState(); _ExecuteReportControlState.Enter(this); _Task = task; _ExecutionManager = new ExecutionManager(_Task); _CurrentTemplate = task.Part; if (_CurrentTemplate == null) { return; } Mediator.Mediator.Instance.NotifyColleagues(Execution.TaskStarted, task); CreateReportModel(); BindingTextControls(); RefreshCommentControls(); if (PmsService.Instance.CurrentUser.Group.Name == "检测") { LblTester.Text = PmsService.Instance.CurrentUser.Name; LblTestDate.Text = DateTime.Now.ToLongDateString(); _ExecuteReportControlState = new ExecuteState(); _ExecuteReportControlState.Enter(this); } if (PmsService.Instance.CurrentUser.Group.Name == "评审") { BindMeasurementControl(); LblAuditor.Text = PmsService.Instance.CurrentUser.Name; LblAuditDate.Text = DateTime.Now.ToLongDateString(); _ExecuteReportControlState = new AuditState(); _ExecuteReportControlState.Enter(this); } if (PmsService.Instance.CurrentUser.Group.Name == "审批") { BindMeasurementControl(); BindAuditControl(); LblApprover.Text = PmsService.Instance.CurrentUser.Name; LblApproveDate.Text = DateTime.Now.ToLongDateString(); _ExecuteReportControlState = new ApproveState(); _ExecuteReportControlState.Enter(this); } }), i_Obj); }
private void OnPartReportSpecified(object i_Obj) { BeginInvoke(new Mediator.MessageHanlderDelegate(i_O => { var partReport = i_O as PartReport; if (partReport == null) { return; } _Task = partReport.Task; _PartReport = partReport; _CurrentTemplate = partReport.Task.Part; if (_CurrentTemplate == null) { return; } _DataSource = new List <ExecuteDimensionEntityViewModel>(); PmsService.Instance.PopulateDimensionsForReport(_PartReport); foreach (var en in _PartReport.Dimensions) { _DataSource.Add(new ExecuteDimensionEntityViewModel(en)); } if (_CurrentTemplate.Dimensions.Count > 0) { _SeletedDimension = _PartReport.Dimensions[0]; } dataGridView1.DataSource = _DataSource; btnCreateReport.Text = @"保存报告"; BindingTextControls(); // RefreshCommentControls(); if (PmsService.Instance.CurrentUser.Group.Name == "检测") { BindMeasurementControl(); LblTester.Text = PmsService.Instance.CurrentUser.Name; LblTestDate.Text = DateTime.Now.ToLongDateString(); _ExecuteReportControlState = new ExecuteState(); _ExecuteReportControlState.Enter(this); } if (PmsService.Instance.CurrentUser.Group.Name == "评审") { BindMeasurementControl(); BindAuditControl(); LblAuditor.Text = PmsService.Instance.CurrentUser.Name; LblAuditDate.Text = DateTime.Now.ToLongDateString(); _ExecuteReportControlState = new AuditState(); _ExecuteReportControlState.Enter(this); } if (PmsService.Instance.CurrentUser.Group.Name == "审批") { BindMeasurementControl(); BindAuditControl(); BindApproveControl(); LblApprover.Text = PmsService.Instance.CurrentUser.Name; LblApproveDate.Text = DateTime.Now.ToLongDateString(); _ExecuteReportControlState = new ApproveState(); _ExecuteReportControlState.Enter(this); } }), i_Obj); }