public List <tblStudentInfo> GetStudentInfo()
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();
            var listitemsrecord       = (from x in db.tblStudentInfoes orderby x.libid descending select x).ToList <tblStudentInfo>();

            return(listitemsrecord);
        }
        public List <tblTeacherLogin> GetTeacherLogin()
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();
            var listitemsrecord       = (from x in db.tblTeacherLogins orderby x.loginid descending select x).ToList <tblTeacherLogin>();

            return(listitemsrecord);
        }
        public List <tblBook> GetBooksRecord()
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();
            var listitemsrecord       = (from x in db.tblBooks orderby x.code descending select x).ToList <tblBook>();

            return(listitemsrecord);
        }
        public List <tblBooksIssued> GetIssueBooks()
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();
            var listitemsrecord       = (from x in db.tblBooksIssueds orderby x.bookid descending select x).ToList <tblBooksIssued>();

            return(listitemsrecord);
        }
 private void populateIssueBook()
 {
     using (BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities())
     {
         gvIssueBook.DataSource = GetIssueBooks();
         gvIssueBook.DataBind();
     }
 }
 private void populateBooks()
 {
     using (BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities())
     {
         gvBooks.DataSource = GetBooksRecord();
         gvBooks.DataBind();
     }
 }
 private void populateTeacherLogin()
 {
     using (BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities())
     {
         gvTeacherLogin.DataSource = GetTeacherLogin();
         gvTeacherLogin.DataBind();
     }
 }
 private void populateStudentLogin()
 {
     using (BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities())
     {
         gvStudentLogin.DataSource = GetStudentLogin();
         gvStudentLogin.DataBind();
     }
 }
        protected void btnDeleteBooks_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();

            tblBook tbl = db.tblBooks.ToList().Where(x => x.code == int.Parse(txtCode.Text)).First();

            db.DeleteObject(tbl);
            db.SaveChanges();
            populateBooks();
        }
 public void searchBooksByAuthor()
 {
     using (BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities())
     {
         dlSearch.DataSource = from Books in db.tblBooks
                               where Books.author.Contains(author)
                               select Books;
         dlSearch.DataBind();
     }
 }
 protected void btnSearchAuthor_Click(object sender, EventArgs e)
 {
     using (BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities())
     {
         dlSearch.DataSource = from Books in db.tblBooks
                               where Books.author.Contains(txtSearch.Text)
                               select Books;
         dlSearch.DataBind();
     }
 }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();

            tblBook tbl = db.tblBooks.ToList().Where(x => x.code == int.Parse(txtCode.Text.ToString())).First();

            txtTitle.Text       = tbl.title;
            txtAuthor.Text      = tbl.author;
            txtPublication.Text = tbl.publication;
            txtSubject.Text     = tbl.subject;
            txtBooksQnty.Text   = tbl.no_of_copies.ToString();
        }
        protected void btnInsertBooks_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();

            tblBook tbl = new tblBook();

            tbl.title        = txtTitle.Text;
            tbl.author       = txtAuthor.Text;
            tbl.publication  = txtPublication.Text;
            tbl.subject      = txtSubject.Text;
            tbl.no_of_copies = int.Parse(txtBooksQnty.Text);
            db.AddTotblBooks(tbl);
            db.SaveChanges();
            populateBooks();
        }
        protected void btnUpdateBooks_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();

            tblBook tbl = db.tblBooks.ToList().Where(x => x.code == int.Parse(txtCode.Text)).First();

            tbl.title        = txtTitle.Text;
            tbl.author       = txtAuthor.Text;
            tbl.publication  = txtPublication.Text;
            tbl.subject      = txtSubject.Text;
            tbl.no_of_copies = int.Parse(txtBooksQnty.Text);

            db.SaveChanges();
            populateBooks();
        }
示例#15
0
        protected void btnSignupTCHR_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();

            int result = db.sp_insertTCHRLogin(int.Parse(tid), txtUSernameTCHR.Text, txtPasswordTCHR.Text);

            if (result > 0)
            {
                Response.Write("document.alert('Successfully Submitted....!!!!')");
                Response.Redirect("books.aspx");
            }
            else
            {
                SetFocus(txtUSernameTCHR);
            }
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();
            var myUser = db.tblStudentLogins
                         .FirstOrDefault(u => u.username == txtUsername.Text &&
                                         u.password == txtPassword.Text);

            if (myUser != null)    //User was found
            {
                Response.Write("alert('Login Succesfull...!!!');");
                Response.Redirect("books.aspx");
            }
            else    //User was not found
            {
                Response.Write("alert('Login Failed...!!!');");
                SetFocus(txtUsername);
            }
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();
            var myUser = db.tblTeacherLogins
                         .FirstOrDefault(u => u.username == txtUsername.Text &&
                                         u.password == txtPassword.Text);

            if (myUser != null)    //User was found
            {
                Response.Write("alert('Login Succesfull...!!!')");
                Response.Redirect("books.aspx");
            }
            else    //User was not found
            {
                var clientScript = Page.ClientScript;
                clientScript.RegisterClientScriptBlock(this.GetType(), "AlertScript", "alert('ERROR')'", true);
                SetFocus(txtUsername);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();

            int result = db.sp_insertStudentInfo(int.Parse(txtRegNoSTD.Text), txtBranchSTD.Text, txtSectionSTD.Text, txtSemesterSTD.Text, int.Parse(txtYOASTD.Text));

            ObjectParameter lib_id = new ObjectParameter("libid", typeof(System.Int32));

            db.sp_libraryID(int.Parse(txtRegNoSTD.Text), lib_id);

            if (result > 0)
            {
                Response.Write("document.alert('Successfully Submitted....!!!!')");
                libID = lib_id.Value.ToString();
                studentsignupbox.Visible = true;
                studentsubmitbox.Visible = false;
            }
            else
            {
                SetFocus(txtRegNoSTD);
            }
        }
示例#19
0
        protected void btnSubmitTCHR_Click(object sender, EventArgs e)
        {
            BCC_DOTNET_LMSEntities db = new BCC_DOTNET_LMSEntities();

            int result = db.sp_insertTeacherInfo(txtNameTCHR.Text, txtDesignationTCHR.Text, txtBranchTCHR.Text, txtContactTCHR.Text, txtLecturesTCHR.Text);

            ObjectParameter t_id = new ObjectParameter("tid", typeof(System.Int32));

            db.sp_teacherID(txtNameTCHR.Text, t_id);

            if (result > 0)
            {
                Response.Write("document.alert('Successfully Submitted....!!!!')");
                tid = t_id.Value.ToString();
                teachersignupbox.Visible = true;
                teachersubmitbox.Visible = false;
            }
            else
            {
                SetFocus(txtNameTCHR);
            }
        }