Пример #1
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();
            }
        }
        protected void Button12_Click(object sender, EventArgs e)
        {
            if (drppublication.SelectedIndex == 0)
            {
                lblmsg.Text      = "Select Publication !!";
                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);

                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();
                }
                drpstudent.Items.Clear();
                drpstudent.Items.Insert(0, "SELECT");
            }
        }