Exemplo n.º 1
0
 protected void btn_search_Click(object sender, EventArgs e)
 {
     if (DropDownList1.SelectedValue == "0" || DropDownList2.SelectedValue == "0")
     {
         Label3.Text = "You Must Select Any Values IN Dropdown...";
     }
     else
     {
         x.conopen();
         qry = "select qty from book_mster where book_id='" + DropDownList2.SelectedValue + "'";
         dr  = x.search(qry);
         if (dr.HasRows)
         {
             dr.Read();
             i = Convert.ToInt32(dr[0].ToString());
         }
         x.conclose();
         x.conopen();
         qry = "select count(*) from issue_mster where book_id='" + DropDownList2.SelectedValue + "'";
         string q = x.sca(qry);
         //Label2.Text = q;
         int k = i - Convert.ToInt32(q);
         Label3.Text = " Available Book : " + k.ToString();
         if (k.ToString() == "0")
         {
             btn_demand.Visible = true;
         }
         x.conclose();
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        x.conopen();
        qry          = "select count(*) from pub_mster";
        lbl_pub.Text = x.sca(qry);

        qry = "select count(*) from author_mster";
        lbl_authors.Text = x.sca(qry);

        qry            = "select sum(qty) from book_mster";
        lbl_books.Text = x.sca(qry);

        qry = "select count(*) from student_mster";
        lbl_students.Text = x.sca(qry);
        x.conclose();
    }