protected void btnApplSubmit_Click(object sender, EventArgs e)
    {
        List <ATTEmployeeLeave> LSTEmpLeave = new List <ATTEmployeeLeave>();

        LSTEmpLeave = (List <ATTEmployeeLeave>)Session["EmployeeLeave"];
        if (grdLeaveApplications.Rows.Count == 0)
        {
            this.lblStatusMessage.Text = "**Sorry No Data To Save";
            this.programmaticModalPopup.Show();
            return;
        }
        grdLeaveApplications.SelectedIndex = -1;
        try
        {
            if (BLLEmployeeLeave.SaveEmpLeaveApplication(LSTEmpLeave))
            {
                this.lblStatusMessage.Text = "Employee Leave Saved Successfully.";
                this.programmaticModalPopup.Show();
                grdLeaveApplications.DataSource = null;
                grdLeaveApplications.DataBind();
                this.CollapsiblePanelExtender1.Collapsed   = true;
                this.CollapsiblePanelExtender1.ClientState = "true";
                ClearControls(1, 1, 1, 0);
            }
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message.ToString();
            this.programmaticModalPopup.Show();
        }
    }
    protected void btnRecSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            List <ATTEmployeeLeave> lstEmployeeLeave = (List <ATTEmployeeLeave>)Session["EmployeeLeave"];
            int index = 0;
            foreach (GridViewRow rw in this.grdLeaveApplications.Rows)
            {
                if (((CheckBox)rw.FindControl("chk")).Checked == true)
                {
                    lstEmployeeLeave[index].RecByID   = int.Parse(txtRecName.Attributes["ID"].ToString());
                    lstEmployeeLeave[index].RecByName = this.txtRecName.Text;
                    lstEmployeeLeave[index].RecDate   = this.txtRecDate.Text;
                    lstEmployeeLeave[index].RecFrom   = rw.Cells[6].Text;
                    lstEmployeeLeave[index].RecTo     = rw.Cells[7].Text;
                    lstEmployeeLeave[index].RecDays   = int.Parse(rw.Cells[8].Text);
                    if (chkbxRec.Checked == true)
                    {
                        lstEmployeeLeave[index].Recommended = "Y";
                    }
                    else
                    {
                        lstEmployeeLeave[index].Recommended = "N";
                    }
                    if (this.txtRecReason.Text == "")
                    {
                        lstEmployeeLeave[index].RecReason = "";
                    }
                    else
                    {
                        lstEmployeeLeave[index].RecReason = this.txtRecReason.Text;
                    }
                    //objEmpLST.Approved = "N";
                    lstEmployeeLeave[index].Action = "E";
                }
                index++;
            }
            if (grdLeaveApplications.Rows.Count == 0)
            {
                this.lblStatusMessage.Text = "**Sorry! No Data To Save**";
                this.programmaticModalPopup.Show();
                return;
            }

            if (BLLEmployeeLeave.SaveEmpLeaveApplication(lstEmployeeLeave))
            {
                this.lblStatusMessage.Text = "Employee Leave Successfully Recommended.";
                this.programmaticModalPopup.Show();
                this.CollapsiblePanelExtender1.Collapsed   = true;
                this.CollapsiblePanelExtender1.ClientState = "true";
            }
            ClearControls(1, 1, 1, 0);
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message.ToString();
            this.programmaticModalPopup.Show();
        }
    }
Ejemplo n.º 3
0
    protected void btnApplSubmit_Click(object sender, EventArgs e)
    {
        if (ddlAppType.SelectedIndex == 0)
        {
            lblStatusMessage.Text = "Please Select leave Type first";
            programmaticModalPopup.Show();
            return;
        }
        if (txtEmpDate.Text == "")
        {
            lblStatusMessage.Text = "Please Enter Application Date first";
            programmaticModalPopup.Show();
            return;
        }

        List <ATTEmployeeLeave> LSTEmpLeave = new List <ATTEmployeeLeave>();

        try
        {
            ATTEmployeeLeave att = new ATTEmployeeLeave();
            att.EmpID       = int.Parse(Session["UserID"].ToString());
            att.EmpFullName = Session["UserName"].ToString();
            att.ReqdFrom    = txtEmpLvFrom.Text;
            att.ReqdTo      = txtEmpLvTo.Text;
            att.LeaveTypeID = int.Parse(this.ddlAppType.SelectedValue.ToString());
            att.EmpDays     = int.Parse(txtEmpLvDays.Text.ToString());
            att.ApplDate    = txtEmpDate.Text;
            att.EmpReason   = txtEmpLvResn.Text;
            att.EntryBy     = Session["UserName"].ToString();
            att.EntryDate   = "";
            att.Action      = "A";
            LSTEmpLeave.Add(att);

            if (BLLEmployeeLeave.SaveEmpLeaveApplication(LSTEmpLeave))
            {
                ClearControls();
                lblStatusMessage.Text = "Saved Successfully";
                programmaticModalPopup.Show();
            }
        }
        catch (Exception ex)
        {
            lblStatusMessage.Text = ex.Message;
            programmaticModalPopup.Show();
        }
    }
Ejemplo n.º 4
0
    protected void btnApplSubmit_Click(object sender, EventArgs e)
    {
        List <ATTEmployeeLeave> LSTEmpLeave = new List <ATTEmployeeLeave>();

        LSTEmpLeave = (List <ATTEmployeeLeave>)Session["EmployeeLeave"];
        grdLeaveApplications.SelectedIndex = -1;
        try
        {
            if (BLLEmployeeLeave.SaveEmpLeaveApplication(LSTEmpLeave))
            {
                this.lblStatusMessage.Text = "Information Saved.";
                this.programmaticModalPopup.Show();
                grdLeaveApplications.DataSource = null;
                grdLeaveApplications.DataBind();
                ClearControls(1, 1, 0);
            }
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message.ToString();
            this.programmaticModalPopup.Show();
        }
    }