예제 #1
0
    protected void year()
    {
        DataAccess da = new DataAccess();
        DataSet    ds = new DataSet();
        // string str = " select Datename(yy,StartDate) as year, Datename(yy,EndDate) as year1  from tblAcademicYear where intschool=" + Session["Schoolid"].ToString() + " and intactive=1";
        string str = " select convert(varchar(10),StartDate,103) as startdate,convert(varchar(10),EndDate,103) as enddate from tblAcademicYear where intschool=" + Session["Schoolid"].ToString() + " and intactive=1";

        ds = da.ExceuteSql(str);
        ds = da.ExceuteSql(str);
        if (ds.Tables[0].Rows.Count > 0)
        {
            GridIDCard.DataSource = ds;
            GridIDCard.DataBind();
        }
    }
    protected void fillgrid()
    {
        if (ddlpatrontype.SelectedValue == "Student")
        {
            DataAccess da = new DataAccess();
            DataSet    ds = new DataSet();
            string     str;
            str  = "select a.intid,a.strfirstname+''+a.strmiddlename+''+a.strlastname as name,a.strstandard+' - '+a.strsection as standard,a.intadmitno,a.strstudentbirthcertificateno as studentbirth,";
            str += " convert(varchar(10),b.StartDate,103) as year, CONVERT(varchar(10),b.EndDate,103) as year1 from tblAcademicYear b,tblstudent a";
            str += " where b.intactive=1 and a.intschool=" + Session["Schoolid"].ToString();
            if (ddlstudent.SelectedIndex > 1)
            {
                str += " and a.intid=" + ddlstudent.SelectedValue + "";
            }
            if (ddlstandard.SelectedIndex > 0)
            {
                str += " and a.strstandard+' - '+a.strsection='" + ddlstandard.SelectedValue + "'";
            }

            ds = da.ExceuteSql(str);
            GridIDCard.DataSource = ds;
            GridIDCard.DataBind();
        }
        else
        {
            DataAccess da = new DataAccess();
            DataSet    ds = new DataSet();
            string     str;
            str  = "select a.intid,a.strfirstname+''+a.strmiddlename+''+a.strlastname as name,a.strtype,'' as standard,'' as studentbirth,'' as intadmitno,";
            str += " convert(varchar(10),b.StartDate,103) as year, CONVERT(varchar(10),b.EndDate,103) as year1 from tblAcademicYear b,tblemployee a";
            str += " where b.intactive=1 and a.intschool=" + Session["Schoolid"].ToString();
            if (ddlstaffname.SelectedIndex > 1)
            {
                str += " and a.intid=" + ddlstaffname.SelectedValue + "";
            }
            if (ddlstaff.SelectedIndex > 0)
            {
                str += " and a.strtype='" + ddlstaff.SelectedValue + "'";
            }

            ds = da.ExceuteSql(str);
            GridIDCard.DataSource = ds;
            GridIDCard.DataBind();
        }
    }
    protected void fillgrid()
    {
        DataAccess da = new DataAccess();
        DataSet    ds = new DataSet();
        string     str;

        str  = "select intid,strfirstname+''+strmiddlename+''+strlastname as name,strstandard+' - '+strsection as standard,intadmitno from tblstudent";
        str += "  where intschool=" + Session["Schoolid"].ToString();
        if (ddlstudent.SelectedIndex > 0)
        {
            str += " and intid=" + ddlstudent.SelectedValue + "";
        }
        if (ddlstandard.SelectedIndex > 0)
        {
            str += " and strstandard='" + ddlstandard.SelectedValue + "'";
        }

        ds = da.ExceuteSql(str);
        GridIDCard.DataSource = ds;
        GridIDCard.DataBind();
    }
예제 #4
0
    protected void fillgrid()
    {
        DataAccess da = new DataAccess();
        DataSet    ds = new DataSet();
        string     str;

        if (ddlstudent.SelectedValue == "--All--")
        {
            str = "select intid as lblid,intid,strfirstname+' '+strmiddlename+' '+strlastname as name,strstandard+' - '+strsection as standard,intadmitno,strstudentbirthcertificateno from tblstudent where strstandard+' - '+strsection='" + ddlstandard.SelectedValue + "' and intschool=" + Session["Schoolid"].ToString();
        }
        else
        {
            str = "select intid as lblid,intid,strfirstname+' '+strmiddlename+' '+strlastname as name,strstandard+' - '+strsection as standard,intadmitno,strstudentbirthcertificateno from tblstudent where strstandard+' - '+strsection='" + ddlstandard.SelectedValue + "' and intschool=" + Session["Schoolid"].ToString() + " and intid=" + ddlstudent.SelectedValue;
        }
        ds = da.ExceuteSql(str);
        if (ds.Tables[0].Rows.Count > 0)
        {
            GridIDCard.DataSource = ds;
            GridIDCard.DataBind();
        }
    }