protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack == false)
        {
            StuDT = StuAdapter.Select_UNAME(Session["sname"].ToString());


            AttDT            = AttAdapter.Select_By_ROLLNO(StuDT.Rows[0]["rollno"].ToString());
            lbltotalatt.Text = AttDT.Rows.Count.ToString();


            AttDT           = AttAdapter.Select_Roll_Atatus(StuDT.Rows[0]["rollno"].ToString(), "Present");
            lblpresent.Text = AttDT.Rows.Count.ToString();

            AttDT          = AttAdapter.Select_Roll_Atatus(StuDT.Rows[0]["rollno"].ToString(), "Absent");
            lblabsent.Text = AttDT.Rows.Count.ToString();

            AttDT         = AttAdapter.Select_Roll_Atatus(StuDT.Rows[0]["rollno"].ToString(), "Leave");
            lblleave.Text = AttDT.Rows.Count.ToString();

            LeaveDT            = LeaveAdapter.Select_By_RollNo(StuDT.Rows[0]["rollno"].ToString());
            lbltotalleave.Text = LeaveDT.Rows.Count.ToString();


            CompDT = CompAdapter.Select_By_ROLL(StuDT.Rows[0]["rollno"].ToString());
            lbltotalattcompl.Text = CompDT.Rows.Count.ToString();
        }
    }
 protected void btnsarch_Click(object sender, EventArgs e)
 {
     AttDT = AttAdapter.Select_By_ROLLNO(drpstudent.SelectedItem.Text);
     GridView1.DataSource = AttDT;
     GridView1.DataBind();
     lblcnt.Text = "Result  = " + GridView1.Rows.Count.ToString();
 }
Example #3
0
    protected void Button7_Click(object sender, EventArgs e)
    {
        // DivDT = DivAdapter.SELECT_BY_ID(Convert.ToInt32(drpdiv.SelectedValue));

        //StuDT = StuAdapter.Select_By_STD_DIV(lblstd.Text, drpdiv.SelectedItem.Text);
        //int rstu=Convert.ToInt32(DivDT.Rows[0]["Seat"].ToString()) - Convert.ToInt32(StuDT.Rows.Count.ToString());
        //lblstudent.Text = "Total Admitted =" + StuDT.Rows.Count.ToString() + " , Remaining Student = " + rstu;

        string stddd = lblstd.Text.Substring(0, 1) + drpdiv.SelectedItem.Text;

        AttDT = AttAdapter.Select_Report(stddd + "%", Calendar1.SelectedDate.Date.GetDateTimeFormats()[8].ToString());

        GridView1.DataSource = AttDT;
        GridView1.DataBind();
        lblcnt.Text = "Result = " + GridView1.Rows.Count.ToString();
    }
    protected void btnreport_Click(object sender, EventArgs e)
    {
        if (drpmonth.SelectedIndex == 0)
        {
            lbl.Text = "Select month first !!";
        }
        else
        {
            StuDT = StuAdapter.Select_UNAME(Session["sname"].ToString());

            AttDT = AttAdapter.Select_Roll_month(StuDT.Rows[0]["rollno"].ToString(), "%" + drpmonth.SelectedValue + "%");

            GridView1.DataSource = AttDT;
            GridView1.DataBind();
            lbl.Text = "Result = " + GridView1.Rows.Count.ToString();
        }
    }
    protected void btnaddatt_Click(object sender, EventArgs e)
    {
        AttDT = AttAdapter.Selecr_Allready_Saved(GridView1.Rows[0].Cells[0].Text, Calendar1.SelectedDate.Date.GetDateTimeFormats()[8].ToString());

        if (AttDT.Rows.Count == 1)
        {
            lblatt.Text = "Attendance Alredy Saved";
        }
        else
        {
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                string       rollno  = GridView1.Rows[i].Cells[0].Text;
                string       name    = GridView1.Rows[i].Cells[1].Text;
                DropDownList drpattt = GridView1.Rows[i].Cells[2].FindControl("drpatt") as DropDownList;

                AttAdapter.Insert(rollno, name, Calendar1.SelectedDate.Date.GetDateTimeFormats()[8].ToString(), drpattt.SelectedItem.Text, Session["uname"].ToString());
            }
            MultiView1.ActiveViewIndex = -1;
            drpdiv.SelectedIndex       = 0;
            lblatt.Text = "Attendance Saved";
        }
    }