Esempio n. 1
0
    public void FillgvAward()
    {
        try
        {
            long         classId   = Convert.ToInt64(ddlClasses.SelectedValue);
            long         SectionId = Convert.ToInt64(ddlSection.SelectedValue);
            long         UnitId    = Convert.ToInt64(ddlType.SelectedValue);
            long         Subjectid = Convert.ToInt64(ddlSubject.SelectedValue);
            long         type      = Convert.ToInt64(rbtnSubject.SelectedValue);
            List <Award> aModel    = Mdal.getAwardRollForAwardList(classId, SectionId, UnitId, Subjectid, type);

            if (aModel.Count > 0)
            {
                foreach (GridViewRow dr in gvAddAward.Rows)
                {
                    CheckBox chkBoxAbsent = (CheckBox)dr.FindControl("chkBoxAbsent");
                    Label    lblStatus    = (Label)dr.FindControl("lblStatus");

                    if (lblStatus.Text == "0")
                    {
                    }
                    else
                    {
                        chkBoxAbsent.Checked = true;
                    }
                }
                gvAddAward.DataSource = aModel;
                gvAddAward.DataBind();
                btnSubmit.Visible = true;
            }
            else
            {
                lblError.Visible = true;
                lblError.Text    = "No Data";

                gvAddAward.DataBind();
            }
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            lblError.Text    = ex.ToString();
        }
    }
Esempio n. 2
0
    public void FillgvAward()
    {
        try
        {
            pnlAward.Visible = true;
            getDataForLabels();
            lblClass.Text   = ddlClasses.SelectedItem.Text;
            lblSection.Text = ddlSection.SelectedItem.Text;
            lblUnit.Text    = ddlType.SelectedItem.Text;
            lblSubject.Text = ddlSubject.SelectedItem.Text;
            long         classId   = Convert.ToInt64(ddlClasses.SelectedValue);
            long         SectionId = Convert.ToInt64(ddlSection.SelectedValue);
            long         UnitId    = Convert.ToInt64(ddlType.SelectedValue);
            long         Subjectid = Convert.ToInt64(ddlSubject.SelectedValue);
            long         type      = Convert.ToInt64(rbtnSubject.SelectedValue);
            List <Award> aModel    = Mdal.getAwardRollForAwardList(classId, SectionId, UnitId, Subjectid, type);
            btnPrint.Visible = true;

            if (aModel.Count > 0)
            {
                lblError.Text         = "";
                gvAddAward.DataSource = aModel;
                gvAddAward.DataBind();
                Session["Ctrl"] = pnlAward;
            }
            else
            {
                lblError.Visible = true;
                lblError.Text    = "No Data";
            }
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            lblError.Text    = "No Max Marks Assigned";
            pnlAward.Visible = false;
        }
    }