public ActionResult DeleteConfirmed(int id)
        {
            tbl_feedback tbl_feedback = db.tbl_feedback.Find(id);

            db.tbl_feedback.Remove(tbl_feedback);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Details(Int32 id)
        {
            tbl_feedback tbl = db.tbl_feedbacks.Where(x => x.f_id == id).Single <tbl_feedback>();

            tbl.f_status = true;
            db.SubmitChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(Int32 id)
        {
            tbl_feedback tb = db.tbl_feedbacks.Where(x => x.f_id == id).Single <tbl_feedback>();

            db.tbl_feedbacks.DeleteOnSubmit(tb);
            db.SubmitChanges();
            Session["feedbackunread"] = db.tbl_feedbacks.Where(x => x.f_status == false).Count();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "f_id,f_text,f_email,f_name,f_contact,UserFeed_id,Admin_Reply")] tbl_feedback tbl_feedback)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_feedback).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserFeed_id = new SelectList(db.TBL_USER, "u_id", "u_name", tbl_feedback.UserFeed_id);
     return(View(tbl_feedback));
 }
        // GET: FeedBack/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_feedback tbl_feedback = db.tbl_feedback.Find(id);

            if (tbl_feedback == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_feedback));
        }
        public ActionResult Form(Model_feedback obj)
        {
            tbl_feedback tb = new tbl_feedback();

            tb.login_id = SessionData.UserId;;
            tb.f_name   = obj.f_name;
            tb.f_email  = obj.f_email;
            tb.f_des    = obj.f_des;
            tb.f_status = false;
            tb.f_date   = DateTime.Now;
            db.tbl_feedbacks.InsertOnSubmit(tb);
            db.SubmitChanges();
            return(RedirectToAction("Index", "Home"));
        }
 public ActionResult Contact(tbl_feedback feed)
 {
     try
     {
         db.tbl_feedback.Add(feed);
         db.SaveChanges();
         TempData["msg"] = "Your FeedBack is Submitted Successfully";
         TempData.Keep();
         return(RedirectToAction("Contact"));
     }
     catch (Exception)
     {
         return(RedirectToAction("ErrorPage"));
     }
 }
        // GET: FeedBack/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_feedback tbl_feedback = db.tbl_feedback.Find(id);

            if (tbl_feedback == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserFeed_id = new SelectList(db.TBL_USER, "u_id", "u_name", tbl_feedback.UserFeed_id);
            return(View(tbl_feedback));
        }
 public ActionResult Contact(tbl_feedback fed)
 {
     try
     {
         db.tbl_feedback.Add(fed);
         db.SaveChanges();
         TempData["msg"] = "Feedback submitted successfully...";
         TempData.Keep();
         return(RedirectToAction("Contact"));
     }
     catch (Exception)
     {
         return(RedirectToAction("Errorpage"));
     }
     return(View());
 }
        public ActionResult ReplybyAdmin()
        {
            var joinresult = db.tbl_feedback.Join(db.TBL_USER,
                                                  b => b.UserFeed_id,
                                                  p => p.u_id,
                                                  (b, p) => new { b.f_id, b.f_text, b.f_name, b.f_email, b.Admin_Reply });

            List <tbl_feedback> feedtable = new List <tbl_feedback>();

            //for(int i=0;i<result.Count();i++)
            foreach (var item in joinresult)
            {
                tbl_feedback tempbug = new tbl_feedback();
                tempbug.f_id    = item.f_id;
                tempbug.f_name  = item.f_name;
                tempbug.f_email = item.f_email;
                // tempbug.f_contact = item.f_contact;
                tempbug.f_text      = item.f_text;
                tempbug.Admin_Reply = item.Admin_Reply;
                feedtable.Add(tempbug);
            }
            return(View(feedtable));
        }