protected void ShowContentReceiveDurationFinish(Project project) { if (//无速记 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000021") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000037") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000038") ) { this.ContentReceiveDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ContentAssignmentDate, project.ExecutionDate) + ")"; } //新三分屏 else if (project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199")) { using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities()) { ProjectCollection.WebUI.Models.Project ThisProject = (from p in ProjectModel.Project where p.ProjectId.ToString() == project.ProjectId.ToString() select p).First(); this.ContentReceiveDuration.Text = "(" + DateTimeHandle.DateDiffDay(Convert.ToDateTime(ThisProject.ContentAssignmentDate), Convert.ToDateTime(ThisProject.ShorthandFinishDate)) + ")"; } } else { this.ContentReceiveDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ContentAssignmentDate, project.ShorthandFinishDate) + ")"; } }
protected void ShowPublishDurationFinish(Project project) { if (//单视频(无复审) project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") ) { if (DateTime.Compare(project.ContentCheckDate, project.ProductionCheckDate) > 0) { this.PublishDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.PublishPublishDate, project.ContentCheckDate) + ")"; } else { this.PublishDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.PublishPublishDate, project.ProductionCheckDate) + ")"; } } else//三分屏(有复审) { if (DateTime.Compare(project.ContentRecheckDate, project.ProductionCheckDate) > 0) { this.PublishDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.PublishPublishDate, project.ContentRecheckDate) + ")"; } else { this.PublishDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.PublishPublishDate, project.ProductionCheckDate) + ")"; } } }
protected void ShowProductionReceiveDurationUnfinish(Project project) { if (//单视频(必无速记) project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") ) { this.ProductionReceiveDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ExecutionDate) + ")"; } else//三分屏 { if (//无速记 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000021") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000037") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000038") ) { if (project.ContentNeeds == new Guid("00000000-0000-0000-0000-000000000043"))//无制作部 { this.ProductionReceiveDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ExecutionDate) + ")"; } else //有制作部(三分屏必有复审) { this.ProductionReceiveDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ContentRecheckDate) + ")"; } } else//有速记(必有制作部) { this.ProductionReceiveDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ContentRecheckDate) + ")"; } } }
protected void ShowProductionReceiveDurationFinish(Project project, string Message, string color) { if (//单视频(必无速记) project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") ) { this.ProductionReceiveState.Text = Message; ProgressProductionReceive.BackColor = System.Drawing.ColorTranslator.FromHtml(color); this.ProductionReceiveDuration.Text = DateTimeHandle.DateDiffDay(project.ProductionReceiveDate, project.ExecutionDate); } //新三分屏 else if (project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199")) { this.ProgressProductionReceive.Visible = false; this.NewProgressProductionReceive.Visible = true; this.NewProductionReceiveState.Text = Message; NewProgressProductionReceive.BackColor = System.Drawing.ColorTranslator.FromHtml(color); this.NewProductionReceiveDuration.Text = DateTimeHandle.DateDiffDay(project.ProductionReceiveDate, project.ExecutionDate); } else//三分屏 { this.ProductionReceiveState.Text = Message; ProgressProductionReceive.BackColor = System.Drawing.ColorTranslator.FromHtml(color); if (//无速记 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000021") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000037") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000038") ) { if (project.ContentNeeds == new Guid("00000000-0000-0000-0000-000000000043"))//无制作部 { this.ProductionReceiveDuration.Text = DateTimeHandle.DateDiffDay(project.ProductionReceiveDate, project.ExecutionDate); } else //有制作部(三分屏必有复审) { this.ProductionReceiveDuration.Text = DateTimeHandle.DateDiffDay(project.ProductionReceiveDate, project.ContentRecheckDate); } } else//有速记(必有制作部) { this.ProductionReceiveDuration.Text = DateTimeHandle.DateDiffDay(project.ProductionReceiveDate, project.ContentRecheckDate); } } if (project.ProductionReceiveDelayDate != new DateTime(0001, 1, 1, 00, 00, 00)) { ProgressProductionReceive.BackColor = System.Drawing.ColorTranslator.FromHtml("#fecf45"); this.ProductionReceiveDuration.Text = "(" + this.ProductionReceiveDuration.Text + ")"; this.ProductionReceiveState.Text = "推迟" + DateTimeHandle.DateDiffHour(project.ProductionReceiveDate, project.ProductionReceiveDelayDate) + "完成"; } else { this.ProductionReceiveDuration.Text = "(" + this.ProductionReceiveDuration.Text + ")"; } }
protected void ShowCaptureCheckDurationFinish(Project project) { if (//无采集 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000038") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000039") ) { this.CaptureCheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ExecutionDate, project.SendingDate) + ")"; } else { this.CaptureCheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ExecutionDate, project.CaptureFinishDate) + ")"; } }
protected void ShowContentReceiveDurationFinish(Project project) { if (//无速记 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000021") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000037") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000038") ) { this.ContentReceiveDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ContentAssignmentDate, project.ExecutionDate) + ")"; } else { this.ContentReceiveDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ContentAssignmentDate, project.ShorthandFinishDate) + ")"; } }
protected void ShowProgressPanel(Guid ProjectId) { #region Ajax需要初始化状态 this.PanelProgress.Visible = true; this.ProgressCapture.Visible = true; ProgressCapture.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); CaptureDuration.Text = ""; CaptureState.Text = ""; this.ProgressCaptureCheck.Visible = true; ProgressCaptureCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); CaptureCheckDuration.Text = ""; CaptureCheckState.Text = ""; this.ProgressShorthand.Visible = true; ProgressShorthand.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ShorthandDuration.Text = ""; ShorthandState.Text = ""; this.ProgressContentReceive.Visible = true; ProgressContentReceive.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ContentReceiveDuration.Text = ""; ContentReceiveState.Text = ""; this.ProgressContentOperator.Visible = true; ProgressContentOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ContentOperatorDuration.Text = ""; ContentOperatorState.Text = ""; this.ProgressContentCheck.Visible = true; ProgressContentCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ContentCheckDuration.Text = ""; ContentCheckState.Text = ""; this.ProgressContentRecheck.Visible = true; ProgressContentRecheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ContentRecheckDuration.Text = ""; ContentRecheckState.Text = ""; this.ProgressProductionReceive.Visible = true; ProgressProductionReceive.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ProductionReceiveDuration.Text = ""; ProductionReceiveState.Text = ""; this.ProgressProductionOperator.Visible = true; ProgressProductionOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ProductionOperatorDuration.Text = ""; ProductionOperatorState.Text = ""; this.ProgressProductionCheck.Visible = true; ProgressProductionCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ProductionCheckDuration.Text = ""; ProductionCheckState.Text = ""; this.ProgressPublish.Visible = true; ProgressPublish.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); PublishDuration.Text = ""; PublishState.Text = ""; this.ProgressCheck.Visible = true; ProgressCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); CheckDuration.Text = ""; CheckState.Text = ""; //新流程 this.NewProgressProductionReceive.Visible = false; NewProgressProductionReceive.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ProductionReceiveDuration.Text = ""; ProductionReceiveState.Text = ""; this.NewProgressProductionOperator.Visible = false; NewProgressProductionOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ProductionOperatorDuration.Text = ""; ProductionOperatorState.Text = ""; this.NewProgressProductionCheck.Visible = false; NewProgressProductionCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); ProductionCheckDuration.Text = ""; ProductionCheckState.Text = ""; this.NewProgressSTT.Visible = false; NewProgressSTT.BackColor = System.Drawing.ColorTranslator.FromHtml("#e3f0f6"); NewProgressSTTDuration.Text = ""; NewProgressSTTState.Text = ""; #endregion BLL.Project project = BLL.Project.GetProject(ProjectId); this.ProgressNo.Text = "编号:" + project.ProjectNo.ToString(); this.ProgressDate.Text = "派单时间:" + project.SendingDate.ToString("yy-MM-dd HH:mm"); this.ProgressTitle.Text = project.CourseName.ToString(); this.ProgressLecturer.Text = project.lecturer.ToString(); #region 新流程 if (project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199")) { ProgressProductionReceive.Visible = false; NewProgressProductionReceive.Visible = true; ProgressProductionOperator.Visible = false; NewProgressProductionOperator.Visible = true; ProgressProductionCheck.Visible = false; NewProgressProductionCheck.Visible = true; NewProgressSTT.Visible = true; } #endregion 新流程 #region 采集 if (//无采集 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000038") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000039") ) { this.ProgressCapture.Visible = false; } else { this.CaptureDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.SendingDate) + ")"; if (project.progress == new Guid("00000000-0000-0000-0000-000000000105")) { this.CaptureState.Text = "等待接收"; ProgressCapture.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); } else if (project.progress == new Guid("00000000-0000-0000-0000-000000000108")) { this.CaptureState.Text = "正在采集"; ProgressCapture.BackColor = System.Drawing.ColorTranslator.FromHtml("#b7d28d"); } else if (project.progress == new Guid("00000000-0000-0000-0000-000000000131")) { this.CaptureState.Text = "延迟接收"; ProgressCapture.BackColor = System.Drawing.ColorTranslator.FromHtml("#f55066"); } //else if (project.CaptureFinishDate != Convert.ToDateTime("0001/1/1 0:00:00")) else if (project.CaptureFinishDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.CaptureState.Text = "√"; ProgressCapture.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); if (project.CaptureReceiveDelayDate != new DateTime(0001, 1, 1, 00, 00, 00)) { ProgressCapture.BackColor = System.Drawing.ColorTranslator.FromHtml("#fecf45"); this.CaptureDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.CaptureFinishDate, project.SendingDate) + ")"; this.CaptureState.Text = "推迟" + DateTimeHandle.DateDiffHour(project.CaptureFinishDate, project.CaptureReceiveDelayDate) + "完成"; } else { this.CaptureDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.CaptureFinishDate, project.SendingDate) + ")"; } } else { } } #endregion #region 预审 if (project.progress == new Guid("00000000-0000-0000-0000-000000000120")) { this.CaptureCheckState.Text = "等待预审"; ProgressCaptureCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); ShowCaptureCheckDurationUnfinish(project); } else if (project.progress == new Guid("00000000-0000-0000-0000-000000000121")) { this.CaptureCheckState.Text = "准备派发制作"; ProgressCaptureCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); ShowCaptureCheckDurationUnfinish(project); } else if (project.ExecutionDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.CaptureCheckState.Text = "√"; ProgressCaptureCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); ShowCaptureCheckDurationFinish(project); } else { } #endregion #region 速记 if (//无速记 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000021") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000037") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000038") //新三分屏无速记 || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199") ) { this.ProgressShorthand.Visible = false; } else { if (project.progress == new Guid("00000000-0000-0000-0000-000000000109")) { this.ShorthandState.Text = "等待接收"; ProgressShorthand.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); this.ShorthandDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ExecutionDate) + ")"; } else if (project.progress == new Guid("00000000-0000-0000-0000-000000000110")) { this.ShorthandState.Text = "正在制作"; ProgressShorthand.BackColor = System.Drawing.ColorTranslator.FromHtml("#b7d28d"); //暂时没有速记接收 //this.ShorthandDuration.Text = "(" + DateTimeHandle.DateDiff(DateTime.Now, project.ShorthandReceiveDate) + ")"; this.ShorthandDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ExecutionDate) + ")"; } else if (project.ShorthandFinishDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.ShorthandState.Text = "√"; ProgressShorthand.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.ShorthandDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ShorthandFinishDate, project.ExecutionDate) + ")"; } else { } } #endregion #region 制作部 if (project.ContentNeeds == new Guid("00000000-0000-0000-0000-000000000043"))//无制作部 { this.ProgressContentReceive.Visible = false; this.ProgressContentOperator.Visible = false; this.ProgressContentCheck.Visible = false; this.ProgressContentRecheck.Visible = false; } else { //接收 if (project.ContentProgress == new Guid("00000000-0000-0000-0000-000000000107")) { this.ContentReceiveState.Text = "等待接收"; ProgressContentReceive.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); ShowContentReceiveDurationUnfinish(project); } else if (project.ContentAssignmentDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.ContentReceiveState.Text = "√"; ProgressContentReceive.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); ShowContentReceiveDurationFinish(project); } else { } //制作 if (project.ContentProgress == new Guid("00000000-0000-0000-0000-000000000111")) { this.ContentOperatorState.Text = "正在制作"; ProgressContentOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#b7d28d"); this.ContentOperatorDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ContentAssignmentDate) + ")"; } else if (project.ContentFinishDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.ContentOperatorState.Text = "√"; ProgressContentOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.ContentOperatorDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ContentFinishDate, project.ContentAssignmentDate) + ")"; } else { } //初审 if (project.ContentProgress == new Guid("00000000-0000-0000-0000-000000000112")) { this.ContentCheckState.Text = "等待初审"; ProgressContentCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); this.ContentCheckDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ContentFinishDate) + ")"; } else if (project.ContentCheckDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.ContentCheckState.Text = "√"; ProgressContentCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.ContentCheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ContentCheckDate, project.ContentFinishDate) + ")"; } else { } //复审 if (//单视频不复审 project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000017") || project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000019") ) { this.ProgressContentRecheck.Visible = false; } else { if (project.ContentProgress == new Guid("00000000-0000-0000-0000-000000000122")) { this.ContentRecheckState.Text = "等待复审"; ProgressContentRecheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); this.ContentRecheckDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ContentCheckDate) + ")"; } else if (project.ContentRecheckDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.ContentRecheckState.Text = "√"; ProgressContentRecheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.ContentRecheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ContentRecheckDate, project.ContentCheckDate) + ")"; } else { } } } #endregion #region 技术部 //接收 if (project.ProductionProgress == new Guid("00000000-0000-0000-0000-000000000106")) { ShowProductionReceiveDurationUnfinish(project, "等待接收", "#e29e4b"); } else if (project.progress == new Guid("00000000-0000-0000-0000-000000000132")) { ShowProductionReceiveDurationUnfinish(project, "延迟接收", "#f55066"); } else if (project.ProductionReceiveDate != new DateTime(0001, 1, 1, 00, 00, 00)) { ShowProductionReceiveDurationFinish(project, "√", "#02f1e4"); } else { } //制作 if (project.ProductionProgress == new Guid("00000000-0000-0000-0000-000000000114")) { if (project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199")) { this.NewProductionOperatorState.Text = "正在制作"; NewProgressProductionOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#b7d28d"); this.NewProductionOperatorDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ProductionReceiveDate) + ")"; } else { this.ProductionOperatorState.Text = "正在制作"; ProgressProductionOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#b7d28d"); this.ProductionOperatorDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ProductionReceiveDate) + ")"; } } else if (project.ProductionFinishDate != new DateTime(0001, 1, 1, 00, 00, 00)) { if (project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199")) { this.NewProductionOperatorState.Text = "√"; NewProgressProductionOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.NewProductionOperatorDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ProductionFinishDate, project.ProductionReceiveDate) + ")"; } else { this.ProductionOperatorState.Text = "√"; ProgressProductionOperator.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.ProductionOperatorDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ProductionFinishDate, project.ProductionReceiveDate) + ")"; } } else { } #region STT if (project.progress == new Guid("00000000-0000-0000-0000-000000000197")) { this.NewProgressSTTState.Text = "等待制作"; NewProgressSTT.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); if (project.ProductionCheckDate > project.ExecutionDate) //无技术部环节 { this.NewProgressSTTDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ProductionCheckDate) + ")"; } else { this.NewProgressSTTDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ExecutionDate) + ")"; } } else if (project.ShorthandFinishDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.NewProgressSTTState.Text = "√"; NewProgressSTT.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.NewProgressSTTDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ShorthandFinishDate, project.ProductionCheckDate) + ")"; } #endregion STT //审核 if (project.ProductionProgress == new Guid("00000000-0000-0000-0000-000000000115")) { if (project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199")) { this.NewProductionCheckState.Text = "等待审核"; NewProgressProductionCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); //this.NewProductionCheckDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ProductionFinishDate) + ")"; using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities()) { ProjectCollection.WebUI.Models.Project ThisProject = (from p in ProjectModel.Project where p.ProjectId.ToString() == project.ProjectId.ToString() select p).First(); this.NewProductionCheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(DateTime.Now, Convert.ToDateTime(ThisProject.VideoEncodeFinishDate)) + ")"; } } else { this.ProductionCheckState.Text = "等待审核"; ProgressProductionCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); this.ProductionCheckDuration.Text = "(" + DateTimeHandle.DateDiffHour(DateTime.Now, project.ProductionFinishDate) + ")"; } } else if (project.ProductionCheckDate != new DateTime(0001, 1, 1, 00, 00, 00)) { if (project.ProjectTypeId == new Guid("00000000-0000-0000-0000-000000000199")) { this.NewProductionCheckState.Text = "√"; NewProgressProductionCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities()) { ProjectCollection.WebUI.Models.Project ThisProject = (from p in ProjectModel.Project where p.ProjectId.ToString() == project.ProjectId.ToString() select p).First(); this.NewProductionCheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(Convert.ToDateTime(ThisProject.ProductionCheckDate), Convert.ToDateTime(ThisProject.VideoEncodeFinishDate)) + ")"; } } else { this.ProductionCheckState.Text = "√"; ProgressProductionCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.ProductionCheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.ProductionCheckDate, project.ProductionFinishDate) + ")"; } } else { } #endregion #region 发布审核 if (project.PublishNeeds == new Guid("00000000-0000-0000-0000-000000000043")) //无发布 { this.ProgressPublish.Visible = false; this.ProgressCheck.Visible = false; } else { //发布 if (project.progress == new Guid("00000000-0000-0000-0000-000000000117")) { this.PublishState.Text = "等待发布"; ProgressPublish.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); ShowPublishDurationUnfinish(project); } else if (project.PublishPublishDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.PublishState.Text = "√"; ProgressPublish.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); ShowPublishDurationFinish(project); } else { } //审核 if (project.progress == new Guid("00000000-0000-0000-0000-000000000118")) { this.CheckState.Text = "等待审核"; ProgressCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#e29e4b"); this.CheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(DateTime.Now, project.PublishPublishDate) + ")"; } else if (project.CheckTaskCheckDate != new DateTime(0001, 1, 1, 00, 00, 00)) { this.CheckState.Text = "√"; ProgressCheck.BackColor = System.Drawing.ColorTranslator.FromHtml("#02f1e4"); this.CheckDuration.Text = "(" + DateTimeHandle.DateDiffDay(project.CheckTaskCheckDate, project.PublishPublishDate) + ")"; } else { } } #endregion }
public IActionResult RectifyInfoImport(IFormFile excelfile) { var response = ResponseModelFactory.CreateInstance; using (_dbContext) { DateTime beginTime = DateTime.Now; DateTime now; string sWebRootFolder = _hostingEnvironment.WebRootPath + "\\UploadFiles\\ImportSocialGovernExcel"; //var schoolinfo = _dbContext.SchoolInforManagement.AsQueryable(); string uploadtitle = "社区矫正信息导入" + DateTime.Now.ToString("yyyyMMddHHmmss"); string sFileName = $"{uploadtitle}.xlsx"; FileInfo file = new FileInfo(Path.Combine(sWebRootFolder, sFileName)); //string conStr = ConnectionStrings.DefaultConnection; string responsemsgsuccess = ""; string responsemsgrepeat = ""; string responsemsgdefault = ""; int successcount = 0; int repeatcount = 0; int defaultcount = 0; //string today = DateTime.Now.ToString("yyyy-MM-dd"); try { //把excelfile中的数据复制到file中 using (FileStream fs = new FileStream(file.ToString(), FileMode.Create)) //初始化一个指定路径和创建模式的FileStream { excelfile.CopyTo(fs); fs.Flush(); //清空stream的缓存,并且把缓存中的数据输出到file } DataTable dt = Haikan3.Utils.ExcelTools.ExcelToDataTable(file.ToString(), "Sheet1", true); if (dt == null || dt.Rows.Count == 0) { response.SetFailed("表格无数据"); return(Ok(response)); } else { if (!dt.Columns.Contains("矫正单位")) { response.SetFailed("无‘矫正单位’列"); return(Ok(response)); } if (!dt.Columns.Contains("姓名")) { response.SetFailed("无‘姓名’列"); return(Ok(response)); } if (!dt.Columns.Contains("矫正状态")) { response.SetFailed("无‘矫正状态’列"); return(Ok(response)); } if (!dt.Columns.Contains("定位手机")) { response.SetFailed("无‘定位手机’列"); return(Ok(response)); } if (!dt.Columns.Contains("司法部上报状态")) { response.SetFailed("无‘司法部上报状态’列"); return(Ok(response)); } if (!dt.Columns.Contains("矫正类别")) { response.SetFailed("无‘矫正类别’列"); return(Ok(response)); } if (!dt.Columns.Contains("入矫时间")) { response.SetFailed("无‘入矫时间’列"); return(Ok(response)); } if (!dt.Columns.Contains("矫正开始时间")) { response.SetFailed("无‘矫正开始时间’列"); return(Ok(response)); } if (!dt.Columns.Contains("入矫时间")) { response.SetFailed("无‘入矫时间’列"); return(Ok(response)); } for (int i = 0; i < dt.Rows.Count; i++) { var entity = new RectifyInfo(); entity.RectifyInfoUuid = Guid.NewGuid(); if (!string.IsNullOrEmpty(dt.Rows[i]["矫正单位"].ToString())) { entity.RectifyInfoUnit = dt.Rows[i]["矫正单位"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["姓名"].ToString())) { entity.RectifyInfoName = dt.Rows[i]["姓名"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["矫正状态"].ToString())) { entity.RectifyInfoStaues = dt.Rows[i]["矫正状态"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["定位手机"].ToString())) { entity.DweiPhone = dt.Rows[i]["定位手机"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["司法部上报状态"].ToString())) { entity.ShangbanStaues = dt.Rows[i]["司法部上报状态"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["矫正类别"].ToString())) { entity.RectifyType = dt.Rows[i]["矫正类别"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["入矫时间"].ToString())) { var t = DateTimeHandle.TransStrToDateTime(dt.Rows[i]["入矫时间"].ToString()); if (t == DateTime.MinValue) { entity.RectifyTiem = dt.Rows[i]["入矫时间"].ToString(); } else { var tcopy = DateTimeHandle.TransformDataShort(t); entity.RectifyTiem = tcopy; } } if (!string.IsNullOrEmpty(dt.Rows[i]["矫正开始时间"].ToString())) { var t = DateTimeHandle.TransStrToDateTime(dt.Rows[i]["矫正开始时间"].ToString()); if (t == DateTime.MinValue) { entity.KaishiTime = dt.Rows[i]["矫正开始时间"].ToString(); } else { var tcopy = DateTimeHandle.TransformDataShort(t); entity.KaishiTime = tcopy; } } if (!string.IsNullOrEmpty(dt.Rows[i]["矫正结束时间"].ToString())) { var t = DateTimeHandle.TransStrToDateTime(dt.Rows[i]["矫正结束时间"].ToString()); if (t == DateTime.MinValue) { entity.JiesuTime = dt.Rows[i]["矫正结束时间"].ToString(); } else { var tcopy = DateTimeHandle.TransformDataShort(t); entity.JiesuTime = tcopy; } } if (!string.IsNullOrEmpty(dt.Rows[i]["性别"].ToString())) { entity.Sex = dt.Rows[i]["性别"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["出生日期"].ToString())) { entity.Birthday = dt.Rows[i]["出生日期"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["身份证"].ToString())) { entity.IdentityCard = dt.Rows[i]["身份证"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["原判刑期"].ToString())) { entity.Cirterion = dt.Rows[i]["原判刑期"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["现住地址"].ToString())) { entity.Address = dt.Rows[i]["现住地址"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["民族"].ToString())) { entity.Nation = dt.Rows[i]["民族"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["文化程度"].ToString())) { entity.Standard = dt.Rows[i]["文化程度"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["有无服务成员"].ToString())) { entity.Service = dt.Rows[i]["有无服务成员"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["服务时间"].ToString())) { entity.ServicingTime = dt.Rows[i]["服务时间"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[i]["婚姻状态"].ToString())) { entity.Marriage = dt.Rows[i]["婚姻状态"].ToString(); } entity.IsDeleted = 0; entity.AddTime = DateTime.Now.ToString("yyyy-MM-dd"); entity.AddPeople = AuthContextService.CurrentUser.DisplayName; _dbContext.RectifyInfo.Add(entity); _dbContext.SaveChanges(); successcount++; } } responsemsgsuccess = "<p style='color:green'>导入成功:" + successcount + "条</p></br>" + responsemsgsuccess; responsemsgrepeat = "<p style='color:orange'>重复需手动修改数据:" + repeatcount + "条</p></br>" + responsemsgrepeat; responsemsgdefault = "<p style='color:red'>导入失败:" + defaultcount + "条</p></br>" + responsemsgdefault; ToLog.AddLog("导入", "成功:导入:矫正人员信息数据", _dbContext); //DateTime endTime = DateTime.Now; //TimeSpan useTime = endTime - beginTime; //string taketime = "导入时间" + useTime.TotalSeconds.ToString() + "秒 "; response.SetData(JsonConvert.DeserializeObject(JsonConvert.SerializeObject(new { //time = taketime, successmsg = responsemsgsuccess , repeatmsg = responsemsgrepeat, defaultmsg = responsemsgdefault }))); return(Ok(response)); } catch (Exception ex) { response.SetFailed(ex.Message); return(Ok(response)); } } }