Ejemplo n.º 1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     using (clsOvertime overtime = new clsOvertime())
     {
         overtime.OvertimeCode = _strOvertimeCode;
         overtime.Fill();
         overtime.DateStart = clsDateTime.CombineDateTime(dtpStartDate.Value, dtpStartTime.Value);
         overtime.DateEnd   = clsDateTime.CombineDateTime(dtpEndDate.Value, dtpEndTime.Value);
         overtime.DateFile  = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value);
         overtime.Reason    = txtReason.Text;
         if (_strChargeType == "1")
         {
             overtime.RequestorApproverDate    = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value);
             overtime.RequestorApproverRemarks = txtRRemarks.Text;
             overtime.RequestorApproverStatus  = cmbRStatus.SelectedValue.ToString();
         }
         overtime.HeadApproverDate    = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value);
         overtime.HeadApproverRemarks = txtHRemarks.Text;
         overtime.HeadApproverStatus  = cmbHStatus.SelectedValue.ToString();
         overtime.Status = cmbStatus.SelectedValue.ToString();
         if (overtime.UpdateAdmin() > 0)
         {
             _frmOvertimeList.LoadOvertimeList();
             this.Close();
         }
     }
 }
Ejemplo n.º 2
0
 protected void btnDisapprove_Click(object sender, EventArgs e)
 {
     using (clsOvertime ot = new clsOvertime())
     {
         ot.OvertimeCode = Request.QueryString["otcode"];
         ot.Fill();
         ot.ApproverHeadRemarks = txtHRemarks.Text;
         ot.ApproverHeadDate    = DateTime.Now;
         ot.DisapproveHead();
     }
     ScriptManager.RegisterStartupScript(this, GetType(), "Disapproved", "ModalDisapprove();", true);
 }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        clsSpeedo.Authenticate();

        if (!clsOvertime.AuthenticateAccess(Request.Cookies["Speedo"]["UserName"], Request.QueryString["otcode"].ToString()))
        {
            Response.Redirect("~/AccessDenied.aspx");
        }

        if (!Page.IsPostBack)
        {
            clsOvertime.AuthenticateAccessForm(OvertimeUsers.ApproverRequestor, Request.Cookies["Speedo"]["UserName"], Request.QueryString["otcode"].ToString());
            clsOvertime ot = new clsOvertime(Request.QueryString["otcode"].ToString());
            ot.Fill();
            txtOTCode.Text              = ot.OvertimeCode;
            txtChargeType.Text          = clsOvertime.GetChargeTypeDesc(ot.ChargeType);
            txtRequestorDepartment.Text = clsDepartment.GetName(clsEmployee.GetDepartmentCode(ot.Username));
            txtRenderedTo.Text          = clsDepartment.GetName(ot.DepartmentCode);
            txtDateFiled.Text           = ot.DateFile.ToString("MMM dd, yyyy hh:mm tt");
            txtDateFrom.Text            = ot.DateStart.ToString("MMM dd, yyyy hh:mm tt");
            txtDateTo.Text              = ot.DateEnd.ToString("MMM dd, yyyy hh:mm tt");
            txtHours.Text         = ot.Units.ToString();
            txtRequestorName.Text = clsUsers.GetName(ot.Username);
            txtReason.Text        = ot.Reason;
            txtStatus.Text        = clsOvertime.ToOvertimeStatusDesc(ot.Status);
            hdnStatus.Value       = ot.Status;
            txtHApprover.Text     = clsUsers.GetName(ot.ApproverHeadName);
            hdnHApprover.Value    = ot.ApproverHeadName;
            hdnHStatus.Value      = ot.ApproverHeadStatus;
            txtHStatus.Text       = clsOvertime.ToOvertimeStatusDesc(ot.ApproverHeadStatus);
            txtHDateProcess.Text  = clsDateTime.CheckMinDate(ot.ApproverHeadDate);
            txtHRemarks.Text      = ot.ApproverHeadRemarks;
            hdnRApprover.Value    = ot.ApproverRequestorName;
            txtRApprover.Text     = clsUsers.GetName(ot.ApproverRequestorName);
            hdnRStatus.Value      = ot.ApproverRequestorStatus;
            txtRStatus.Text       = clsOvertime.ToOvertimeStatusDesc(ot.ApproverRequestorStatus);
            txtRDateProcess.Text  = clsDateTime.CheckMinDate(ot.ApproverRequestorDate);
            txtRRemarks.Text      = ot.ApproverRequestorRemarks;

            if (ot.ApproverRequestorStatus == "F")
            {
                txtRRemarks.ReadOnly  = false;
                txtRRemarks.BackColor = System.Drawing.Color.White;
                btnApprove.Visible    = true;
                btnDisapprove.Visible = true;
            }
            else
            {
                btnApprove.Visible    = false;
                btnDisapprove.Visible = false;
            }
        }
    }
Ejemplo n.º 4
0
 protected void btnApprove_Click(object sender, EventArgs e)
 {
     using (clsOvertime ot = new clsOvertime())
     {
         ot.OvertimeCode = Request.QueryString["otcode"];
         ot.Fill();
         ot.ApproverCOORemarks = txtCRemarks.Text;
         ot.ApproverCOODate    = DateTime.Now;
         ot.ApproveCOO();
     }
     Response.Redirect("OvertimeMenu.aspx");
 }
Ejemplo n.º 5
0
 protected void btnDisapprove_Click(object sender, EventArgs e)
 {
     using (clsOvertime ot = new clsOvertime())
     {
         ot.OvertimeCode = Request.QueryString["otcode"];
         ot.Fill();
         ot.ApproverRequestorRemarks = txtRRemarks.Text;
         ot.ApproverRequestorDate    = DateTime.Now;
         ot.DisapproveRequestor();
     }
     //ADDED by CALVIN CAVITE FEB 15, 2018
     ScriptManager.RegisterStartupScript(this, GetType(), "Success!", "ModalDisapprove();", true);
 }
Ejemplo n.º 6
0
 private void BindOvertimeDetails(string pOTCode)
 {
     using (clsOvertime ot = new clsOvertime(pOTCode))
     {
         ot.Fill();
         lblOTCode.Text       = pOTCode;
         lblOTDepartment.Text = (ot.ChargeType == "0" ? "Charge within the department" : Department.GetName(ot.DepartmentCode));
         lblOTChargeType.Text = clsOvertime.GetChargeTypeDesc(ot.ChargeType);
         lblOTDepartment.Text = Department.GetName(ot.DepartmentCode);
         lblOTRequestor.Text  = Employee.GetName(ot.Username);
         lblOTDateFile.Text   = ot.DateFile.ToString("MMM dd, yyyy hh:mm tt");
         lblOTStart.Text      = ot.DateStart.ToString("ddd MMM dd, yyyy hh:mm tt");
         lblOTEnd.Text        = ot.DateEnd.ToString("ddd MMM dd, yyyy hh:mm tt");
         lblOTReason.Text     = ot.Reason;
         lblOTRAName.Text     = (ot.ChargeType == "1" ? Employee.GetName(ot.RequestorApproverName) : "NA");
         lblOTRADate.Text     = (ot.ChargeType == "1" ? ot.RequestorApproverDate.ToString("MM-dd-yyyy") : "NA");
         lblOTRARemaks.Text   = (ot.ChargeType == "1" ? ot.RequestorApproverRemarks : "NA");
         lblOTHAName.Text     = Employee.GetName(ot.HeadApproverName);
         lblOTHADate.Text     = ot.HeadApproverDate.ToString("MM-dd-yyyy");
         lblOTHARemarks.Text  = ot.HeadApproverRemarks;
         lblOTStatus.Text     = clsOvertime.ToStatusDesc(ot.Status);
     }
 }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        clsSpeedo.Authenticate();

          if (!clsOvertime.AuthenticateAccess(Request.Cookies["Speedo"]["UserName"].ToString(), Request.QueryString["otcode"].ToString()))
           Response.Redirect("~/AccessDenied.aspx");

          if (!Page.IsPostBack)
          {
           clsOvertime.AuthenticateAccessForm(OvertimeUsers.Requestor, Request.Cookies["Speedo"]["UserName"], Request.QueryString["otcode"].ToString());
           clsOvertime ot = new clsOvertime(Request.QueryString["otcode"].ToString());
           ot.Fill();
           txtOTCode.Text = ot.OvertimeCode;
           txtChargeType.Text = clsOvertime.GetChargeTypeDesc(ot.ChargeType);
           txtChargeTo.Text = clsDepartment.GetName(ot.DepartmentCode);
           txtDateFiled.Text = ot.DateFile.ToString("MMM dd, yyyy hh:mm tt");
           txtRequestorName.Text = clsUsers.GetName(ot.Username);
           txtDateFrom.Text = ot.DateStart.ToString("MMM dd, yyyy hh:mm tt");
           txtDateTo.Text = ot.DateEnd.ToString("MMM dd, yyyy hh:mm tt");
           txtHours.Text = ot.Units.ToString();
           txtReason.Text = ot.Reason;
           txtHApprover.Text = clsUsers.GetName(ot.ApproverHeadName);
           txtHStatus.Text = clsOvertime.ToOvertimeStatusDesc(ot.ApproverHeadStatus);
           txtHDateProcess.Text = clsDateTime.CheckMinDate(ot.ApproverHeadDate);
           txtHRemarks.Text = ot.ApproverHeadRemarks;
           txtStatus.Text = clsOvertime.ToOvertimeStatusDesc(ot.Status);
           if (ot.ChargeType == "1")
           {
        txtRApprover.Text = clsUsers.GetName(ot.ApproverRequestorName);
        txtRStatus.Text = clsOvertime.ToOvertimeStatusDesc(ot.ApproverRequestorStatus);
        txtRDateProcess.Text = clsDateTime.CheckMinDate(ot.ApproverRequestorDate);
        txtRRemarks.Text = ot.ApproverRequestorRemarks;

        trRApprover.Visible = true;
        trRStatus.Visible = true;
        trRRemarks.Visible = true;
           }

           if (ot.ApproverDivisionStatus != "X" && ot.ApproverDivisionStatus != "" && !Convert.IsDBNull(ot.ApproverDivisionStatus))
           {
        hdnDApprover.Value = ot.ApproverDivisionName;
        txtDApprover.Text = clsUsers.GetName(ot.ApproverDivisionName);
        hdnDStatus.Value = ot.ApproverDivisionStatus;
        txtDStatus.Text = clsOvertime.ToOvertimeStatusDesc(ot.ApproverDivisionStatus);
        txtDProcessDate.Text = clsDateTime.CheckMinDate(ot.ApproverDivisionDate);
        txtDRemarks.Text = ot.ApproverDivisionRemarks;
        trApproverDivision1.Visible = true;
        trApproverDivision2.Visible = true;
        trApproverDivision3.Visible = true;
           }

           if (ot.ApproverCOOStatus != "X" && ot.ApproverCOOStatus != "" && !Convert.IsDBNull(ot.ApproverCOOStatus))
           {
        hdnCApprover.Value = ot.ApproverCOOName;
        txtCApprover.Text = clsUsers.GetName(ot.ApproverCOOName);
        hdnCStatus.Value = ot.ApproverCOOStatus;
        txtCStatus.Text = clsOvertime.ToOvertimeStatusDesc(ot.ApproverCOOStatus);
        txtCProcessDate.Text = clsDateTime.CheckMinDate(ot.ApproverCOODate);
        txtCRemarks.Text = ot.ApproverCOORemarks;
        trApproverCOO1.Visible = true;
        trApproverCOO2.Visible = true;
        trApproverCOO3.Visible = true;
           }

           btnCancel.Visible = clsOvertime.ToOvertimeStatus(ot.Status) == OvertimeStatus.ForApproval;
          }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        clsSpeedo.Authenticate();

        if (!clsOvertime.AuthenticateAccess(Request.Cookies["Speedo"]["UserName"], Request.QueryString["otcode"].ToString()))
        {
            Response.Redirect("~/AccessDenied.aspx");
        }

        if (!Page.IsPostBack)
        {
            clsOvertime.AuthenticateAccessForm(OvertimeUsers.ApproverDivision, Request.Cookies["Speedo"]["UserName"], Request.QueryString["otcode"].ToString());
            clsOvertime ot = new clsOvertime(Request.QueryString["otcode"].ToString());
            ot.Fill();
            txtOTCode.Text              = ot.OvertimeCode;
            txtChargeType.Text          = clsOvertime.GetChargeTypeDesc(ot.ChargeType);
            txtRequestorDepartment.Text = clsDepartment.GetName(clsEmployee.GetDepartmentCode(ot.Username));
            txtRenderedTo.Text          = clsDepartment.GetName(ot.DepartmentCode);
            txtDateFiled.Text           = ot.DateFile.ToString("MMM dd, yyyy hh:mm tt");
            txtDateFrom.Text            = ot.DateStart.ToString("MMM dd, yyyy hh:mm tt");
            txtDateTo.Text              = ot.DateEnd.ToString("MMM dd, yyyy hh:mm tt");
            txtHours.Text         = ot.Units.ToString();
            txtRequestorName.Text = clsUsers.GetName(ot.Username);
            txtReason.Text        = ot.Reason;
            txtStatus.Text        = clsOvertime.ToOvertimeStatusDesc(ot.Status);
            hdnStatus.Value       = ot.Status;
            txtHApprover.Text     = clsUsers.GetName(ot.ApproverHeadName);
            hdnHApprover.Value    = ot.ApproverHeadName;
            hdnHStatus.Value      = ot.ApproverHeadStatus;
            txtHStatus.Text       = clsOvertime.ToOvertimeStatusDesc(ot.ApproverHeadStatus);
            txtHProcessDate.Text  = clsDateTime.CheckMinDate(ot.ApproverHeadDate);
            txtHRemarks.Text      = ot.ApproverHeadRemarks;
            if (ot.ChargeType == "1")
            {
                hdnRApprover.Value     = ot.ApproverRequestorName;
                txtRApprover.Text      = clsUsers.GetName(ot.ApproverRequestorName);
                hdnRStatus.Value       = ot.ApproverRequestorStatus;
                txtRStatus.Text        = clsOvertime.ToOvertimeStatusDesc(ot.ApproverRequestorStatus);
                txtRDateProcessed.Text = clsDateTime.CheckMinDate(ot.ApproverRequestorDate);
                txtRRemarks.Text       = ot.ApproverRequestorRemarks;
                trRApprover.Visible    = true;
                trRStatus.Visible      = true;
                trRRemarks.Visible     = true;
            }

            hdnDApprover.Value   = ot.ApproverDivisionName;
            txtDApprover.Text    = clsUsers.GetName(ot.ApproverDivisionName);
            hdnDStatus.Value     = ot.ApproverDivisionStatus;
            txtDStatus.Text      = clsOvertime.ToOvertimeStatusDesc(ot.ApproverDivisionStatus);
            txtDProcessDate.Text = clsDateTime.CheckMinDate(ot.ApproverDivisionDate);
            txtDRemarks.Text     = ot.ApproverDivisionRemarks;

            if (ot.ApproverCOOStatus != "X" && ot.ApproverCOOStatus != "" && !Convert.IsDBNull(ot.ApproverCOOStatus))
            {
                hdnCApprover.Value     = ot.ApproverCOOName;
                txtCApprover.Text      = clsUsers.GetName(ot.ApproverCOOName);
                hdnCStatus.Value       = ot.ApproverCOOStatus;
                txtCStatus.Text        = clsOvertime.ToOvertimeStatusDesc(ot.ApproverCOOStatus);
                txtCProcessDate.Text   = clsDateTime.CheckMinDate(ot.ApproverCOODate);
                txtCRemarks.Text       = ot.ApproverCOORemarks;
                trApproverCOO1.Visible = true;
                trApproverCOO2.Visible = true;
                trApproverCOO3.Visible = true;
            }

            if (ot.ApproverDivisionStatus == "F")
            {
                txtDRemarks.ReadOnly  = false;
                txtDRemarks.BackColor = System.Drawing.Color.White;
                btnApprove.Visible    = true;
                btnDisapprove.Visible = true;
            }
            else
            {
                if ((clsValidator.CheckDate(txtDateFrom.Text) <= DateTime.Now) || (hdnCStatus.Value == "A" || hdnCStatus.Value == "D") || (hdnStatus.Value == "C" || hdnStatus.Value == "D") || (hdnDStatus.Value == "A" || hdnDStatus.Value == "D"))
                {
                    btnDisapprove.Visible = false;
                    btnApprove.Visible    = false;
                }
            }
        }
    }
Ejemplo n.º 9
0
        private void BindDetails()
        {
            cmbStatus.DataSource    = OfficialBusiness.DdlDsStatus();
            cmbStatus.ValueMember   = "pvalue";
            cmbStatus.DisplayMember = "ptext";

            cmbRStatus.DataSource    = OfficialBusiness.DdlDsStatusApprover();
            cmbRStatus.ValueMember   = "pvalue";
            cmbRStatus.DisplayMember = "ptext";

            cmbHStatus.DataSource    = OfficialBusiness.DdlDsStatusApprover();
            cmbHStatus.ValueMember   = "pvalue";
            cmbHStatus.DisplayMember = "ptext";

            txtOvertimeCode.Text = _strOvertimeCode;
            using (clsOvertime overtime = new clsOvertime())
            {
                overtime.OvertimeCode = _strOvertimeCode;
                overtime.Fill();
                txtRequestor.Text  = Employee.GetName(overtime.Username);
                _strChargeType     = overtime.ChargeType;
                txtChargeType.Text = clsOvertime.GetChargeTypeDesc(overtime.ChargeType);
                txtRenderedTo.Text = Department.GetName(overtime.DepartmentCode);
                dtpFileDate.Value  = overtime.DateFile;
                dtpFileTime.Value  = overtime.DateFile;
                dtpStartDate.Value = overtime.DateStart;
                dtpStartTime.Value = overtime.DateStart;
                dtpEndDate.Value   = overtime.DateEnd;
                dtpEndTime.Value   = overtime.DateEnd;
                txtReason.Text     = overtime.Reason;
                if (overtime.ChargeType == "1")
                {
                    txtRApprover.Text        = Employee.GetName(overtime.RequestorApproverName);
                    dtpRDate.Value           = overtime.RequestorApproverDate;
                    dtpRTime.Value           = overtime.RequestorApproverDate;
                    cmbRStatus.SelectedValue = overtime.RequestorApproverStatus;
                    txtRRemarks.Text         = overtime.RequestorApproverRemarks;
                    dtpRDate.Checked         = (overtime.RequestorApproverDate != clsDateTime.SystemMinDate);
                    dtpRTime.Checked         = (overtime.RequestorApproverDate != clsDateTime.SystemMinDate);
                }
                else
                {
                    txtRApprover.Visible = false;
                    dtpRDate.Visible     = false;
                    dtpRTime.Visible     = false;
                    cmbRStatus.Visible   = false;
                    txtRRemarks.Visible  = false;
                    lblRApprover.Visible = false;
                    lblRStatus.Visible   = false;
                    lblRRemarks.Visible  = false;
                }
                txtHApprover.Text        = Employee.GetName(overtime.HeadApproverName);
                dtpHDate.Value           = overtime.HeadApproverDate;
                dtpHTime.Value           = overtime.HeadApproverDate;
                cmbHStatus.SelectedValue = overtime.HeadApproverStatus;
                txtHRemarks.Text         = overtime.HeadApproverRemarks;
                cmbStatus.SelectedValue  = overtime.Status;

                dtpHDate.Checked = (overtime.HeadApproverDate != clsDateTime.SystemMinDate);
                dtpHTime.Checked = (overtime.HeadApproverDate != clsDateTime.SystemMinDate);
            }
        }