示例#1
0
        public BLL.Project LoadProjectById(long ProjectId)
        {
            BLL.Project   project = new BLL.Project();
            SqlConnection conn    = null;
            SqlDataReader reader  = null;

            try
            {
                // prepare connection to the database.
                conn = SQLHelper.GetConnection();
                conn.Open();
                if (conn == null)
                {
                    throw new Exception("Sorry, connection to the database failed.");
                }

                // write sqlcommand.
                string     storedProcedureName = "ProjectLoadByProjecttId";
                SqlCommand cmd = new SqlCommand();
                cmd.Connection     = conn;
                cmd.CommandTimeout = 50000;
                cmd.CommandType    = System.Data.CommandType.StoredProcedure;
                cmd.CommandText    = storedProcedureName;

                cmd.Parameters.AddWithValue("@ProjectId", ProjectId);
                reader = cmd.ExecuteReader();

                if (reader.Read())
                {
                    project = new BLL.Project
                    {
                        ProjectId     = (long)reader["ProjectId"],
                        Title         = reader["Title"].ToString(),
                        Description   = reader["Description"].ToString(),
                        IsActive      = Convert.ToBoolean(reader["IsActive"].ToString()),
                        CreatedOn     = Convert.ToDateTime(reader["CreatedOn"].ToString()),
                        LastUpdatedOn = Convert.ToDateTime(reader["LastUpdatedOn"].ToString()),
                        IpUsed        = project.IpUsed, /*Convert.ToDateTime(reader["IpUsed"].ToString()),*/
                        UserId        = Convert.ToString(reader["UserId"])
                    };
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (conn != null)
                {
                    conn.Close();
                }
            }
            return(project);
        }
示例#2
0
        protected void btnShowPopup_Command(object sender, CommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            BLL.Project project = BLL.Project.GetProject(new Guid(id));
            popupEdit.ContentUrl = "~/pages/ProjectCreateEditEmbed.aspx?ProjectId=" + id + "&mode=" + e.CommandName + "&type=" + project.ProjectTypeId.ToString();
            //popupEdit.ContentUrl = "~/pages/ProjectCreateEditEmbed.aspx?ProjectId=" + id + "&mode=" + mode;
            popupEdit.ShowOnPageLoad = true;
        }
示例#3
0
        public void ProjectInsert(BLL.Project project)
        {
            //textBox1.Text = "Computer Name: " + Environment.MachineName



            SqlConnection conn = null;

            try
            {
                // prepare connection to the database.
                conn = SQLHelper.GetConnection();
                conn.Open();
                if (conn == null)
                {
                    throw new Exception("Sorry, connection to the database failed.");
                }

                // write sqlcommand.
                string     storedProcedureName = "ProjectsInsert";
                SqlCommand cmd = new SqlCommand();
                cmd.Connection     = conn;
                cmd.CommandTimeout = 50000;
                cmd.CommandType    = System.Data.CommandType.StoredProcedure;
                cmd.CommandText    = storedProcedureName;

                cmd.Parameters.AddWithValue("@ProductId", "0");
                cmd.Parameters.AddWithValue("@Title", project.Title);
                cmd.Parameters.AddWithValue("@Description", project.Description);
                cmd.Parameters.AddWithValue("@IsActive", project.IsActive);
                cmd.Parameters.AddWithValue("@CreatedOn", project.CreatedOn);
                cmd.Parameters.AddWithValue("@LastUpdatedOn", project.LastUpdatedOn);
                cmd.Parameters.AddWithValue("@IpUsed", project.IpUsed);
                cmd.Parameters.AddWithValue("@UserId", project.UserId);

                int sc = cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
        }
示例#4
0
        public void ProjectUpdate(BLL.Project updateProject)
        {
            SqlConnection conn = null;

            try
            {
                // prepare connection to the database.
                conn = SQLHelper.GetConnection();
                conn.Open();
                if (conn == null)
                {
                    throw new Exception("Sorry, connection to the database failed.");
                }

                // write sqlcommand.
                string     storedProcedureName = "ProjectsUpdate";
                SqlCommand cmd = new SqlCommand();
                cmd.Connection     = conn;
                cmd.CommandTimeout = 50000;
                cmd.CommandType    = System.Data.CommandType.StoredProcedure;
                cmd.CommandText    = storedProcedureName;

                cmd.Parameters.AddWithValue("@ProjectId", updateProject.ProjectId);
                cmd.Parameters.AddWithValue("@Title", updateProject.Title);
                cmd.Parameters.AddWithValue("@Description", updateProject.Description);
                cmd.Parameters.AddWithValue("@IsActive", updateProject.IsActive);
                //cmd.Parameters.AddWithValue("@CreatedOn", updateProject.CreatedOn);
                cmd.Parameters.AddWithValue("@LastUpdatedOn", updateProject.LastUpdatedOn);
                //cmd.Parameters.AddWithValue("@IpUsed", updateProject.IpUsed);
                //cmd.Parameters.AddWithValue("@UserId", updateProject.UserId);

                int success = cmd.ExecuteNonQuery();
                //return true; // success
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
        }
示例#5
0
        public BLL.Project ProjectDelete(long ProjectId)
        {
            BLL.Project   project = new BLL.Project();
            SqlConnection conn    = null;
            SqlDataReader reader  = null;

            try
            {
                // prepare connection to the database.
                conn = SQLHelper.GetConnection();
                conn.Open();
                if (conn == null)
                {
                    throw new Exception("Sorry, connection to the database failed.");
                }

                // write sqlcommand.
                string     storedProcedureName = "ProjectsDelete";
                SqlCommand cmd = new SqlCommand();
                cmd.Connection     = conn;
                cmd.CommandTimeout = 50000;
                cmd.CommandType    = System.Data.CommandType.StoredProcedure;
                cmd.CommandText    = storedProcedureName;

                cmd.Parameters.AddWithValue("@ProjectId", ProjectId);
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (conn != null)
                {
                    conn.Close();
                }
            }
            return(project);
        }
 protected void surebtn2_Click(object sender, EventArgs e)
 {
     Model.Project project = new Model.Project();
     project.ProjectName = projectname2.Text;
     project.ProjectInfo = Context.Request.Form["mycontent"];
     project.RecruitGuide = Context.Request.Form["mycontent2"];
     project.CreateTime= DateTime.Now;
     project.ModifyTime = DateTime.Now;
     project.Attachment = str2;
     Interwebsite.BLL.Project projectbll = new BLL.Project();
     bool rows=projectbll.Add(project);
     if (rows == true)
     {
         Response.Write("<script>alert('新建成功');</script>");
         str2 = "";
     }
     if (rows == false)
         Response.Write("<script>alert('新建失败');</script>");
 }
示例#7
0
        protected void surebtn2_Click(object sender, EventArgs e)
        {
            Model.Project project = new Model.Project();
            project.ProjectName  = projectname2.Text;
            project.ProjectInfo  = Context.Request.Form["mycontent"];
            project.RecruitGuide = Context.Request.Form["mycontent2"];
            project.CreateTime   = DateTime.Now;
            project.ModifyTime   = DateTime.Now;
            project.Attachment   = str2;
            Interwebsite.BLL.Project projectbll = new BLL.Project();
            bool rows = projectbll.Add(project);

            if (rows == true)
            {
                Response.Write("<script>alert('新建成功');</script>");
                str2 = "";
            }
            if (rows == false)
            {
                Response.Write("<script>alert('新建失败');</script>");
            }
        }
示例#8
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
 }
示例#9
0
        public List <BLL.Project> GetAllProject()
        {
            List <BLL.Project> projects = new List <BLL.Project>();
            SqlConnection      conn     = null;
            SqlDataAdapter     adapter  = null;

            try
            {
                // prepare connection to the database.
                conn = SQLHelper.GetConnection();
                conn.Open();

                if (conn == null)
                {
                    throw new Exception("Sorry, connection to the database failed.");
                }

                // write sqlcommand.
                string     storedProcedureName = "ProjectsLoadAll";
                SqlCommand cmd = new SqlCommand();
                cmd.Connection     = conn;
                cmd.CommandTimeout = 50000;
                cmd.CommandType    = System.Data.CommandType.StoredProcedure;
                cmd.CommandText    = storedProcedureName;

                //Prepare and Attach parameters here. (just sample)
                //SqlParameter param1 = new SqlParameter("@FirstName", "");
                //cmd.Parameters.Add(param1);

                // fetch data from database.
                DataSet dsData = new DataSet();
                adapter = new SqlDataAdapter(cmd);
                adapter.Fill(dsData);

                // iterate all the fetched data and populate students objects.
                if (dsData != null)
                {
                    if (dsData.Tables.Count > 0)
                    {
                        foreach (DataRow dr in dsData.Tables[0].Rows)
                        {
                            BLL.Project project = new BLL.Project
                            {
                                ProjectId     = (long)dr["ProjectId"],
                                Title         = dr["Title"].ToString(),
                                Description   = dr["Description"].ToString(),
                                IsActive      = Convert.ToBoolean(dr["IsActive"].ToString()),
                                CreatedOn     = Convert.ToDateTime(dr["CreatedOn"].ToString()),
                                LastUpdatedOn = Convert.ToDateTime(dr["LastUpdatedOn"].ToString()),
                                IpUsed        = Convert.ToString(dr["IpUsed"].ToString()),
                                UserId        = Convert.ToString(dr["UserId"])
                            };
                            projects.Add(project);
                        }
                    }
                }
                // return project list.
                return(projects);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (adapter != null)
                {
                    adapter.Dispose();
                }
                if (conn != null)
                {
                    conn.Close();
                }
            }
        }
示例#10
0
        //
        protected void gvProject_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            Guid identity = Guid.Parse(this.gvProject.DataKeys[e.NewSelectedIndex].Values["ProjectId"].ToString());

            //NewPms
            BLL.Project project = BLL.Project.GetProject(identity);
            if (this.Request["mode"] == "browse")
            {
                this.Response.Redirect("~/pages/ProjectCreateEdit.aspx?mode=browse&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "capture")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=capture&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "capturecheck")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=capturecheck&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "capturecheck")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=capturecheck&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "execution")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=execution&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "shorthand")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=shorthand&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "contentreceive")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=contentreceive&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "contentfinish")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=contentfinish&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "contentcheck")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=contentcheck&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "contentrecheck")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=contentrecheck&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "productionreceive")
            {
                //NewPms
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=productionreceive&ProjectId=" + identity);
                //this.Redirect("http://192.168.194.88:666/AjaxVideoUploadPage/?CourseTitle=" + project.CourseName);
            }
            else if (this.Request["mode"] == "productionfinish")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=productionfinish&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "productioncheck")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=productioncheck&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "publish")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=publish&ProjectId=" + identity);
            }
            else if (this.Request["mode"] == "check")
            {
                this.Redirect("~/pages/ProjectCreateEdit.aspx?mode=check&ProjectId=" + identity);
            }
            else
            {
            }
        }