Ejemplo n.º 1
0
        protected void btnreturn_Click(object sender, EventArgs e)
        {
            _RentBL = new RentBL();
            List <Rent> _RentList = new List <Rent>();

            _RentList            = _RentBL.BL_Student_Select_BY_SID_Status(Convert.ToInt32(Session["sid"].ToString()), 1);
            GridView2.DataSource = _RentList;
            GridView2.DataBind();
            MultiView1.ActiveViewIndex = 1;
            lblr.Text = GridView2.Rows.Count.ToString();
        }
Ejemplo n.º 2
0
        protected void btnreturnbook_Click(object sender, EventArgs e)
        {
            int result = 0;

            _RentBL = new RentBL();
            result  = _RentBL.BL_RENT_SELECT_RETURN(Convert.ToInt32(ViewState["RRID"].ToString()), 1, Convert.ToInt32(ViewState["BBID"].ToString()));


            if (result != 0)
            {
                lblbook.Text      = "Book Returd Successfully !!";
                lblbook.ForeColor = System.Drawing.Color.Green;
            }
        }
Ejemplo n.º 3
0
        protected void Button12_Click(object sender, EventArgs e)
        {
            if (drppublication.SelectedIndex == 0)
            {
                lblmsg.Text      = "Select Student First !!";
                lblmsg.ForeColor = System.Drawing.Color.Red; MultiView1.ActiveViewIndex = -1;
            }
            else if (drpbook.SelectedIndex == 0)
            {
                lblmsg.Text      = "Select Book !!";
                lblmsg.ForeColor = System.Drawing.Color.Red; MultiView1.ActiveViewIndex = -1;
            }
            else
            {
                MultiView1.ActiveViewIndex = 0;

                List <Book> _BookList = new List <Book>();
                _BookBL = new BookBL();

                _BookList = _BookBL.BL_BOOK_Select_BY_BNAME(drpbook.SelectedItem.Text);

                ViewState["BBID"] = _BookList[0].BID.ToString();
                lblbname.Text     = _BookList[0].BookName.ToString();
                lblauthor.Text    = _BookList[0].Author.ToString();
                lblbran.Text      = _BookList[0].Branch.ToString();
                lblpub.Text       = _BookList[0].Publication.ToString();
                lblprice.Text     = _BookList[0].Price.ToString();

                Image2.ImageUrl = _BookList[0].Image.ToString();


                List <Student> _StudentList = new List <Student>();
                _StudentBL = new StudentBL();

                _StudentList    = _StudentBL.BL_Student_Select_BY_SID(Convert.ToInt32(drppublication.SelectedValue));
                lblstudent.Text = _StudentList[0].STUDENTNAME.ToString();


                List <Rent> __RentList = new List <Rent>();
                _RentBL    = new RentBL();
                __RentList = _RentBL.BL_Student_Select_BY_SID_BName_Status(Convert.ToInt32(drppublication.SelectedValue), drpbook.SelectedItem.Text, 0);

                lbldays.Text      = __RentList[0].Days.ToString();
                lblidate.Text     = __RentList[0].IssueDate.ToString();
                ViewState["RRID"] = __RentList[0].RID.ToString();
            }
        }
Ejemplo n.º 4
0
        protected void drppublication_SelectedIndexChanged(object sender, EventArgs e)

        {
            if (drppublication.SelectedValue != "0")
            {
                List <Rent> __RentList = new List <Rent>();
                _RentBL    = new RentBL();
                __RentList = _RentBL.BL_Student_Select_BY_SID_Status(Convert.ToInt32(drppublication.SelectedValue), 0);


                drpbook.DataSource     = __RentList;
                drpbook.DataTextField  = "BookName";
                drpbook.DataValueField = "RID";
                drpbook.DataBind();
                drpbook.Items.Insert(0, "SELECT");
            }
        }
        protected void btnseach_Click(object sender, EventArgs e)
        {
            lbl.Text = "";
            if (drpbranch.SelectedItem.Text == "SELECT")
            {
                lbl.Text = "Select Branch First !!";
            }
            else if (drpstudent.SelectedItem.Text == "SELECT")
            {
                lbl.Text = "Select Student First !!";
            }
            else

            {
                List <Rent> _RentList = new List <Rent>();
                _RentBL   = new RentBL();
                _RentList = _RentBL.BL_Student_Select_BY_SID_Status(Convert.ToInt32(drpstudent.SelectedValue), 0);

                GridView1.DataSource = _RentList;
                GridView1.DataBind();
                lbl.Text = "Total Records = " + _RentList.Count.ToString();
            }
        }
Ejemplo n.º 6
0
        protected void btnissue_Click(object sender, EventArgs e)
        {
            _RentBL = new RentBL();
            _BookBL = new BookBL();
            try
            {
                if (TextBox1.Text == "")
                {
                    lblissue.Text = "Enter Days !!";
                }
                else
                {
                    if (Convert.ToInt32(lblaqnt.Text) == 0)
                    {
                        lblissue.Text = "Book Stock Empty !!";
                    }
                    else
                    {
                        List <Rent> _RentList = new List <Rent>();
                        _RentBL   = new RentBL();
                        _RentList = _RentBL.BL_Student_Select_BY_SID_BName_Status(Convert.ToInt32(drpstudent.SelectedValue), lblbname.Text, 0);


                        if (_RentList.Count != 0)
                        {
                            lblissue.Text = "Student can't get copies of same book !!";
                        }
                        else
                        {
                            _RentList = _RentBL.BL_Student_Select_BY_SID_Status(Convert.ToInt32(drpstudent.SelectedValue), 0);


                            if (_RentList.Count == 3)
                            {
                                lblissue.Text = "A student has maximum 3 books !!";
                            }
                            else
                            {
                                int result  = 0;
                                int result1 = 0;
                                result = _RentBL.BL_RENT_Insert(lblbname.Text, Convert.ToInt32(drpstudent.SelectedValue), Convert.ToInt32(TextBox1.Text));

                                result1       = _BookBL.BL_Book_ISSUE_TO_STUDENT(Convert.ToInt32(ViewState["BBID"].ToString()));
                                lblissue.Text = "Book Issued to " + drpstudent.SelectedItem.Text;


                                List <Book> _BOOKList = new List <Book>();

                                _BOOKList = _BookBL.BL_BOOK_Select_BY_BID(Convert.ToInt32(ViewState["BBID"]));
                                if (_BOOKList.Count > 0)
                                {
                                    ViewState["BBID"] = _BOOKList[0].BID.ToString();
                                    lblbname.Text     = _BOOKList[0].BookName.ToString();
                                    lblauthor.Text    = _BOOKList[0].Author.ToString();
                                    lblbran.Text      = _BOOKList[0].Branch.ToString();
                                    lblpub.Text       = _BOOKList[0].Publication.ToString();
                                    lblprice.Text     = _BOOKList[0].Price.ToString();
                                    lblqnt.Text       = _BOOKList[0].Quantites.ToString();
                                    lblaqnt.Text      = _BOOKList[0].AvailableQnt.ToString();
                                    lblrqnt.Text      = _BOOKList[0].RentQnt.ToString();
                                    lbldetail.Text    = _BOOKList[0].Detail.ToString();
                                    Image2.ImageUrl   = _BOOKList[0].Image.ToString();
                                }
                                TextBox1.Text = "";
                                drpstudent.Items.Clear();
                                drpstudent.Items.Insert(0, "SELECT");


                                List <Branch> _BranchList = new List <Branch>();
                                _BranchBL   = new BranchBL();
                                _BranchList = _BranchBL.BL_Branch_Select();


                                drpbranch.DataSource     = _BranchList;
                                drpbranch.DataTextField  = "BranchName";
                                drpbranch.DataValueField = "BranchID";
                                drpbranch.DataBind();
                                drpbranch.Items.Insert(0, "SELECT");
                            }
                        }
                    }
                }
            }
            catch
            {
                lblissue.Text = "Sorry !!! Error !!!";
            }
        }