public ActionResult Index(MasterComplain_model cat) { MasterComplain tblcat = new MasterComplain(); tblcat.ComplainSubject = cat.ComplainSubject; tblcat.ComplainDescription = cat.ComplainDescription; db.MasterComplains.InsertOnSubmit(tblcat); db.SubmitChanges(); return(View()); }
public ActionResult Edit(MasterComplain_model cat) { MasterComplain tblcat = db.MasterComplains.Where(x => x.ComplainID == cat.ComplainID).Single <MasterComplain>(); tblcat.ComplainID = cat.ComplainID; tblcat.ComplainDescription = cat.ComplainDescription; tblcat.UserID = cat.UserID; tblcat.ComplainSubject = cat.ComplainSubject; db.SubmitChanges(); return(View()); }
public ActionResult Edit(int id) { MasterComplain_model cat = db.MasterComplains.Where(x => x.ComplainID == id).Select(x => new MasterComplain_model() { ComplainID = x.ComplainID, UserID = x.UserID, ComplainSubject = x.ComplainSubject, ComplainDescription = x.ComplainDescription, Reply = x.Reply }).SingleOrDefault(); return(View(cat)); }