Beispiel #1
0
    public void FillgvAward()
    {
        lblError.Text = "";
        MarksBLL mDal   = new MarksBLL();
        Marks    mModel = new Marks();

        mModel.classID   = Convert.ToInt64(ddlClasses.SelectedValue);
        mModel.sectionID = Convert.ToInt64(ddlSection.SelectedValue);
        mModel.unitID    = Convert.ToInt64(ddlType.SelectedValue);
        mModel.subjectID = Convert.ToInt64(ddlSubject.SelectedValue);
        List <Marks> lmarks = new List <Marks>();

        lmarks = mDal.getAwardRoll(mModel);
        if (lmarks.Count > 0)
        {
            gvEditMarks.DataSource = lmarks;
            gvEditMarks.DataBind();
            gvEditMarks.DataSource = lmarks;
            gvEditMarks.DataBind();
            btnUpdate.Visible = true;
        }
        else
        {
            lblError.Visible       = true;
            lblError.Text          = "No Data";
            gvEditMarks.DataSource = lmarks;
            gvEditMarks.DataBind();
        }
    }
Beispiel #2
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<Marks> aModel = Mdal.getAwardRoll(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();
                btnUpdate.Visible = true;

            }
            else
            {
                lblError.Visible = true;
                lblError.Text = "No Data";
                    gvAddAward.DataSource = aModel;
                    gvAddAward.DataBind();

        }
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            lblError.Text = ex.ToString();
        }

    }