protected void GridViewTop_SelectedIndexChanged(object sender, EventArgs e)
        {
            int      count        = Convert.ToInt32(GridViewTop.SelectedRow.Cells[0].Text);
            DateTime StartTime    = Convert.ToDateTime(hidStartDate.Value);
            DateTime EndTime      = Convert.ToDateTime(hidEndDate.Value);
            var      ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities();

            ProjectModel.Database.CommandTimeout = 600000;
            var AllOrder = (from o in ProjectModel.TempOrder
                            join c in ProjectModel.TempCourse on o.CourseId equals c.CourseId
                            where (c.type == "自筹") && (!string.IsNullOrEmpty(c.SourceCourseId)) &&
                            (c.SourceCourseId != "") && (c.CreateDate >= StartTime) && (c.CreateDate <= EndTime)
                            select new
            {
                name = c.title,
                sourceid = c.SourceCourseId,
                customid = o.CustomerId
            });
            var DistinctOrder = AllOrder.GroupBy(o => new { o.customid, o.sourceid })
                                .Select(g => g.FirstOrDefault());
            var OrderCount = from o in DistinctOrder
                             group o by new { o.sourceid } into oc
            where oc.Count() == count
                select new
            {
                //id = oc.Key.sourceid,
                title = (from c in ProjectModel.TempCourse where c.SourceCourseId == oc.Key.sourceid select new { title = c.title }).FirstOrDefault().title,
                count = oc.Count()
            };

            GridViewDetails.DataSource = OrderCount.ToList();
            GridViewDetails.DataBind();
        }
Exemplo n.º 2
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) + ")";
     }
 }
Exemplo n.º 3
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();
     }
 }
 //
 protected void btnPassOnclick(object sender, EventArgs e)
 {
     using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
     {
         ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                    where p.id == this.hidProjectId.Value.ToString()
                                                                    select p).First();
         if (this.Request["mode"] == "check")
         {
             ThisProject.signer    = this.LoginUserInfo.Identity;
             ThisProject.CheckDate = DateTime.Now;
             ThisProject.CheckNote = this.txtCheckNote.Text;
             ThisProject.progress  = "等待执行";
         }
         else if (this.Request["mode"] == "helpexecute")
         {
             ThisProject.helper           = this.LoginUserInfo.Identity;
             ThisProject.HelperFinishDate = DateTime.Now;
             ThisProject.HelperFinishNote = this.txtHelperFinishNote.Text;
         }
         else if (this.Request["mode"] == "pic")
         {
             ThisProject.PicProducer   = this.LoginUserInfo.Identity;
             ThisProject.PicFinishDate = DateTime.Now;
             ThisProject.PicFinishNote = this.txtPicFinishNote.Text;
         }
         else if (this.Request["mode"] == "template")
         {
             ThisProject.TemplateProducer   = this.LoginUserInfo.Identity;
             ThisProject.TemplateFinishDate = DateTime.Now;
             ThisProject.TemplateFinishNote = this.txtTemplateFinishNote.Text;
         }
         else if (this.Request["mode"] == "attachment")
         {
             ThisProject.AttachmentProducer   = this.LoginUserInfo.Identity;
             ThisProject.AttachmentFinishDate = DateTime.Now;
             ThisProject.AttachmentFinishNote = this.txtAttachmentFinishNote.Text;
         }
         else if (this.Request["mode"] == "mchelpexecute")
         {
             ThisProject.McHelper           = this.LoginUserInfo.Identity;
             ThisProject.McHelperFinishDate = DateTime.Now;
             //ThisProject.AttachmentFinishNote = this.txtAttachmentFinishNote.Text;
         }
         ProjectModel.SaveChanges();
     }
     this.Redirect("~/pages/MyTask.aspx?mode=manufacture&range=now");
 }
 //
 protected void btnDelOnclick(object sender, EventArgs e)
 {
     using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
     {
         ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                    where p.id == this.hidProjectId.Value.ToString()
                                                                    select p).First();
         if (ThisProject != null)
         {
             //ProjectModel.BatchProject.Remove(ThisProject);
             ThisProject.progress = "作废";
         }
         var i = ProjectModel.SaveChanges();
     }
     this.Redirect("~/pages/MyTask.aspx?mode=manufacture&range=now");
 }
 protected void gvProject_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     gvProject.PageIndex = e.NewPageIndex;
     if (this.Request["mode"] == "browse")
     {
     }
     else
     {
         CurrentUserId = new Guid(this.Request["userid"]);
         var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities();
         ProjectCollection.WebUI.Models.user_info ThisUser = (from p in ProjectModel.user_info
                                                              where p.user_identity == CurrentUserId
                                                              select p).First();
         SearchProjectList(ThisUser.SupervisorRole.ToString());
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //string host = HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port;
            //string CourseTimes = HttpGet("http://" + host + "/InterFace/custom.ashx?method=CourseTimesList&start="+ hidStartDate.Value+ "&end="+hidEndDate.Value, "application/json");
            //JArray CourseTimesJ = JsonConvert.DeserializeObject<JArray>(CourseTimes);
            DateTime StartTime = Convert.ToDateTime(hidStartDate.Value);
            DateTime EndTime   = Convert.ToDateTime(hidEndDate.Value);
            //string area = DDarea.SelectedValue;
            var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities();
            var AllOrder     = (from o in ProjectModel.TempOrder
                                join c in ProjectModel.TempCourse on o.CourseId equals c.CourseId
                                where (c.type == "自筹") && (!string.IsNullOrEmpty(c.SourceCourseId)) &&
                                (c.SourceCourseId != "") && (c.CreateDate >= StartTime) && (c.CreateDate <= EndTime)
                                //&& o.TempCustomer.area == area
                                select new
            {
                name = c.title,
                sourceid = c.SourceCourseId,
                customid = o.CustomerId
            });
            var DistinctOrder = AllOrder.GroupBy(o => new { o.customid, o.sourceid })
                                .Select(g => g.FirstOrDefault());
            var OrderCount = from o in DistinctOrder
                             group o by new { o.sourceid } into oc
            orderby oc.Count() descending
            select new
            {
                id = oc.Key.sourceid,
                //title =(from c in ProjectModel.TempCourse where c.SourceCourseId == oc.Key.sourceid select c.title).Take(1),
                count = oc.Count()
            };
            var OrderGroup = from o in OrderCount
                             group o by new { o.count } into oc
            orderby oc.Key.count descending
                select new
            {
                订购次数 = oc.Key.count,
                课件数量 = oc.Count()
            };

            GridViewTop.DataSource = OrderGroup.ToList();
            GridViewTop.DataBind();
        }
Exemplo n.º 8
0
        //
        protected void gvProject_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            string ID        = "";
            string PageIndex = gvProject.PageIndex.ToString();
            int    count     = gvProject.Rows.Count;

            for (int i = 0; i < count; i++)
            {
                ID = gvProject.DataKeys[i].Value.ToString();
                HyperLink CurrentLink = (HyperLink)gvProject.Rows[i].FindControl("aSelect");
                //CurrentLink.NavigateUrl = "~/pages/CustomTaskDetails.aspx?mode=" + this.Request["mode"] + "&id=" + ID;
                string encode = string.Empty;
                byte[] bytes  = Encoding.UTF8.GetBytes(this.LoginUserInfo.LoginName + "_" + this.LoginUserInfo.Password);
                encode = HttpUtility.UrlEncode(Convert.ToBase64String(bytes), Encoding.UTF8);
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                               where p.id == ID
                                                                               select p).First();
                    if (this.Request["mode"] == "check")
                    {
                        CurrentLink.NavigateUrl = "~/pages/CustomTaskDetails.aspx?mode=" + this.Request["mode"] + "&id=" + ID;
                    }
                    else if (this.Request["mode"] == "execute")
                    {
                        CurrentLink.NavigateUrl = "http://newpms.cei.cn/webpages/V2/index.html#/HomePage?mode=disposal&project=" + ThisProject.id + "&login="******"mode"] == "helpexecute")
                    {
                        CurrentLink.NavigateUrl = "~/pages/CustomTaskDetails.aspx?mode=" + this.Request["mode"] + "&id=" + ID;
                    }
                    else if (this.Request["mode"] == "mchelpexecute")
                    {
                        CurrentLink.NavigateUrl = "~/pages/CustomTaskDetails.aspx?mode=" + this.Request["mode"] + "&id=" + ID;
                    }
                    else
                    {
                        CurrentLink.NavigateUrl = "~/pages/CustomTaskDetails.aspx?mode=" + this.Request["mode"] + "&id=" + ID;
                    }
                }
            }
        }
 //
 protected void btnExecuteOnclick(object sender, EventArgs e)
 {
     using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
     {
         ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                    where p.id == this.hidProjectId.Value.ToString()
                                                                    select p).First();
         if (ThisProject.progress == "等待执行")
         {
             string encode = string.Empty;
             byte[] bytes  = Encoding.UTF8.GetBytes(this.LoginUserInfo.LoginName + "_" + this.LoginUserInfo.Password);
             encode = Convert.ToBase64String(bytes);
             Response.Write("<script>window.open('http://newpms.cei.cn/webpages/V2/index.html#/HomePage?mode=disposal&project=" + ThisProject.id + "&login="******"','_blank');</script>");
         }
         else
         {
             //btnExecute.Text = "已处理";
         }
     }
 }
Exemplo n.º 10
0
        private void DataBindProjectPlanList(string range, string process)
        {
            //using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
            //{
            var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities();
            var projects     = (from p in ProjectModel.BatchProject
                                orderby p.CreateDate descending
                                select p);

            data = projects.ToList();
            this.axgvProject.DataSource = data;
            this.axgvProject.DataBind();
            //}
            List <object> keyValues = axgvProject.GetCurrentPageRowValues(axgvProject.KeyFieldName);

            foreach (object key in keyValues)
            {
                HyperLink CurrentASelect = (HyperLink)axgvProject.FindRowCellTemplateControlByKey(key, (DevExpress.Web.GridViewDataColumn)axgvProject.Columns["Operate"], "aSelect");
                CurrentASelect.NavigateUrl = "~/pages/CustomTaskDetails.aspx?mode=browse" + "&id=" + key.ToString();
            }
        }
Exemplo n.º 11
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
            {
            }
        }
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
            }
            //
            string id = this.Request["id"];

            this.hidProjectId.Value = id;
            using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
            {
                ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                           where p.id == id
                                                                           select p).First();
                this.InitBrowseData(ThisProject);
                //
                #region browse
                if (this.Request["mode"] == "browse")
                {
                    try
                    {
                        PanelCheck.Visible = true;
                        this.InitCheckData(ThisProject);
                    }
                    catch
                    {
                    }
                    finally
                    {
                    }
                    //
                    try
                    {
                        PanelFinish.Visible = true;
                        this.InitExecuteData(ThisProject);
                    }
                    catch
                    {
                    }
                    finally
                    {
                    }
                    //
                    try
                    {
                        PanelHelpFinish.Visible       = true;
                        this.txtHelpSendingDate.Text  = ThisProject.HelpSendingDate.ToString();
                        this.txtHelper.Text           = ThisProject.user_info5.real_name;
                        this.txtHelperFinishDate.Text = ThisProject.HelperFinishDate.ToString();
                        this.txtHelperFinishNote.Text = ThisProject.HelperFinishNote.ToString();
                    }
                    catch
                    {
                    }
                    finally
                    {
                    }
                    //
                    //
                    try
                    {
                        PanelPicFinish.Visible      = true;
                        this.txtPicSendingDate.Text = ThisProject.PicSendingDate.ToString();
                        this.txtPicMaker.Text       = ThisProject.user_info3.real_name;
                        this.txtPicFinishDate.Text  = ThisProject.PicFinishDate.ToString();
                        this.txtPicFinishNote.Text  = ThisProject.PicFinishNote.ToString();
                    }
                    catch
                    {
                    }
                    finally
                    {
                    }
                    //
                    try
                    {
                        PanelTemplateFinish.Visible      = true;
                        this.txtTemplateSendingDate.Text = ThisProject.TemplateSendingDate.ToString();
                        this.txtTemplateMaker.Text       = ThisProject.user_info4.real_name;
                        this.txtTemplateFinishDate.Text  = ThisProject.TemplateFinishDate.ToString();
                        this.txtTemplateFinishNote.Text  = ThisProject.TemplateFinishNote.ToString();
                    }
                    catch
                    {
                    }
                    finally
                    {
                    }
                    //
                    try
                    {
                        PanelAttachmentFinish.Visible      = true;
                        this.txtAttachmentSendingDate.Text = ThisProject.AttachmentSendingDate.ToString();
                        this.txtAttachmentMaker.Text       = ThisProject.user_info6.real_name;
                        this.txtAttachmentFinishDate.Text  = ThisProject.AttachmentFinishDate.ToString();
                        this.txtAttachmentFinishNote.Text  = ThisProject.AttachmentFinishNote.ToString();
                    }
                    catch
                    {
                    }
                    finally
                    {
                    }
                }
                #endregion browse
                #region check
                else if (this.Request["mode"] == "check")
                {
                    PanelCheck.Visible   = true;
                    this.btnPass.Visible = true;
                    btnDel.Visible       = true;
                }
                #endregion check
                #region execute
                else if (this.Request["mode"] == "execute")
                {
                    PanelCheck.Visible = true;
                    //this.btnExecute.Visible = true;
                    this.btnBack.Visible  = true;
                    this.aExecute.Visible = true;
                    this.InitCheckData(ThisProject);
                    if (ThisProject.progress == "等待执行")
                    {
                        string encode = string.Empty;
                        byte[] bytes  = Encoding.UTF8.GetBytes(this.LoginUserInfo.LoginName + "_" + this.LoginUserInfo.Password);
                        encode = HttpUtility.UrlEncode(Convert.ToBase64String(bytes), Encoding.UTF8);
                        aExecute.NavigateUrl = "http://newpms.cei.cn/webpages/V2/index.html#/HomePage?mode=disposal&project=" + ThisProject.id + "&login="******"已处理";
                    }
                }
                #endregion execute
                #region helpexecute
                else if (this.Request["mode"] == "helpexecute")
                {
                    PanelCheck.Visible      = true;
                    PanelHelpFinish.Visible = true;
                    this.InitCheckData(ThisProject);
                    this.txtHelpSendingDate.Text = ThisProject.HelpSendingDate.ToString();
                    byte[] bytes  = Encoding.UTF8.GetBytes(this.LoginUserInfo.LoginName + "_" + this.LoginUserInfo.Password);
                    string encode = HttpUtility.UrlEncode(Convert.ToBase64String(bytes), Encoding.UTF8);
                    this.aCourseList.NavigateUrl     = "http://newpms.cei.cn/webpages/V2/index.html#/HomePage?mode=browse&olddata=help&project=" + ThisProject.id + "&login="******"http://newpms.cei.cn/webpages/V2/index.html#/HomePage?mode=browse&olddata=help&project=" + ThisProject.id + "&login="******"完成";
                }
                #endregion helpexecute
                #region mchelpexecute
                else if (this.Request["mode"] == "mchelpexecute")
                {
                    PanelCheck.Visible        = true;
                    PanelMcHelpFinish.Visible = true;
                    this.InitCheckData(ThisProject);
                    this.txtHelpSendingDate.Text = ThisProject.McHelpSendingDate.ToString();
                    //byte[] bytes = Encoding.UTF8.GetBytes(this.LoginUserInfo.LoginName + "_" + this.LoginUserInfo.Password);
                    //string encode = HttpUtility.UrlEncode(Convert.ToBase64String(bytes), Encoding.UTF8);
                    //this.aCourseList.NavigateUrl = "http://newpms.cei.cn/webpages/V2/index.html#/HomePage?mode=browse&olddata=help&project=" + ThisProject.id + "&login="******"完成";
                }
                #endregion mchelpexecute
                #region pic
                else if (this.Request["mode"] == "pic")
                {
                    PanelCheck.Visible     = true;
                    PanelPicFinish.Visible = true;
                    this.InitCheckData(ThisProject);
                    this.txtPicSendingDate.Text = ThisProject.PicSendingDate.ToString();
                    this.btnPass.Visible        = true;
                    this.btnPass.Text           = "完成";
                }
                #endregion pic
                #region template
                else if (this.Request["mode"] == "template")
                {
                    PanelCheck.Visible          = true;
                    PanelTemplateFinish.Visible = true;
                    this.InitCheckData(ThisProject);
                    this.txtTemplateSendingDate.Text = ThisProject.TemplateSendingDate.ToString();
                    this.btnPass.Visible             = true;
                    this.btnPass.Text = "完成";
                }
                #endregion template
                #region attachment
                else if (this.Request["mode"] == "attachment")
                {
                    PanelCheck.Visible            = true;
                    PanelAttachmentFinish.Visible = true;
                    this.InitCheckData(ThisProject);
                    this.txtAttachmentSendingDate.Text = ThisProject.AttachmentSendingDate.ToString();
                    this.btnPass.Visible = true;
                    this.btnPass.Text    = "完成";
                }
                #endregion attachment
                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
                {
                }
            }
        }
Exemplo n.º 14
0
        //Bind
        private void SearchProjectList()
        {
            UserInfo CurrentUserInfo = (UserInfo)Session["key_userInfo"];

            if (this.Request["mode"] == "browse")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    select p);
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else if (this.Request["mode"] == "check")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    where p.progress == "等待审核" &&
                                    p.user_info.SupervisorRole == CurrentUserInfo.role_identity
                                    select p);
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else if (this.Request["mode"] == "execute")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    where p.progress == "等待执行"
                                    orderby p.CreateDate
                                    select p);
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else if (this.Request["mode"] == "helpexecute")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    where p.HelpSendingDate.HasValue && !p.HelperFinishDate.HasValue
                                    select p);
                    foreach (var p in projects)
                    {
                        p.progress = "等待执行";
                    }
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else if (this.Request["mode"] == "mchelpexecute")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    where p.McHelpSendingDate.HasValue && !p.McHelperFinishDate.HasValue
                                    select p);
                    foreach (var p in projects)
                    {
                        p.progress = "等待执行";
                    }
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else if (this.Request["mode"] == "pic")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    where p.PicSendingDate.HasValue && !p.PicFinishDate.HasValue
                                    select p);
                    foreach (var p in projects)
                    {
                        p.progress = "等待执行";
                    }
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else if (this.Request["mode"] == "template")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    where p.TemplateSendingDate.HasValue && !p.TemplateFinishDate.HasValue
                                    select p);
                    foreach (var p in projects)
                    {
                        p.progress = "等待执行";
                    }
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else if (this.Request["mode"] == "attachment")
            {
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    var projects = (from p in ProjectModel.BatchProject
                                    where p.AttachmentSendingDate.HasValue && !p.AttachmentFinishDate.HasValue
                                    select p);
                    foreach (var p in projects)
                    {
                        p.progress = "等待执行";
                    }
                    this.gvProject.DataSource = projects.ToList();
                    this.gvProject.DataBind();
                }
            }
            else
            {
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            CurrentUserId = new Guid(this.Request["userid"]);
            var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities();

            ProjectCollection.WebUI.Models.user_info ThisUser = (from p in ProjectModel.user_info
                                                                 where p.user_identity == CurrentUserId
                                                                 select p).First();

            if (!IsPostBack)
            {
                if (this.Request["mode"] == "browse")
                {
                }
                else
                {
                    SearchProjectList(ThisUser.SupervisorRole.ToString());
                }
            }
            else
            {
            }
            if (this.Request["mode"] == "browse")
            {
                //
                this.gvProject.Columns[0].Visible = false;
            }
            else if (this.Request["mode"] == "copy")
            {
                this.gvProject.Columns[7].Visible = false;
                this.gvProject.Columns[8].Visible = true;
            }
            else if (this.Request["mode"] == "capture")
            {
                aBatchHandle.Visible = true;
                aBatchHandle.Text    = "批量处理";
            }
            else if (this.Request["mode"] == "shorthand")
            {
                aBatchHandle.Visible = true;
                aBatchHandle.Text    = "批量完成";
            }
            else if (this.Request["mode"] == "contentreceive")
            {
                //    btnBatchHandle.Visible = true;
                //    btnBatchHandle.Text = "批量接收";
                //    btnBatchHandle.PostBackUrl = "~/pages/ProjectCreateEdit.aspx?mode=contentreceivebatchhandle";
                aBatchHandle.Visible = true;
                aBatchHandle.Text    = "批量接收";
            }
            else if (this.Request["mode"] == "contentfinish")
            {
                aBatchHandle.Visible     = true;
                btnBatchDownload.Visible = true;
            }
            else if (this.Request["mode"] == "contentcheck")
            {
                //    btnBatchSave.Visible = true;
                //    btnBatchHandle.Visible = true;
                //    btnBatchHandle.Text = "批量通过";
                //    btnBatchSave.PostBackUrl = "~/pages/ProjectCreateEdit.aspx?mode=contentcheckbatchsave";
                //    btnBatchHandle.PostBackUrl = "~/pages/ProjectCreateEdit.aspx?mode=contentcheckbatchhandle";
                aBatchSave.Visible   = true;
                aBatchHandle.Visible = true;
                aBatchHandle.Text    = "批量通过";
            }
            else if (this.Request["mode"] == "productionreceive")
            {
                //    btnBatchHandle.Visible = true;
                //    btnBatchHandle.Text = "批量接收";
                //    btnBatchHandle.PostBackUrl = "~/pages/ProjectCreateEdit.aspx?mode=productionreceivebatchhandle";
                aBatchHandle.Visible = true;
                aBatchHandle.Text    = "批量处理";
            }
            else if (this.Request["mode"] == "productionfinish")
            {
                //    btnBatchHandle.Visible = true;
                //    btnBatchHandle.Text = "批量完成";
                //    btnBatchHandle.PostBackUrl = "~/pages/ProjectCreateEdit.aspx?mode=productionfinishbatchhandle";
                aBatchHandle.Visible = true;
                aBatchHandle.Text    = "批量完成";
            }
            else if (this.Request["mode"] == "productioncheck")
            {
                //    btnBatchSave.Visible = true;
                //    btnBatchHandle.Visible = true;
                //    btnBatchHandle.Text = "批量通过";
                //    btnBatchSave.PostBackUrl = "~/pages/ProjectCreateEdit.aspx?mode=productioncheckbatchsave";
                //    btnBatchHandle.PostBackUrl = "~/pages/ProjectCreateEdit.aspx?mode=productioncheckbatchhandle";
                aBatchSave.Visible   = true;
                aBatchHandle.Visible = true;
                aBatchHandle.Text    = "批量通过";
            }
            else
            {
            }
            if (this.gvProject.Rows.Count < 1)
            {
                //btnBatchSave.Visible = false;
                //btnBatchHandle.Visible = false;
                aBatchSave.Visible   = false;
                aBatchHandle.Visible = false;
            }
            else
            {
            }
        }
Exemplo n.º 16
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
 }
Exemplo n.º 17
0
        public void ProcessRequest(HttpContext context)
        {
            //Request
            StreamReader sr     = new StreamReader(HttpContext.Current.Request.InputStream);
            string       strReq = sr.ReadToEnd();

            //context.Response.AppendHeader("Access-Control-Allow-Headers", "content-type");
            //context.Response.AppendHeader("Access-Control-Allow-Origin", "http://localhost:8080");
            //context.Response.AppendHeader("Access-Control-Allow-Credentials", "true");
            //string origin = HttpContext.Current.Request.Headers.Get("Origin");
            //context.Response.AppendHeader("Access-Control-Allow-Origin", "http://localhost:8080");
            //context.Response.Headers.Set("Access-Control-Allow-Origin", origin);

            #region Insert
            if (HttpContext.Current.Request["method"] == "insert")
            {
                JObject o             = JObject.Parse(strReq);
                string  id            = (string)o["id"];
                string  custom        = (string)o["custom"];
                string  customerid    = (string)o["CustomerId"];
                string  midcustomerid = (string)o["MidCustomerId"];
                string  user          = (string)o["user"];
                string  note          = (string)o["note"];
                string  DeadLine      = (string)o["DeadLine"];
                string  TaskRequire   = (string)o["require"].ToString();
                string  CourseData    = (string)o["CourseData"].ToString();

                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    ProjectCollection.WebUI.Models.BatchProject ThisProject = new Models.BatchProject();
                    int ProjectCount = (from p in ProjectModel.BatchProject
                                        where p.id == id
                                        select p).Count();
                    if (ProjectCount > 0)
                    {
                        context.Response.ContentType = "text/plain";
                        context.Response.StatusCode  = 204;
                        context.Response.Write("ID Repetition");
                        return;
                    }
                    ProjectCollection.WebUI.Models.user_info ThisUser = (from u in ProjectModel.user_info
                                                                         where u.login_name == user
                                                                         select u).First();
                    ThisProject.id          = id;
                    ThisProject.custom      = custom;
                    ThisProject.customer    = customerid;
                    ThisProject.MidCustomer = midcustomerid;
                    ThisProject.CreatorId   = ThisUser.user_identity;
                    ThisProject.CreateNote  = note;
                    ThisProject.DeadLine    = Convert.ToDateTime(DeadLine);
                    ThisProject.TaskRequire = TaskRequire;
                    ThisProject.progress    = "等待审核";
                    ThisProject.CreateDate  = DateTime.Now;
                    ThisProject.CourseData  = CourseData;
                    ProjectModel.BatchProject.Add(ThisProject);
                    ProjectModel.SaveChanges();
                }
                context.Response.ContentType = "text/plain";
                context.Response.StatusCode  = 201;
                context.Response.Write("success");
            }
            #endregion Insert
            #region Get
            else if (HttpContext.Current.Request["method"] == "get")
            {
                string id = HttpContext.Current.Request["id"];
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    int ProjectCount = (from p in ProjectModel.BatchProject
                                        where p.id == id
                                        select p).Count();
                    if (ProjectCount == 0)
                    {
                        context.Response.ContentType = "text/plain";
                        context.Response.StatusCode  = 404;
                        context.Response.Write("Not Found Project");
                        return;
                    }
                    ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                               where p.id == id
                                                                               select p).First();
                    ProjectCollection.WebUI.Models.user_info ThisUser = (from u in ProjectModel.user_info
                                                                         where u.user_identity == ThisProject.CreatorId
                                                                         select u).First();
                    object OldData;
                    if (ThisProject.HelpCourseData is null)
                    {
                        OldData = "";
                    }
                    else
                    {
                        OldData = JsonConvert.DeserializeObject(ThisProject.HelpCourseData);
                    }
                    JObject rss = new JObject();
                    rss = new JObject(
                        new JProperty("id", ThisProject.id),
                        new JProperty("custom", ThisProject.custom),
                        new JProperty("CustomerId", ThisProject.customer),
                        new JProperty("MidCustomerId", ThisProject.MidCustomer),
                        new JProperty("user", ThisUser.real_name),
                        new JProperty("require", JsonConvert.DeserializeObject(ThisProject.TaskRequire)),
                        new JProperty("CreateDate", ThisProject.CreateDate.ToString("yyyy-MM-dd")),
                        new JProperty("DeadLine", ThisProject.DeadLine.HasValue ? ThisProject.DeadLine.Value.ToString("yyyy-MM-dd") : "n/a"), //nullabale type
                        new JProperty("note", ThisProject.CreateNote),
                        new JProperty("CheckDate", ThisProject.CheckDate.HasValue ? ThisProject.CheckDate.Value.ToString("yyyy-MM-dd") : "n/a"),
                        new JProperty("CheckNote", ThisProject.CheckNote),
                        new JProperty("HelpSendingDate", ThisProject.HelpSendingDate.ToString()),
                        new JProperty("HelperFinishDate", ThisProject.HelperFinishDate.ToString()),
                        new JProperty("McHelpSendingDate", ThisProject.McHelpSendingDate.ToString()),
                        new JProperty("McHelperFinishDate", ThisProject.McHelperFinishDate.ToString()),
                        new JProperty("PicSendingDate", ThisProject.PicSendingDate.ToString()),
                        new JProperty("PicFinishDate", ThisProject.PicFinishDate.ToString()),
                        new JProperty("TemplateSendingDate", ThisProject.TemplateSendingDate.ToString()),
                        new JProperty("TemplateFinishDate", ThisProject.TemplateFinishDate.ToString()),
                        new JProperty("AttachmentSendingDate", ThisProject.AttachmentSendingDate.ToString()),
                        new JProperty("AttachmentFinishDate", ThisProject.AttachmentFinishDate.ToString()),
                        new JProperty("FinishDate", ThisProject.FinishDate.ToString()),
                        new JProperty("CourseData", JsonConvert.DeserializeObject(ThisProject.CourseData)),
                        new JProperty("HelpCourseData", OldData)
                        );

                    context.Response.ContentType = "text/plain";
                    context.Response.StatusCode  = 200;
                    context.Response.Write(rss.ToString());
                }
            }
            else if (HttpContext.Current.Request["method"] == "OldHelpQuery")
            {
                string id = HttpContext.Current.Request["id"];
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    int ProjectCount = (from p in ProjectModel.BatchProject
                                        where p.id == id
                                        select p).Count();
                    if (ProjectCount == 0)
                    {
                        context.Response.ContentType = "text/plain";
                        context.Response.StatusCode  = 404;
                        context.Response.Write("Not Found Project");
                        return;
                    }
                    ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                               where p.id == id
                                                                               select p).First();
                    ProjectCollection.WebUI.Models.user_info ThisUser = (from u in ProjectModel.user_info
                                                                         where u.user_identity == ThisProject.CreatorId
                                                                         select u).First();
                    object OldData;
                    if (ThisProject.HelpCourseData is null)
                    {
                        OldData = "";
                    }
                    else
                    {
                        OldData = JsonConvert.DeserializeObject(ThisProject.HelpCourseData);
                    }
                    JObject rss = new JObject();
                    rss = new JObject(
                        new JProperty("id", ThisProject.id),
                        new JProperty("HelpCourseData", OldData)
                        );

                    context.Response.ContentType = "text/plain";
                    context.Response.StatusCode  = 200;
                    context.Response.Write(rss.ToString());
                }
            }
            #endregion Get
            #region Update
            else if (HttpContext.Current.Request["method"] == "UpdateProgress")
            {
                JObject o  = JObject.Parse(strReq);
                string  id = (string)o["id"];
                //string TaskRequire = (string)o["require"].ToString();
                string CourseData = (string)o["CourseData"].ToString();
                string transactor = (string)o["transactor"].ToString();
                string note       = (string)o["note"].ToString();
                using (var ProjectModel = new ProjectCollection.WebUI.Models.ProjectCollectionEntities())
                {
                    ProjectCollection.WebUI.Models.BatchProject ThisProject = (from p in ProjectModel.BatchProject
                                                                               where p.id == id
                                                                               select p).First();
                    ProjectCollection.WebUI.Models.user_info ThisUser = (from u in ProjectModel.user_info
                                                                         where u.login_name == transactor
                                                                         select u).First();
                    if ((ThisProject.AttachmentSendingDate is null || !(ThisProject.AttachmentFinishDate is null)) &&
                        (ThisProject.HelpSendingDate is null || !(ThisProject.HelperFinishDate is null)) &&
                        (ThisProject.McHelpSendingDate is null || !(ThisProject.McHelperFinishDate is null)) &&
                        (ThisProject.PicSendingDate is null || !(ThisProject.PicFinishDate is null)) &&
                        (ThisProject.TemplateSendingDate is null || !(ThisProject.TemplateFinishDate is null)))
                    {
                        ThisProject.transactor = ThisUser.user_identity;
                        //ThisProject.TaskRequire = TaskRequire;
                        //ThisProject.CourseData = CourseData;
                        ThisProject.progress   = "已完成";
                        ThisProject.FinishDate = DateTime.Now;
                        ThisProject.FinishNote = note;
                        ProjectModel.SaveChanges();
                        context.Response.ContentType = "text/plain";
                        context.Response.StatusCode  = 200;
                        context.Response.Write("完成");
                    }
                    else
                    {
                        //ThisProject.transactor = ThisUser.user_identity;
                        //ThisProject.progress = "已完成";
                        //ThisProject.FinishDate = DateTime.Now;
                        //ThisProject.FinishNote = note;
                        //ProjectModel.SaveChanges();
                        context.Response.ContentType = "text/plain";
                        context.Response.StatusCode  = 200;
                        context.Response.Write("请确认所有分项任务已完成");
                    }
                }