public ActionResult Delete(Int16 id) { Model_complain obj = db.tbl_complains.Where(x => x.com_id == id).Select(x => new Model_complain() { login_id = x.login_id, com_sub = x.com_sub, com_des = x.com_des }).SingleOrDefault(); return(View(obj)); }
public ActionResult Form(Model_complain obj) { tbl_complain tb = new tbl_complain(); tb.login_id = SessionData.UserId; tb.com_sub = obj.com_sub; tb.com_des = obj.com_des; tb.com_status = false; tb.com_date = DateTime.Now; db.tbl_complains.InsertOnSubmit(tb); db.SubmitChanges(); return(RedirectToAction("Index")); }
public ActionResult Details(Int16 id) { Model_complain obj = db.tbl_complains.Where(x => x.com_id == id).Select(x => new Model_complain() { com_id = x.com_id, com_sub = x.com_sub, com_des = x.com_des, com_date = x.com_date, com_status = x.com_status }).SingleOrDefault(); var str = ""; if (obj.com_status == true) { str = "Approved"; } else { str = "Pending"; } ViewBag.comstatus = str; return(View(obj)); }