Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        clsSpeedo.Authenticate();

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

        if (!Page.IsPostBack)
        {
            clsUndertime.AuthenticateAccessForm(UndertimeUsers.Approver, Request.Cookies["Speedo"]["UserName"], Request.QueryString["utcode"].ToString());
            clsUndertime ut = new clsUndertime(Request.QueryString["utcode"].ToString());
            ut.Fill();
            txtUTCode.Text          = ut.UndertimeCode;
            txtDateFiled.Text       = ut.DateFiled.ToString("MMM dd, yyyy hh:mm tt");
            txtRequestorName.Text   = clsUsers.GetName(ut.Username);
            txtStatus.Text          = clsUndertime.ToUndertimeStatusText(ut.Status);
            txtDateApplied.Text     = ut.DateApplied.ToString("MMM dd, yyyy hh:mm tt");
            txtReason.Text          = ut.Reason;
            txtApproverName.Text    = clsUsers.GetName(ut.ApproverUsername);
            txtApproverDate.Text    = (ut.ApproverDate == clsDateTime.SystemMinDate ? "" : ut.ApproverDate.ToString("MMM dd, yyyy hh:mm tt"));
            txtApproverRemarks.Text = ut.ApproverRemarks;

            btnApprove.Visible    = (ut.Status == "F");
            btnDisApprove.Visible = (ut.Status == "F");
        }
    }
Ejemplo n.º 2
0
 protected void btnDisApprove_Click(object sender, EventArgs e)
 {
     using (clsUndertime undertime = new clsUndertime())
     {
         undertime.UndertimeCode = Request.QueryString["utcode"].ToString();
         undertime.Fill();
         undertime.ApproverDate    = DateTime.Now;
         undertime.ApproverRemarks = txtApproverRemarks.Text;
         if (undertime.Disapprove() > 0)
         {
             //ADDED by CALVIN CAVITE FEB 15, 2018
             ScriptManager.RegisterStartupScript(this, GetType(), "disapproved!", "ModalDisapprove();", true);
         }
     }
 }
Ejemplo n.º 3
0
 private void BindUndertimeDetails(string pUTCode)
 {
     using (clsUndertime ut = new clsUndertime(pUTCode))
     {
         ut.Fill();
         lblUTCode.Text        = pUTCode;
         lblUTRequestor.Text   = Employee.GetName(ut.Username);
         lblUTDateFile.Text    = ut.DateFiled.ToString("MMM dd, yyyy hh:mm tt");
         lblUTApplication.Text = ut.DateApplied.ToString("MMM dd, yyyy hh:mm tt");
         lblUTReason.Text      = ut.Reason;
         lblUTAName.Text       = Employee.GetName(ut.ApproverUsername);
         lblUTADate.Text       = ut.ApproverDate.ToString("MMM dd, yyyy");
         lblUTARemarks.Text    = ut.ApproverRemarks;
         lblUTStatus.Text      = clsUndertime.ToUndertimeStatusText(ut.Status);
     }
 }
Ejemplo n.º 4
0
 private void BindDetails()
 {
     using (clsUndertime undertime = new clsUndertime(_strUndertimeCode))
     {
         undertime.Fill();
         txtUndertimeCode.Text   = _strUndertimeCode;
         txtRequestor.Text       = Employee.GetName(undertime.Username);
         txtFiled.Text           = undertime.DateFiled.ToString("MMM dd, yyyy");
         txtApplied.Text         = undertime.DateApplied.ToString("MMM dd, yyyy hh:mm tt");
         txtReason.Text          = undertime.Reason;
         txtApprover.Text        = Employee.GetName(undertime.ApproverUsername);
         txtDateProcessed.Text   = undertime.ApproverDate.ToString("MMM dd, yyyy hh:mm tt");
         txtApproverRemarks.Text = undertime.ApproverRemarks;
         txtStatus.Text          = clsUndertime.ToUndertimeStatusText(undertime.Status);
     }
 }
Ejemplo n.º 5
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (clsUndertime undertime = new clsUndertime())
         {
             undertime.UndertimeCode = _strUndertimeCode;
             undertime.Fill();
             undertime.Username        = _strUsername;
             undertime.DateFiled       = dtpFileDate.Value;
             undertime.Reason          = txtReason.Text;
             undertime.ApproverDate    = clsDateTime.CombineDateTime(dtpDateProcess.Value, dtpApproverTime.Value);
             undertime.ApproverRemarks = txtRemarks.Text;
             undertime.Status          = cmbStatus.SelectedValue.ToString();
             undertime.UpdateAdmin();
         }
         _frmUndertimeList.BindUndertimeList();
         this.Close();
     }
 }
Ejemplo n.º 6
0
        private void BindFields()
        {
            cmbStatus.DataSource    = clsUndertime.DdlDsStatus();
            cmbStatus.ValueMember   = "pvalue";
            cmbStatus.DisplayMember = "ptext";

            txtUndertimeCode.Text = _strUndertimeCode;
            using (clsUndertime undertime = new clsUndertime())
            {
                undertime.UndertimeCode = _strUndertimeCode;
                undertime.Fill();
                _strUsername = undertime.Username;

                txtEmployeeName.Text    = Employee.GetName(undertime.Username);
                cmbStatus.SelectedValue = undertime.Status;
                dtpFileDate.Value       = undertime.DateFiled;
                txtDateApplied.Text     = undertime.DateApplied.ToString("MMM dd, yyyy hh:mm tt");
                txtReason.Text          = undertime.Reason;
                txtApproverName.Text    = Employee.GetName(undertime.ApproverUsername);
                dtpDateProcess.Value    = undertime.ApproverDate;
                txtRemarks.Text         = undertime.ApproverRemarks;
            }
        }