Example #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        List <ATTAwardPunishment> LSTPunishment = (List <ATTAwardPunishment>)Session["Punishment"];

        if (this.grdpunishment.SelectedIndex > -1 || LSTPunishment == null)
        {
            LSTPunishment = (List <ATTAwardPunishment>)Session["PrevPunishments"];
        }
        try
        {
            if (BLLAwardPunishment.SavePunishment(LSTPunishment))
            {
                this.lblStatusMessage.Text = "**Punishment for Employee Saved Successfully";
                this.programmaticModalPopup.Show();
                //double empid = LSTPunishment[0].EmpID;
                //grdpunishment.DataSource = BLLAwardPunishment.GetPunishments(empid);
                //grdpunishment.DataBind();
            }
            ClearControls("punishment");
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        List <ATTAwardPunishment> LSTAward = (List <ATTAwardPunishment>)Session["Award"];

        if (this.grdAward.SelectedIndex > -1 || LSTAward == null)
        {
            LSTAward = (List <ATTAwardPunishment>)Session["PrevAwards"];
        }
        if (Session["Award"] == null && Session["PrevAwards"] == null)
        {
            this.lblStatusMessage.Text = "**Sorry ! No Data To Save";
            this.programmaticModalPopup.Show();
            return;
        }
        try
        {
            if (BLLAwardPunishment.SaveAward(LSTAward))
            {
                this.lblStatusMessage.Text = "**Award for Employee Saved Successfully";
                this.programmaticModalPopup.Show();
                double empid = LSTAward[0].EmpID;
                grdAward.DataSource = BLLAwardPunishment.GetAwards(empid);
                grdAward.DataBind();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Example #3
0
    protected void grdEmployee_SelectedIndexChanged(object sender, EventArgs e)
    {
        int empid = int.Parse(Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[0].Text).ToString());

        Session["SelectedEmp"] = empid;
        this.lblEmpName.Text   = Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[5].Text).ToString();
        List <ATTAwardPunishment> LSTPunishments = BLLAwardPunishment.GetPunishments(empid);

        Session["PrevPunishments"] = LSTPunishments;
        grdpunishment.DataSource   = LSTPunishments;
        grdpunishment.DataBind();
    }