Exemplo 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");
        }
    }
Exemplo n.º 2
0
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        clsUndertime ut = new clsUndertime(Request.QueryString["utcode"].ToString());

        ut.Cancel();
        Response.Redirect("UndertimeMenu.aspx");
    }
Exemplo n.º 3
0
 private void tbtnDelete_Click(object sender, EventArgs e)
 {
     if (dgUndertimeList.SelectedRows.Count > 0)
     {
         if (MessageBox.Show(clsMessageBox.MessageBoxDeleteAsk, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             clsUndertime undertime = new clsUndertime();
             undertime.UndertimeCode = dgUndertimeList.SelectedRows[0].Cells[0].Value.ToString();
             undertime.DeleteAdmin();
             BindUndertimeList();
         }
     }
 }
Exemplo n.º 4
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);
         }
     }
 }
Exemplo n.º 5
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);
     }
 }
Exemplo n.º 6
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);
     }
 }
Exemplo n.º 7
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (clsUndertime undertime = new clsUndertime())
         {
             undertime.Username         = cmbRequestor.SelectedValue.ToString();
             undertime.DateFiled        = dtpFileDate.Value;
             undertime.DateApplied      = clsDateTime.CombineDateTime(dtpDateApplied.Value, dtpTimeApplied.Value);
             undertime.Reason           = txtReason.Text;
             undertime.ApproverUsername = cmbApprover.SelectedValue.ToString();
             undertime.ApproverDate     = dtpDateProcess.Value;
             undertime.ApproverRemarks  = txtRemarks.Text;
             undertime.Status           = cmbStatus.SelectedValue.ToString();
             undertime.InsertAdmin();
         }
         _frmUndertimeList.BindUndertimeList();
         this.Close();
     }
 }
Exemplo n.º 8
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        if (clsUndertime.HasExistingApplication(Request.Cookies["Speedo"]["UserName"], dtpAppliedDate.Date))
        {
            lblErrMsg.Text   = "You already filed an undertime for this date.";
            divError.Visible = true;
        }
        else
        {
            clsUndertime ut = new clsUndertime();
            ut.Username         = Request.Cookies["Speedo"]["UserName"];
            ut.DateFiled        = DateTime.Now;
            ut.DateApplied      = dtpAppliedDate.Date;
            ut.Reason           = txtReason.Text;
            ut.ApproverUsername = ddlApprover.SelectedValue;
            ut.Insert();
            //Response.Redirect("UndertimeMenu.aspx");

            //ADDED by CALVIN CAVITE FEB 15, 2018
            ScriptManager.RegisterStartupScript(this, GetType(), "Success!", "ModalSuccess();", true);
        }
    }
Exemplo n.º 9
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (clsUndertime undertime = new clsUndertime())
         {
             undertime.UndertimeCode    = txtUndertimeCode.Text;
             undertime.Username         = cmbRequestor.SelectedValue.ToString();
             undertime.DateFiled        = dtpFileDate.Value;
             undertime.DateApplied      = clsDateTime.CombineDateTime(dtpDateApplied.Value, dtpTimeApplied.Value);
             undertime.Reason           = txtReason.Text;
             undertime.ApproverUsername = cmbApprover.SelectedValue.ToString();
             undertime.ApproverDate     = dtpDateProcess.Value;
             undertime.ApproverRemarks  = txtRemarks.Text;
             undertime.Status           = cmbStatus.SelectedValue.ToString();
             undertime.InsertAdmin();
         }
         _frmUndertimeList.BindUndertimeList();
         this.Close();
         MessageBox.Show("Undertime has been filed successfully", "Undertime File", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 10
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;
            }
        }