protected void btnFinalize_Click(object sender, EventArgs e)
    {
        ViewState["JournalCode"] = Request.QueryString["JournalCode"];
        if (lblReviewer.ForeColor == Color.Black)
        {
            string confirmValue = Request.Form["confirm_value"];
            if (confirmValue == "Yes")
            {
                using (EmployeeJournal objEmployeeJournal = new EmployeeJournal())
                {
                    objEmployeeJournal.EmployeeJournalCode = Convert.ToInt16(Request.QueryString["JournalCode"]);
                    objEmployeeJournal.JournalStatus       = "F";
                    objEmployeeJournal.LockStatus          = "1";
                    objEmployeeJournal.Enabled             = "1";
                    objEmployeeJournal.Contents            = ckeContents.Text.Replace("style=\"display: none\"", "");
                    objEmployeeJournal.ModifiedBy          = Request.Cookies["Speedo"]["UserName"].ToString();
                    if (objEmployeeJournal.UpdateStatus() > 0)
                    {
                        using (EmployeeJournalApproval objEmployeeJournalApproval = new EmployeeJournalApproval())
                        {
                            objEmployeeJournalApproval.EmployeeJournalCode = objEmployeeJournal.EmployeeJournalCode;
                            objEmployeeJournalApproval.JournalApprover     = EmployeeReviewer.GetReviewer(Request.Cookies["Speedo"]["UserName"].ToString());
                            objEmployeeJournalApproval.JournalAStatus      = "F";
                            objEmployeeJournalApproval.JournalAOrder       = 1;
                            objEmployeeJournalApproval.JournalADate        = DateTime.Now;
                            objEmployeeJournalApproval.Insert();

                            objEmployeeJournal.SendNotification(EmployeeJournal.EJSMailType.FiledAcknowledgementRequestor, Request.Cookies["Speedo"]["UserName"].ToString(), EmployeeReviewer.GetReviewer(Request.Cookies["Speedo"]["UserName"].ToString()));
                            objEmployeeJournal.SendNotification(EmployeeJournal.EJSMailType.FiledNotificationApprover, Request.Cookies["Speedo"]["UserName"].ToString(), EmployeeReviewer.GetReviewer(Request.Cookies["Speedo"]["UserName"].ToString()));
                        }
                        Response.Redirect("EmployeeJournalList.aspx");
                    }
                }
            }
            else
            {
                using (EmployeeJournal objEmployeeJournal = new EmployeeJournal())
                {
                    objEmployeeJournal.EmployeeJournalCode = Convert.ToInt16(Request.QueryString["JournalCode"]);
                    objEmployeeJournal.Contents            = ckeContents.Text;
                    objEmployeeJournal.ModifiedBy          = Request.Cookies["Speedo"]["UserName"].ToString();
                    objEmployeeJournal.ModifiedOn          = DateTime.Now;

                    if (objEmployeeJournal.Update() > 0)
                    {
                        Response.Redirect("JournalEncoding.aspx?JournalCode=" + Request.QueryString["JournalCode"]);
                    }
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        clsSpeedo.Authenticate();
        this.LoadDueValidation();
        if (!Page.IsPostBack)
        {
            //lblWeekDates.Text = WeekYear.GetWeekName(Convert.ToInt16(WeekYear.GetActiveWeekCode())).ToString() + " (" + WeekYear.GetDateStart(Convert.ToInt16(WeekYear.GetActiveWeekCode())).ToString("MMM dd, yyyy") + " - " + WeekYear.GetDateEnd(Convert.ToInt16(WeekYear.GetActiveWeekCode())).ToString("MMM dd, yyyy") + ")";
            lblWeekDates.Text = WeekYear.GetWeekName(Convert.ToInt16(EmployeeJournal.GetWeekCode(Convert.ToInt16(Request.QueryString["JournalCode"])))).ToString() + " (" + WeekYear.GetDateStart(Convert.ToInt16(EmployeeJournal.GetWeekCode(Convert.ToInt16(Request.QueryString["JournalCode"])))).ToString("MMM dd, yyyy") + " - " + WeekYear.GetDateEnd(Convert.ToInt16(EmployeeJournal.GetWeekCode(Convert.ToInt16(Request.QueryString["JournalCode"])))).ToString("MMM dd, yyyy") + ")";
            this.MakeCart();
            this.LoadDSLs();
            this.LoadContents();

            if (EmployeeReviewer.GetReviewer(Request.Cookies["Speedo"]["UserName"].ToString()).Length > 0)
            {
                lblReviewer.ForeColor = Color.Black;
                lblReviewer.Text      = EmployeeReviewer.GetReviewer(Request.Cookies["Speedo"]["UserName"].ToString());
            }
            else
            {
                lblReviewer.ForeColor = Color.Red;
                lblReviewer.Text      = "No assigned reviewer.";
            }
        }
    }