Пример #1
0
 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) + ")";
     }
 }
Пример #2
0
 protected void btnProjectEnd_Click(object sender, CommandEventArgs e)
 {
     using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
     {
         ProjectCollection.WebUI.Models.Project ThisProject = (from p in ProjectModel.Project
                                                               where p.ProjectId.ToString() == e.CommandArgument.ToString()
                                                               select p).First();
         ThisProject.progress                 = new Guid("00000000-0000-0000-0000-000000000128");
         ThisProject.ProductionProgress       = new Guid("00000000-0000-0000-0000-000000000128");
         ThisProject.ContentProgress          = new Guid("00000000-0000-0000-0000-000000000128");
         ThisProject.ContentLastModifyDate    = DateTime.Now;
         ThisProject.ProductionLastModifyDate = DateTime.Now;
         ProjectModel.SaveChanges();
     }
 }
Пример #3
0
 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
 }
Пример #4
0
        public void ProcessRequest(HttpContext context)
        {
            //Stream reqStream = HttpContext.Current.Request.InputStream;
            //byte[] buffer = new byte[(int)reqStream.Length];
            //reqStream.Read(buffer, 0, (int)reqStream.Length);

            //Request
            StreamReader sr     = new StreamReader(HttpContext.Current.Request.InputStream);
            string       strReq = sr.ReadToEnd();

            //Test
            //JObject Req = new JObject(
            //          new JProperty("loginname", "zxn"),
            //          new JProperty("password", "zxn")
            //new JProperty("userid", "00000000-0000-0000-0000-000000000003")
            //         );
            //string strReq = Req.ToString();


            #region ShowYouSend
            if (HttpContext.Current.Request["method"] == "showyousend")
            {
                context.Response.ContentType = "text/plain";
                context.Response.Write(strReq);
            }
            #endregion ShowYouSend

            #region Login
            if (HttpContext.Current.Request["method"] == "login")
            {
                JObject      o         = JObject.Parse(strReq);
                string       loginname = (string)o["loginname"];
                string       password  = (string)o["password"];
                BLL.UserInfo userInfo;
                userInfo = UserInfo.LoginInfo(loginname, password);
                JObject rss = new JObject();
                if (userInfo.Identity == Guid.Empty)//失败
                {
                    rss = new JObject(
                        new JProperty("Method", "login"),
                        new JProperty("ReturnStatus", "0")
                        );
                }
                else
                {
                    List <string> CurrentUserAuthority = userInfo.Authority;
                    List <string> AllAuthority         = UserAuthority.GetAllAuthority();
                    //Dictionary<string, string> CurrentUserAuthorityDic = new Dictionary<string, string>();
                    //foreach (string s in AllAuthority)
                    //{
                    //    if (CurrentUserAuthority.Contains(s))
                    //    {
                    //        CurrentUserAuthorityDic.Add(s, "1");
                    //    }
                    //    else
                    //    {
                    //        CurrentUserAuthorityDic.Add(s, "0");
                    //    }
                    //}
                    JObject CurrentUserAuthorityDic = new JObject();
                    foreach (string s in AllAuthority)
                    {
                        if (CurrentUserAuthority.Contains(s))
                        {
                            CurrentUserAuthorityDic.Add(s, "1");
                        }
                        else
                        {
                            CurrentUserAuthorityDic.Add(s, "0");
                        }
                    }
                    rss = new JObject(
                        new JProperty("Method", "login"),
                        new JProperty("ReturnStatus", "1"),
                        new JProperty("UserId", userInfo.Identity),
                        new JProperty("UserName", userInfo.RealName),
                        new JProperty("Authority",
                                      new JArray(CurrentUserAuthorityDic)
                                      )
                        );
                }
                context.Response.ContentType = "text/plain";
                context.Response.Write(rss.ToString());
            }
            #endregion Login
            #region MyTask
            else if (HttpContext.Current.Request["method"] == "mytask")
            {
                JObject      o      = JObject.Parse(strReq);
                string       UserId = (string)o["userid"];
                BLL.UserInfo userInfo;
                userInfo = UserInfo.GetUserById(UserId);
                List <string> CurrentUserAuthoritys = userInfo.Authority;
                JObject       rss = new JObject();
                foreach (string CurrentAuthority in CurrentUserAuthoritys)
                {
                    if (CurrentAuthority != "copy" && CurrentAuthority != "PlanManage")//无需处理特定工单
                    {
                        if (CurrentAuthority == "recond")
                        {
                            List <ProjectPlan> Recond  = BLL.ProjectPlan.GetRecondProjectPlan();
                            JObject            JRecond =
                                new JObject(
                                    new JProperty("Recond",
                                                  new JArray(
                                                      from r in Recond
                                                      orderby r.PlanDate
                                                      select new JObject(
                                                          new JProperty("ProjectPlanId", r.ProjectPlanId),
                                                          new JProperty("ProjectPlanNo", r.ProjectPlanNo),
                                                          new JProperty("Title", r.Title),
                                                          new JProperty("ProjectPlanTypeText", r.ProjectPlanTypeText),
                                                          new JProperty("PlanDate", r.PlanDate.ToString("D")),
                                                          new JProperty("ProgressText", r.ProgressText)
                                                          )
                                                      )
                                                  )
                                    );
                            rss.Merge(JRecond, new JsonMergeSettings
                            {
                                MergeArrayHandling = MergeArrayHandling.Concat
                            }
                                      );
                        }
                        else if (CurrentAuthority == "OpenClassReceive")
                        {
                            List <CustomProject> OpenClass = BLL.CustomProject.GetCustomProjectByType(new Guid("00000000-0000-0000-0000-000000000202"), new Guid("00000000-0000-0000-0000-000000000203"));
                            JObject JOpenClass             =
                                new JObject(
                                    new JProperty("OpenClassReceive",
                                                  new JArray(
                                                      from oc in OpenClass
                                                      orderby oc.SendingDate
                                                      select new JObject(
                                                          new JProperty("CustomProjectId", oc.CustomProjectId),
                                                          new JProperty("CustomProjectNo", oc.No),
                                                          new JProperty("Title", oc.Title),
                                                          new JProperty("SendingDate", oc.SendingDate.ToString("D")),
                                                          new JProperty("Lecturer", oc.Lecturer),
                                                          new JProperty("ProgressText", oc.ProgressText)
                                                          )
                                                      )
                                                  )
                                    );
                            rss.Merge(OpenClass, new JsonMergeSettings
                            {
                                MergeArrayHandling = MergeArrayHandling.Concat
                            }
                                      );
                        }
                        else if (CurrentAuthority == "OpenClassOperation")
                        {
                            List <CustomProject> OpenClass = BLL.CustomProject.GetCustomProjectByType(new Guid("00000000-0000-0000-0000-000000000202"), new Guid("00000000-0000-0000-0000-000000000204"));
                            JObject JOpenClass             =
                                new JObject(
                                    new JProperty("OpenClassOperation",
                                                  new JArray(
                                                      from oc in OpenClass
                                                      orderby oc.SendingDate
                                                      select new JObject(
                                                          new JProperty("CustomProjectId", oc.CustomProjectId),
                                                          new JProperty("CustomProjectNo", oc.No),
                                                          new JProperty("Title", oc.Title),
                                                          new JProperty("SendingDate", oc.SendingDate.ToString("D")),
                                                          new JProperty("Lecturer", oc.Lecturer),
                                                          new JProperty("ProgressText", oc.ProgressText)
                                                          )
                                                      )
                                                  )
                                    );
                            rss.Merge(OpenClass, new JsonMergeSettings
                            {
                                MergeArrayHandling = MergeArrayHandling.Concat
                            }
                                      );
                        }
                        else if (CurrentAuthority == "OpenClassPublish")
                        {
                            List <CustomProject> OpenClass = BLL.CustomProject.GetCustomProjectByType(new Guid("00000000-0000-0000-0000-000000000202"), new Guid("00000000-0000-0000-0000-000000000205"));
                            JObject JOpenClass             =
                                new JObject(
                                    new JProperty("OpenClassPublish",
                                                  new JArray(
                                                      from oc in OpenClass
                                                      orderby oc.SendingDate
                                                      select new JObject(
                                                          new JProperty("CustomProjectId", oc.CustomProjectId),
                                                          new JProperty("CustomProjectNo", oc.No),
                                                          new JProperty("Title", oc.Title),
                                                          new JProperty("SendingDate", oc.SendingDate.ToString("D")),
                                                          new JProperty("Lecturer", oc.Lecturer),
                                                          new JProperty("ProgressText", oc.ProgressText)
                                                          )
                                                      )
                                                  )
                                    );
                            rss.Merge(OpenClass, new JsonMergeSettings
                            {
                                MergeArrayHandling = MergeArrayHandling.Concat
                            }
                                      );
                        }
                        else if (CurrentAuthority == "OpenClassCheck")
                        {
                            List <CustomProject> OpenClass = BLL.CustomProject.GetCustomProjectByType(new Guid("00000000-0000-0000-0000-000000000202"), new Guid("00000000-0000-0000-0000-000000000207"));
                            JObject JOpenClass             =
                                new JObject(
                                    new JProperty("OpenClassCheck",
                                                  new JArray(
                                                      from oc in OpenClass
                                                      orderby oc.SendingDate
                                                      select new JObject(
                                                          new JProperty("CustomProjectId", oc.CustomProjectId),
                                                          new JProperty("CustomProjectNo", oc.No),
                                                          new JProperty("Title", oc.Title),
                                                          new JProperty("SendingDate", oc.SendingDate.ToString("D")),
                                                          new JProperty("Lecturer", oc.Lecturer),
                                                          new JProperty("ProgressText", oc.ProgressText)
                                                          )
                                                      )
                                                  )
                                    );
                            rss.Merge(OpenClass, new JsonMergeSettings
                            {
                                MergeArrayHandling = MergeArrayHandling.Concat
                            }
                                      );
                        }
                        else
                        {
                            List <Project> ProjectList = BLL.Project.GetProjectList(CurrentAuthority, UserId);
                            JObject        JProject    =
                                new JObject(
                                    new JProperty(CurrentAuthority,
                                                  new JArray(
                                                      from p in ProjectList
                                                      orderby p.SendingDate
                                                      select new JObject(
                                                          //new JProperty("ProjectId", p.ProjectId),
                                                          //new JProperty("ProjectNo", p.ProjectNo),
                                                          //new JProperty("Title", p.CourseName),
                                                          //new JProperty("SendingDate", p.SendingDate.ToString("D")),
                                                          //new JProperty("Lecturer", p.lecturer),
                                                          //new JProperty("ProgressText", p.ProgressText)
                                                          from System.Reflection.PropertyInfo ProjectProperty in p.GetType().GetProperties()
                                                          select new JProperty(
                                                              ProjectProperty.Name, ProjectProperty.GetValue(p)
                                                              )
                                                          )
                                                      )
                                                  )
                                    );
                            rss.Merge(JProject, new JsonMergeSettings
                            {
                                MergeArrayHandling = MergeArrayHandling.Concat
                            }
                                      );
                        }
                    }
                }
                JObject ResRss = new JObject(
                    new JProperty("method", "mytask"),
                    new JProperty("tasks",
                                  new JObject(rss)
                                  )
                    );
                context.Response.ContentType = "text/plain";
                context.Response.Write(ResRss.ToString());
            }
            #endregion MyTask
            #region PlanList
            else if (HttpContext.Current.Request["method"] == "allplan")
            {
                JObject o         = JObject.Parse(strReq);
                int     PageIndex = Convert.ToInt16((string)o["pageindex"]);
                JObject rss       = new JObject();
                rss = new JObject(
                    new JProperty("method", "allplan")
                    );
                List <ProjectPlan> PlanList = BLL.ProjectPlan.GetAllProjectPlanPage(PageIndex);
                JObject            JPlan    =
                    new JObject(
                        new JProperty("Plan",
                                      new JArray(
                                          from p in PlanList
                                          orderby p.PlanDate
                                          select new JObject(
                                              //new JProperty("ProjectPlanId", p.ProjectPlanId),
                                              //new JProperty("ProjectNo", p.ProjectPlanNo),
                                              //new JProperty("Title", p.Title),
                                              //new JProperty("PlanDate", p.PlanDate.ToString("D")),
                                              //new JProperty("Lecturer", p.Lecturer),
                                              //new JProperty("ProgressText", p.ProgressText),
                                              //new JProperty("ProjectCount", p.ProjectCount),
                                              //new JProperty("ProjectFinishCount", p.ProjectFinishCount),
                                              //new JProperty("ProjectDelayCount", p.ProjectDelayCount),
                                              //new JProperty("ProjectPlanTypeId", p.ProjectPlanTypeId)
                                              from System.Reflection.PropertyInfo PlanProperty in p.GetType().GetProperties()
                                              select new JProperty(
                                                  PlanProperty.Name, PlanProperty.GetValue(p)
                                                  )
                                              )
                                          )
                                      )
                        );
                rss.Merge(JPlan, new JsonMergeSettings
                {
                    MergeArrayHandling = MergeArrayHandling.Concat
                }
                          );
                context.Response.ContentType = "text/plain";
                context.Response.Write(rss.ToString());
            }
            else if (HttpContext.Current.Request["method"] == "finishedplan")
            {
                JObject o         = JObject.Parse(strReq);
                int     PageIndex = Convert.ToInt16((string)o["pageindex"]);
                JObject rss       = new JObject();
                rss = new JObject(
                    new JProperty("method", "finishedplan")
                    );
                List <ProjectPlan> PlanList = BLL.ProjectPlan.GetFinishedProjectPlanPage(PageIndex);
                JObject            JPlan    =
                    new JObject(
                        new JProperty("Plan",
                                      new JArray(
                                          from p in PlanList
                                          orderby p.PlanDate
                                          select new JObject(
                                              from System.Reflection.PropertyInfo PlanProperty in p.GetType().GetProperties()
                                              select new JProperty(
                                                  PlanProperty.Name, PlanProperty.GetValue(p)
                                                  )
                                              )
                                          )
                                      )
                        );
                rss.Merge(JPlan, new JsonMergeSettings
                {
                    MergeArrayHandling = MergeArrayHandling.Concat
                }
                          );
                context.Response.ContentType = "text/plain";
                context.Response.Write(rss.ToString());
            }
            else if (HttpContext.Current.Request["method"] == "unfinishplan")
            {
                JObject o         = JObject.Parse(strReq);
                int     PageIndex = Convert.ToInt16((string)o["pageindex"]);
                JObject rss       = new JObject();
                rss = new JObject(
                    new JProperty("method", "unfinishplan")
                    );
                List <ProjectPlan> PlanList = BLL.ProjectPlan.GetUnfinishProjectPlanPage(PageIndex);
                JObject            JPlan    =
                    new JObject(
                        new JProperty("Plan",
                                      new JArray(
                                          from p in PlanList
                                          orderby p.PlanDate
                                          select new JObject(
                                              from System.Reflection.PropertyInfo PlanProperty in p.GetType().GetProperties()
                                              select new JProperty(
                                                  PlanProperty.Name, PlanProperty.GetValue(p)
                                                  )
                                              )
                                          )
                                      )
                        );
                rss.Merge(JPlan, new JsonMergeSettings
                {
                    MergeArrayHandling = MergeArrayHandling.Concat
                }
                          );
                context.Response.ContentType = "text/plain";
                context.Response.Write(rss.ToString());
            }
            #endregion PlanList
            #region ProjectInPlan
            else if (HttpContext.Current.Request["method"] == "projectinplan")
            {
                JObject o      = JObject.Parse(strReq);
                Guid    PlanId = new Guid((string)o["planid"]);
                JObject rss    = new JObject();
                rss = new JObject(
                    new JProperty("method", "projectinplan")
                    );
                List <Project> ProjectList = BLL.Project.GetProjectByPlanId(PlanId);
                JObject        JProject    =
                    new JObject(
                        new JProperty("Project",
                                      new JArray(
                                          from p in ProjectList
                                          orderby p.SendingDate
                                          select new JObject(
                                              from System.Reflection.PropertyInfo ProjectProperty in p.GetType().GetProperties()
                                              select new JProperty(
                                                  ProjectProperty.Name, ProjectProperty.GetValue(p)
                                                  )
                                              )
                                          )
                                      )
                        );
                rss.Merge(JProject, new JsonMergeSettings
                {
                    MergeArrayHandling = MergeArrayHandling.Concat
                }
                          );
                context.Response.ContentType = "text/plain";
                context.Response.Write(rss.ToString());
            }
            #endregion ProjectInPlan
            #region Project
            else if (HttpContext.Current.Request["method"] == "allproject")
            {
                JObject o         = JObject.Parse(strReq);
                int     PageIndex = Convert.ToInt16((string)o["pageindex"]);
                JObject rss       = new JObject();
                rss = new JObject(
                    new JProperty("method", "allproject")
                    );
                List <Project> ProjectList = BLL.Project.GetAllProjectPage(PageIndex);
                JObject        JProject    =
                    new JObject(
                        new JProperty("Project",
                                      new JArray(
                                          from p in ProjectList
                                          orderby p.SendingDate
                                          select new JObject(
                                              from System.Reflection.PropertyInfo ProjectProperty in p.GetType().GetProperties()
                                              select new JProperty(
                                                  ProjectProperty.Name, ProjectProperty.GetValue(p)
                                                  )
                                              )
                                          )
                                      )
                        );
                rss.Merge(JProject, new JsonMergeSettings
                {
                    MergeArrayHandling = MergeArrayHandling.Concat
                }
                          );
                context.Response.ContentType = "text/plain";
                context.Response.Write(rss.ToString());
            }
            else if (HttpContext.Current.Request["method"] == "UpdateContentProgress")
            {
                string id    = HttpContext.Current.Request["id"];
                string value = HttpContext.Current.Request["progress"];
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    ProjectCollection.WebUI.Models.Project ThisProject = (from p in ProjectModel.Project
                                                                          where p.ProjectNo == id
                                                                          select p).First();
                    ThisProject.progress            = new Guid(value);
                    ThisProject.ContentProgress     = new Guid(value);
                    ThisProject.ShorthandFinishDate = DateTime.Now;
                    ProjectModel.SaveChanges();
                }
                context.Response.ContentType = "text/plain";
                context.Response.Write("success");
            }
            else if (HttpContext.Current.Request["method"] == "NewProjectWithoutVideo")
            {
                string name        = HttpContext.Current.Request["name"];
                string lecturer    = HttpContext.Current.Request["lecturer"];
                string LecturerJob = HttpContext.Current.Request["lecturerjob"];
                string STTType     = HttpContext.Current.Request["stttype"];
                string user        = HttpContext.Current.Request["user"];
                string projectid   = HttpContext.Current.Request["projectid"];
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    ProjectCollection.WebUI.Models.user_info User = (from p in ProjectModel.user_info
                                                                     where p.login_name == user
                                                                     select p).First();
                    ProjectCollection.WebUI.Models.Project project = new Models.Project();

                    project.ProjectId     = Guid.NewGuid();
                    project.ProjectPlanId = new Guid("f48c8eeb-e321-4f6c-9d08-c4fa5703834e");
                    //
                    project.ProjectTypeId = new Guid("00000000-0000-0000-0000-000000000199");
                    project.ProjectNo     = "S-" + DateTime.Now.ToString("yyyyMMdd-HHmmss");
                    project.emergency     = new Guid("00000000-0000-0000-0000-000000000030");
                    project.WorkType      = new Guid("00000000-0000-0000-0000-000000000027");
                    project.CourseName    = name;
                    project.notice        = new Guid("00000000-0000-0000-0000-000000000034");
                    project.headline      = new Guid("00000000-0000-0000-0000-000000000036");
                    project.TextCategory  = "";
                    project.lecturer      = lecturer;
                    project.LecturerJob   = LecturerJob;
                    project.InCharge      = User.user_identity;
                    project.CreateNote    = "自动生成工单,需上传高清视频";
                    project.ExtraNote     = "";
                    project.ContentNeeds  = new Guid("00000000-0000-0000-0000-000000000042");
                    project.PublishNeeds  = new Guid("00000000-0000-0000-0000-000000000042");
                    project.CanBeSold     = new Guid("00000000-0000-0000-0000-000000000043");
                    project.EpisodeCount  = 1;
                    //
                    project.progress = new Guid("00000000-0000-0000-0000-000000000120");
                    project.STTType  = STTType;
                    project.MakeType = "new";
                    ProjectModel.SaveChanges();
                }
            }
            else if (HttpContext.Current.Request["method"] == "NewProjectWithVideo")
            {
                string name        = HttpContext.Current.Request["name"];
                string lecturer    = HttpContext.Current.Request["lecturer"];
                string LecturerJob = HttpContext.Current.Request["lecturerjob"];
                string STTType     = HttpContext.Current.Request["stttype"];
                string user        = HttpContext.Current.Request["user"];
                string projectid   = HttpContext.Current.Request["projectid"];
                string logstr      = HttpContext.Current.Request["str"];
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    ProjectCollection.WebUI.Models.user_info User = (from p in ProjectModel.user_info
                                                                     where p.login_name == user
                                                                     select p).First();
                    ProjectCollection.WebUI.Models.Project project = new Models.Project();

                    project.ProjectId     = Guid.NewGuid();
                    project.ProjectPlanId = new Guid("f48c8eeb-e321-4f6c-9d08-c4fa5703834e");
                    //
                    project.ProjectTypeId = new Guid("00000000-0000-0000-0000-000000000199");
                    project.ProjectNo     = "S-" + DateTime.Now.ToString("yyyyMMdd-HHmmss");
                    project.emergency     = new Guid("00000000-0000-0000-0000-000000000030");
                    project.WorkType      = new Guid("00000000-0000-0000-0000-000000000027");
                    project.CourseName    = name;
                    project.notice        = new Guid("00000000-0000-0000-0000-000000000034");
                    project.headline      = new Guid("00000000-0000-0000-0000-000000000036");
                    project.TextCategory  = "";
                    project.lecturer      = lecturer;
                    project.LecturerJob   = LecturerJob;
                    project.InCharge      = User.user_identity;
                    project.CreateNote    = "自动生成工单";
                    project.ExtraNote     = "";
                    project.ContentNeeds  = new Guid("00000000-0000-0000-0000-000000000042");
                    project.PublishNeeds  = new Guid("00000000-0000-0000-0000-000000000042");
                    project.CanBeSold     = new Guid("00000000-0000-0000-0000-000000000043");
                    project.EpisodeCount  = 1;
                    //
                    project.progress = new Guid("00000000-0000-0000-0000-000000000210");
                    project.STTType  = STTType;
                    project.MakeType = "new";
                    ProjectModel.SaveChanges();
                    //
                    string CourseWorkType = "";
                    if (STTType == "low")
                    {
                        CourseWorkType = "OldVideoCopyNoSTT";
                    }
                    else
                    {
                        CourseWorkType = "OldVideoCopy";
                    }
                    string url = @"http://newpms.cei.cn/FTPVideoUpload/?link="
                                 + logstr
                                 + "&type="
                                 + CourseWorkType
                                 + "&title="
                                 + HttpUtility.UrlEncode(project.CourseName)
                                 + "&lecturer="
                                 + HttpUtility.UrlEncode(project.lecturer)
                                 + "&post="
                                 + HttpUtility.UrlEncode(project.LecturerJob)
                                 + "&src="
                                 + HttpUtility.UrlEncode(projectid)
                                 + "&ProjectNo="
                                 + HttpUtility.UrlEncode(project.ProjectNo);
                    //
                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                    request.Method      = "GET";
                    request.ContentType = "text/html;charset=UTF-8";
                    HttpWebResponse response         = (HttpWebResponse)request.GetResponse();
                    Stream          myResponseStream = response.GetResponseStream();
                    StreamReader    myStreamReader   = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
                    string          retString        = myStreamReader.ReadToEnd();
                    myStreamReader.Close();
                    myResponseStream.Close();
                    //
                    JObject jo = (JObject)JsonConvert.DeserializeObject(retString);
                    if (jo["data"].ToString() == "数据添加成功")
                    {
                    }
                    else
                    {
                        throw new MyException(jo["status"].ToString());
                    }
                }
            }
            #endregion Project
            else
            {
            }
        }
        //Bind
        private void SearchProjectList(string group = "")
        {
            if (this.Request["mode"] == "browse")
            {
                this.gvProject.DataSource = BLL.Project.GetAllProject();
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "capture")
            {
                this.gvProject.DataSource = BLL.Project.GetCategoryProject("ProgressCapture");
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "capturecheck")
            {
                this.gvProject.DataSource = BLL.Project.GetCategoryProject("ProgressCaptureCheck");
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "execution")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryIdProject(new Guid("00000000-0000-0000-0000-000000000121"));
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "shorthand")
            {
                List <Project> Projects = BLL.Project.GetDictionaryIdProject(new Guid("00000000-0000-0000-0000-000000000109"));
                Projects = Projects.Where(a => a.CourseType == "micro").ToList();
                //
                //this.gvProject.DataSource = BLL.Project.GetDictionaryIdProject(new Guid("00000000-0000-0000-0000-000000000109"));
                this.gvProject.DataSource = Projects;
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "contentreceive")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryContentIdProject(new Guid("00000000-0000-0000-0000-000000000107"));
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "contentfinish")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryContentIdProject(new Guid("00000000-0000-0000-0000-000000000111"), new Guid("00000000-0000-0000-0000-000000000124"), CurrentUserId);
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "contentcheck")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryContentIdProject(new Guid("00000000-0000-0000-0000-000000000112"), new Guid("00000000-0000-0000-0000-000000000123"));
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "contentrecheck")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryContentIdProject(new Guid("00000000-0000-0000-0000-000000000122"));
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "productionreceive")
            {
                List <Project> Projects = BLL.Project.GetDictionaryProductionIdProject(new Guid("00000000-0000-0000-0000-000000000106"), new Guid("00000000-0000-0000-0000-000000000132"));
                //
                if (group == "00000000-0000-0000-0000-000000000008")
                {
                    Projects = Projects.Where(a => a.CourseType != "elite" && a.CourseType != "micro").ToList();
                }
                else if (group == "00000000-0000-0000-0000-000000000031")
                {
                    Projects = Projects.Where(a => a.CourseType == "elite" || a.CourseType == "micro").ToList();
                }
                //
                this.gvProject.DataSource = Projects;
                this.gvProject.DataBind();
                //int count = gvProject.Rows.Count;
                //for (int i = 0; i < count; i++)
                //{
                //    if (Projects[i+(gvProject.PageSize*gvProject.PageIndex)].emergency.ToString() == "00000000-0000-0000-0000-000000000030")
                //    { }
                //    else
                //    {
                //        gvProject.Rows[i].ForeColor = System.Drawing.Color.OrangeRed;
                //    }
                //}
            }
            else if (this.Request["mode"] == "productionfinish")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryProductionIdProject(new Guid("00000000-0000-0000-0000-000000000114"), new Guid("00000000-0000-0000-0000-000000000125"), CurrentUserId);
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "productioncheck")
            {
                List <Project> Projects = BLL.Project.GetDictionaryProductionIdProject(new Guid("00000000-0000-0000-0000-000000000115"));
                //this.gvProject.DataSource = BLL.Project.GetDictionaryProductionIdProject(new Guid("00000000-0000-0000-0000-000000000115"));

                //
                if (group == "00000000-0000-0000-0000-000000000008")
                {
                    Projects = Projects.Where(a => a.CourseType != "elite" && a.CourseType != "micro").ToList();
                }
                else if (group == "00000000-0000-0000-0000-000000000031")
                {
                    Projects = Projects.Where(a => a.CourseType == "elite" || a.CourseType == "micro").ToList();
                }
                //
                this.gvProject.DataSource = Projects;
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "publish")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryIdProject(new Guid("00000000-0000-0000-0000-000000000117"));
                this.gvProject.DataBind();
            }
            else if (this.Request["mode"] == "check")
            {
                this.gvProject.DataSource = BLL.Project.GetDictionaryIdProject(new Guid("00000000-0000-0000-0000-000000000118"));
                this.gvProject.DataBind();
            }
            else
            {
                this.gvProject.DataSource = BLL.Project.GetAllProject();
                this.gvProject.DataBind();
            }
            //
            int count = gvProject.Rows.Count;

            for (int i = 0; i < count; i++)
            {
                var    ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities();
                string ThisId       = gvProject.Rows[i].Cells[1].Text;
                ProjectCollection.WebUI.Models.Project ThisProject = (from p in ProjectModel.Project
                                                                      where p.ProjectNo.ToString() == ThisId
                                                                      select p).First();
                if (ThisProject.emergency.ToString() == "00000000-0000-0000-0000-000000000031")
                {
                    gvProject.Rows[i].ForeColor = System.Drawing.Color.Orange;
                }
                else if (ThisProject.emergency.ToString() == "00000000-0000-0000-0000-000000000032")
                {
                    gvProject.Rows[i].ForeColor = System.Drawing.Color.Red;
                }
                else
                {
                }
            }
        }