protected void btnSend_Click(object sender, EventArgs e) { string strErrorMessage = ""; string strUsername = Request.Cookies["Speedo"]["UserName"]; if (dtpDateStart.Date > dtpDateEnd.Date) { strErrorMessage = clsString.InvalidDateStartEnd; } if (DateTime.Now >= new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 16, 0, 0) && (clsDateTime.GetDateOnly(dtpDateStart.Date) == clsDateTime.GetDateOnly(DateTime.Now) || clsDateTime.GetDateOnly(dtpDateEnd.Date) == clsDateTime.GetDateOnly(DateTime.Now))) { strErrorMessage = clsString.InvalidDateDeadlineReach; } if (ddlDivision.SelectedValue.ToString().Length == 0 || ddlApprover.SelectedValue.ToString().Length == 0) { strErrorMessage += clsString.NotDefinedApprovers; } if (strErrorMessage.Length == 0) { using (clsIAR iar = new clsIAR()) { iar.Username = strUsername; iar.DateFile = DateTime.Now; iar.DateStart = dtpDateStart.Date; iar.DateEnd = dtpDateEnd.Date; iar.Reason = txtReason.Text; iar.ApproverHeadName = ddlApprover.SelectedValue.ToString(); iar.ApproverHeadStatus = (strUsername == ddlApprover.SelectedValue ? "A" : "F"); //iar.ApproverDivisionName = hdnDivisionHead.Value; iar.ApproverDivisionName = ddlDivision.SelectedValue.ToString(); iar.ApproverDivisionStatus = "F"; iar.Status = "F"; iar.CreateBy = strUsername; iar.CreateOn = DateTime.Now; iar.Insert(); if (iar.ApproverHeadStatus == "A") { iar.SendNotification(IARMailType.FiledAcknowledgementDRequestor); iar.SendNotification(IARMailType.FiledNotificationDApprover); } else { iar.SendNotification(IARMailType.FiledAcknowledgementHRequestor); iar.SendNotification(IARMailType.FiledNotificationHApprover); } } Response.Redirect("IARMenu.aspx"); } else { divError.Visible = true; lblErrMsg.Text = strErrorMessage; } }
protected void btnCancel_Click(object sender, EventArgs e) { using (clsIAR iar = new clsIAR()) { iar.IARCode = Request.QueryString["iarcode"].ToString(); iar.Cancel(); } Response.Redirect("IARMenu.aspx"); }
protected void btnDisapprove_Click(object sender, EventArgs e) { using (clsIAR iar = new clsIAR()) { iar.IARCode = Request.QueryString["iarcode"]; iar.Fill(); iar.ApproverHeadRemarks = txtRemarksH.Text; iar.ApproverHeadDate = DateTime.Now; iar.DisapproveHead(); } Response.Redirect("IARMenu.aspx"); }
private void LoadDetails() { if (!clsIAR.AuthenticateAccess(Request.Cookies["Speedo"]["UserName"], Request.QueryString["iarcode"].ToString())) { Response.Redirect("~/AccessDenied.aspx"); } if (!Page.IsPostBack) { using (clsIAR iar = new clsIAR()) { iar.IARCode = Request.QueryString["iarcode"].ToString(); iar.Fill(); txtIARCode.Text = iar.IARCode; txtDateFiled.Text = iar.DateFile.ToString("MMM dd, yyyy hh:mm tt"); txtDateStart.Text = iar.DateStart.ToString("MMM dd, yyyy hh:mm tt"); txtDateEnd.Text = iar.DateEnd.ToString("MMM dd, yyyy hh:mm tt"); txtRequestorName.Text = clsUsers.GetName(iar.Username); txtReason.Text = iar.Reason; txtStatus.Text = clsIAR.ToIARStatus(iar.Status); hdnStatus.Value = iar.Status; txtApproverH.Text = clsUsers.GetName(iar.ApproverHeadName); hdnApproverH.Value = iar.ApproverHeadName; hdnStatusH.Value = iar.ApproverHeadStatus; txtStatusH.Text = clsIAR.ToIARStatus(iar.ApproverHeadStatus); txtProcessDateH.Text = clsDateTime.CheckMinDate(iar.ApproverHeadDate); txtRemarksH.Text = iar.ApproverHeadRemarks; hdnApproverD.Value = iar.ApproverDivisionName; txtApproverD.Text = clsUsers.GetName(iar.ApproverDivisionName); hdnStatusD.Value = iar.ApproverDivisionStatus; txtStatusD.Text = clsIAR.ToIARStatus(iar.ApproverDivisionStatus); txtProcessDateD.Text = clsDateTime.CheckMinDate(iar.ApproverDivisionDate); txtRemarksD.Text = iar.ApproverDivisionRemarks; if (iar.ApproverHeadStatus == "F" && iar.Status == "F") { txtRemarksH.ReadOnly = false; txtRemarksH.BackColor = System.Drawing.Color.White; btnApprove.Visible = true; btnDisapprove.Visible = true; } else { btnApprove.Visible = false; btnDisapprove.Visible = false; } } } }
protected void btnApprove_Click(object sender, EventArgs e) { string strErrorMessage = ""; if (strErrorMessage.Length == 0) { using (clsIAR iar = new clsIAR()) { iar.IARCode = Request.QueryString["iarcode"]; iar.Fill(); iar.ApproverHeadDate = DateTime.Now; iar.ApproverHeadRemarks = txtRemarksH.Text; iar.ApproveHead(); } Response.Redirect("IARMenu.aspx"); } else { divError.Visible = true; lblErrMsg.Text = strErrorMessage; } }
private void LoadDetails() { using (clsIAR iar = new clsIAR()) { iar.IARCode = Request.QueryString["iarcode"].ToString(); iar.Fill(); txtIARCode.Text = iar.IARCode; txtDateFiled.Text = iar.DateFile.ToString("MMM dd, yyyy hh:mm tt"); txtDateStart.Text = iar.DateStart.ToString("MMM dd, yyyy hh:mm tt"); txtDateEnd.Text = iar.DateEnd.ToString("MMM dd, yyyy hh:mm tt"); txtRequestorName.Text = clsUsers.GetName(iar.Username); txtReason.Text = iar.Reason; txtApproverH.Text = clsUsers.GetName(iar.ApproverHeadName); txtStatusH.Text = clsIAR.ToIARStatus(iar.ApproverHeadStatus); txtRemarksH.Text = iar.ApproverHeadRemarks; txtApproverD.Text = clsUsers.GetName(iar.ApproverDivisionName); txtStatusD.Text = clsIAR.ToIARStatus(iar.ApproverDivisionStatus); txtRemarksD.Text = iar.ApproverDivisionRemarks; txtStatus.Text = clsIAR.ToIARStatus(iar.Status); //btnCancel.Visible = clsIAR.ToIARStatusDesc(iar.Status) == IARStatus.ForApproval; } }