public ActionResult Edit([Bind(Include = "mem_id,mem_name,mem_email,mem_contact,mem_password,mem_address,mem_dob")] tbl_member tbl_member)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_member).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("UserPanel", "Tbl_member"));
     }
     return(View(tbl_member));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Admin_id,Admin_name,Admin_email,Admin_password,Admin_contact,Admin_status")] Tbl_admin tbl_admin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_admin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_admin));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "cat_id,cat_name,cat_status")] Book_categoryy book_categoryy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book_categoryy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(book_categoryy));
 }
 public ActionResult Edit([Bind(Include = "Vendor_id,Vendor_name,Vendor_email,Vendor_password,Vendor_contactno,Vendor_status,Vendor_ShopAdr,Admin_id")] Tbl_Vendorr tbl_Vendorr)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Vendorr).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_id = new SelectList(db.Tbl_admin, "Admin_id", "Admin_name", tbl_Vendorr.Admin_id);
     return(View(tbl_Vendorr));
 }
예제 #5
0
 public ActionResult Edit([Bind(Include = "in_id,in_date,in_totalbill,mem_id")] Invoice invoice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(invoice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.mem_id = new SelectList(db.tbl_member, "mem_id", "mem_name", invoice.mem_id);
     return(View(invoice));
 }
예제 #6
0
 public ActionResult Edit([Bind(Include = "blog_id,blog_datetime,blog_groupid,blog_createdby,blog_img,blog_title,blog_body")] tbl_blog tbl_blog)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_blog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.blog_groupid   = new SelectList(db.tbl_group, "group_id", "group_id", tbl_blog.blog_groupid);
     ViewBag.blog_createdby = new SelectList(db.tbl_member, "mem_id", "mem_name", tbl_blog.blog_createdby);
     return(View(tbl_blog));
 }
예제 #7
0
 public ActionResult Edit([Bind(Include = "Wish_Id,Book_ID,mem_Id,Wish_date")] tbl_wishlist tbl_wishlist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_wishlist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Book_ID = new SelectList(db.Tbl_Books, "Book_id", "Book_name", tbl_wishlist.Book_ID);
     ViewBag.mem_Id  = new SelectList(db.tbl_member, "mem_id", "mem_name", tbl_wishlist.mem_Id);
     return(View(tbl_wishlist));
 }
예제 #8
0
 public ActionResult Edit([Bind(Include = "group_mem_id,group_mem_groupid,group_mem_memid,group_mem_joindate")] tbl_groupmem tbl_groupmem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_groupmem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.group_mem_groupid = new SelectList(db.tbl_group, "group_id", "group_title", tbl_groupmem.group_mem_groupid);
     ViewBag.group_mem_memid   = new SelectList(db.tbl_member, "mem_id", "mem_name", tbl_groupmem.group_mem_memid);
     return(View(tbl_groupmem));
 }
예제 #9
0
 public ActionResult Edit([Bind(Include = "group_id,group_datetime,group_createdby,group_title")] tbl_group tbl_group)
 {
     if (ModelState.IsValid)
     {
         //tbl_group.group_createdby = tbl_group.group_createdby;
         //tbl_group.group_datetime = tbl_group.group_datetime;
         db.Entry(tbl_group).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.group_createdby = new SelectList(db.tbl_member, "mem_id", "mem_name", tbl_group.group_createdby);
     return(View(tbl_group));
 }
예제 #10
0
        public ActionResult Edit(Ebooks_db ebooks, HttpPostedFileBase imagefile, HttpPostedFileBase pdffile)
        {
            var book = db.Ebooks_db.Where(x => x.Ebook_id == ebooks.Ebook_id).FirstOrDefault();

            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(imagefile != null ? imagefile.FileName : ""))
                {
                    string path = uploadingfile(imagefile);
                    if (path.Equals("-1"))
                    {
                        ViewBag.error = "Image could not be uploaded....";
                    }
                    else
                    {
                        book.Ebook_img = path;
                    }
                }
                if (!string.IsNullOrEmpty(pdffile != null ? pdffile.FileName : ""))
                {
                    string path1 = uploadingpdffile(pdffile);
                    if (path1.Equals("-1"))
                    {
                        ViewBag.error = "pdf could not be uploaded....";
                    }
                    else
                    {
                        book.Ebook_pdffile = path1;
                    }
                }



                book.Ebook_name      = ebooks.Ebook_name;
                book.Ebook_publisher = ebooks.Ebook_publisher;
                book.Ebook_author    = ebooks.Ebook_author;
                book.cat_id          = ebooks.cat_id;

                book.Ebook_edition = ebooks.Ebook_edition;

                db.Entry(book).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(book));
        }
예제 #11
0
        //POST: Bookcategoryy/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.

        public ActionResult Edit(Tbl_Books Tbl_Books, HttpPostedFileBase imagefile)
        {
            var tbl_Books = db.Tbl_Books.Find(Tbl_Books.Book_id);

            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(imagefile != null ? imagefile.FileName : ""))
                {
                    string path = uploadingfile(imagefile);
                    if (path.Equals("-1"))
                    {
                        ViewBag.error = "Image could not be uploaded....";
                    }
                    else
                    {
                        tbl_Books.Book_img = path;
                    }
                }

                tbl_Books.Book_name    = Tbl_Books.Book_name;
                tbl_Books.Book_Edition = Tbl_Books.Book_Edition;
                tbl_Books.Book_price   = Tbl_Books.Book_price;
                tbl_Books.auth_id      = Tbl_Books.auth_id;
                tbl_Books.pub_id       = Tbl_Books.pub_id;
                tbl_Books.cat_id       = Tbl_Books.cat_id;



                db.Entry(tbl_Books).State = EntityState.Modified;
                db.SaveChanges();


                if (Session["Admin_id"] != null)
                {
                    return(RedirectToAction("AdminIndex"));
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }
            return(View(Tbl_Books));
        }