protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { txtDepartmentHeadsRemarks.Visible = true; txtDivisionHeadsRemarks.Visible = true; txtDepartmentHeadsRemarks.Enabled = false; txtDivisionHeadsRemarks.Enabled = false; txtDepartmentHeadsRemarks.Text = EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "1"); txtDivisionHeadsRemarks.Text = EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "2"); 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(); if (EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "1").ToString() == Request.Cookies["Speedo"]["UserName"].ToString()) { txtDepartmentHeadsRemarks.Enabled = true; btnApprove.Text = "Approved"; } if (EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "2").ToString() == Request.Cookies["Speedo"]["UserName"].ToString()) { txtDivisionHeadsRemarks.Enabled = true; btnApprove.Text = "Read and Commented"; } } }
protected void LoadUpdates() { string strWrite = ""; string strStatus = ""; string strLink = ""; string strPreview = ""; string strJournalStatus = ""; string strEmployeeStatDate = ""; string strDepHeadStatus = ""; string strDivHeadStatus = ""; foreach (DataRow drJournal in EmployeeJournal.GetDSG(Convert.ToInt16(ddlJournalYear.SelectedValue), ddlJournalDates.SelectedValue.ToString(), ddlDepartment.SelectedValue.ToString()).Rows) { if (drJournal["JournalStatus"].ToString() == "S" && drJournal["LockStatus"].ToString() == "0") { strJournalStatus = "Draft"; strEmployeeStatDate = "(Last Log on " + drJournal["ModifiedOn"].ToString() + ")"; strDepHeadStatus = ""; strDivHeadStatus = ""; } else if (drJournal["JournalStatus"].ToString() == "F") { strJournalStatus = "For Approval"; strEmployeeStatDate = "(Submitted on " + drJournal["ModifiedOn"].ToString() + ")"; if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(drJournal["JournalCode"]), "1") == "A") { strDepHeadStatus = "(" + EmployeeJournalApproval.GetApproverADate(Convert.ToInt16(drJournal["JournalCode"]), "1") + ")"; } else { strDepHeadStatus = "(Not Yet Approved)"; } if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(drJournal["JournalCode"]), "2") == "A") { strDivHeadStatus = "(" + EmployeeJournalApproval.GetApproverADate(Convert.ToInt16(drJournal["JournalCode"]), "2") + ")"; } else { strDivHeadStatus = "(Not Yet Approved)"; } } else if (drJournal["JournalStatus"].ToString() == "A") { strJournalStatus = "Approved"; strEmployeeStatDate = "(Submitted on " + drJournal["ModifiedOn"].ToString() + ")"; strDepHeadStatus = ""; strDivHeadStatus = ""; } strLink = "JournalViewer"; strWrite = strWrite + "<tr>" + "<td class='GridRows'>" + clsEmployee.GetName(drJournal["CreatedBy"].ToString()) + "<br />" + strEmployeeStatDate + "</td>" + "<td class='GridRows'>" + strJournalStatus + "</td>" + "<td class='GridRows'>" + EmployeeJournalApproval.GetApprover(Convert.ToInt16(drJournal["JournalCode"]), "1") + "<br />" + strDepHeadStatus + "</td>" + //"<td class='GridRows'>" + EmployeeJournalApproval.GetApprover(Convert.ToInt16(drJournal["JournalCode"]), "2") + "<br />" + strDivHeadStatus + "</td>" + "</tr>"; } //Response.Write(strWrite); lblWrite.Text = strWrite; }
protected void Page_Load(object sender, EventArgs e) { 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(); lblDeptApprover.Text = "(" + EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "1") + ")"; lblDepartmentHeadsRemarks.Text = EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "1"); lblDivApprover.Text = "(" + EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "2") + ")"; lblDivisionHeadsRemarks.Text = EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "2"); }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); if (!Page.IsPostBack) { string strDeptDetails = "", strDivDetails = ""; string strDeptStatus = "", strDivStatus = ""; 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.LoadContent(); //lblDeptApprover.Text = "(" + EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "1") + ")"; try { lblDepartmentHeadsRemarks.Text = EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "1"); if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(Request.QueryString["JournalCode"]), "1") == "F") { strDeptStatus = "For Review"; } else if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(Request.QueryString["JournalCode"]), "1") == "A") { strDeptStatus = "Reviewed"; } else if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(Request.QueryString["JournalCode"]), "1") == "F") { strDeptStatus = "Disapproved"; } strDeptDetails = "Reviewer: " + EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "1") + "<br />" + "Status: " + strDeptStatus + "<br />" + "Remarks: <br />" + EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "1"); lblDepartmentHeadsRemarks.Text = strDeptDetails; } catch { } //if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(Request.QueryString["JournalCode"]), "2") == "F") //{ // strDivStatus = "For Approval"; //} //else if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(Request.QueryString["JournalCode"]), "2") == "A") //{ // strDivStatus = "Approved"; //} //else if (EmployeeJournalApproval.GetApproverAStatus(Convert.ToInt16(Request.QueryString["JournalCode"]), "2") == "F") //{ // strDivStatus = "Disapproved"; //} //strDivDetails = "Approver: " + EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "2") + "<br />" + // "Status: " + strDivStatus + "<br />" + // "Remarks: <br />" + EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "2"); //lblDivisionHeadsRemarks.Text = strDivDetails; } }
protected void Page_Load(object sender, EventArgs e) { 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") + ")"; this.MakeCart(); lblDeptApprover.Text = "(" + EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "1") + ")"; lblDeptRemarks.Text = EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "1"); lblDivApprover.Text = "(" + EmployeeJournalApproval.GetApprover(Convert.ToInt16(Request.QueryString["JournalCode"]), "2") + ")"; lblDivRemarks.Text = EmployeeJournalApproval.GetRemarks(Convert.ToInt16(Request.QueryString["JournalCode"]), "2"); ViewState["JournalCode"] = Request.QueryString["JournalCode"].ToString(); } }
protected void btnApprove_Click(object sender, EventArgs e) { using (EmployeeJournal objEmployeeJournal = new EmployeeJournal()) { //objEmployeeJournal.EmployeeJournalCode = EmployeeJournal.GetLastJournalCode(Convert.ToInt16(WeekYear.GetActiveWeekCode()), Request.Cookies["Speedo"]["UserName"].ToString()); objEmployeeJournal.EmployeeJournalCode = Convert.ToInt16(Request.QueryString["JournalCode"]); objEmployeeJournal.LockStatus = "1"; objEmployeeJournal.Enabled = "1"; objEmployeeJournal.JournalStatus = "A"; objEmployeeJournal.ModifiedBy = Request.Cookies["Speedo"]["UserName"].ToString(); if (objEmployeeJournal.UpdateStatus2() > 0) { using (EmployeeJournalApproval objEmployeeJournalApproval = new EmployeeJournalApproval()) { objEmployeeJournalApproval.EmployeeJournalACode = EmployeeJournalApproval.GetForApprovalJournalACode(objEmployeeJournal.EmployeeJournalCode); objEmployeeJournalApproval.JournalAStatus = "A"; if (EmployeeJournalApproval.GetForApprovalJournalAOrder(objEmployeeJournal.EmployeeJournalCode) == 1) { objEmployeeJournalApproval.Remarks = txtDepartmentHeadsRemarks.Text; } //else if (EmployeeJournalApproval.GetForApprovalJournalAOrder(objEmployeeJournal.EmployeeJournalCode) == 2) //{ // objEmployeeJournal.JournalStatus = "A"; // objEmployeeJournal.UpdateStatus(); // objEmployeeJournalApproval.Remarks = txtDivisionHeadsRemarks.Text; //} if (objEmployeeJournalApproval.UpdateStatus() > 0) { objEmployeeJournal.SendNotification(EmployeeJournal.EJSMailType.ApprovedNotificationRequestor, EmployeeJournal.GetRequestor(objEmployeeJournal.EmployeeJournalCode), EmployeeJournalApproval.GetApprover(objEmployeeJournal.EmployeeJournalCode, "1")); objEmployeeJournal.SendNotification(EmployeeJournal.EJSMailType.ApprovedAcknowledgementApprover, EmployeeJournal.GetRequestor(objEmployeeJournal.EmployeeJournalCode), EmployeeJournalApproval.GetApprover(objEmployeeJournal.EmployeeJournalCode, "1")); Response.Redirect("EmployeeJournalListFApproval.aspx"); } } } } }