public ActionResult DeleteConfirmed(int id) { Fnc_Course_Cost_Sks fnc_Course_Cost_Sks = db.Fnc_Course_Cost_Sks.Find(id); Mstr_Class_Program mstr_Class_Program = db.Mstr_Class_Program.Where(cp => cp.Class_Prog_Id == fnc_Course_Cost_Sks.Class_Prog_Id).First(); db.Fnc_Course_Cost_Sks.Remove(fnc_Course_Cost_Sks); db.SaveChanges(); return(RedirectToAction("Index", new { Class_Prog_Id = mstr_Class_Program.Class_Prog_Id, Term_Year_Id = fnc_Course_Cost_Sks.Term_Year_Id })); }
public ActionResult Edit([Bind(Include = "Course_Cost_Sks_Id,Term_Year_Id,Department_Id,Class_Prog_Id,Entry_Year_Id,Amount_Per_Sks,Created_By,Created_Date,Modified_By,Modified_Date")] Fnc_Course_Cost_Sks fnc_Course_Cost_Sks, string SAmount) { fnc_Course_Cost_Sks.Amount_Per_Sks = (int)decimal.Parse(Regex.Replace(SAmount, @"[^\d.]", "")); if (ModelState.IsValid) { db.Entry(fnc_Course_Cost_Sks).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { Class_Prog_Id = fnc_Course_Cost_Sks.Class_Prog_Id, Term_Year_Id = fnc_Course_Cost_Sks.Term_Year_Id })); } ViewBag.Term_Year_Name = db.Mstr_Term_Year.Where(ty => ty.Term_Year_Id == fnc_Course_Cost_Sks.Term_Year_Id).Select(ty => ty.Term_Year_Name).First(); return(View(fnc_Course_Cost_Sks)); }
// GET: CourseCostSks/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Fnc_Course_Cost_Sks fnc_Course_Cost_Sks = db.Fnc_Course_Cost_Sks.Find(id); if (fnc_Course_Cost_Sks == null) { return(HttpNotFound()); } ViewBag.Term_Year_Name = db.Mstr_Term_Year.Where(ty => ty.Term_Year_Id == fnc_Course_Cost_Sks.Term_Year_Id).Select(ty => ty.Term_Year_Name).First(); return(View(fnc_Course_Cost_Sks)); }
public ActionResult Create([Bind(Include = "Course_Cost_Sks_Id,Term_Year_Id,Department_Id,Class_Prog_Id,Entry_Year_Id,Amount_Per_Sks,Created_By,Created_Date,Modified_By,Modified_Date")] Fnc_Course_Cost_Sks fnc_Course_Cost_Sks, string SAmount) { fnc_Course_Cost_Sks.Amount_Per_Sks = (int)decimal.Parse(Regex.Replace(SAmount, @"[^\d.]", "")); if (ModelState.IsValid) { db.Fnc_Course_Cost_Sks.Add(fnc_Course_Cost_Sks); db.SaveChanges(); return(RedirectToAction("Index", new { Class_Prog_Id = fnc_Course_Cost_Sks.Class_Prog_Id, Term_Year_Id = fnc_Course_Cost_Sks.Term_Year_Id })); } ViewBag.Departments = db.Mstr_Department_Class_Program.Where(d => d.Class_Prog_Id == fnc_Course_Cost_Sks.Class_Prog_Id).OrderBy(d => d.Mstr_Department.Department_Code).ToList(); ViewBag.Entry_Years = db.Mstr_Entry_Year.OrderByDescending(ey => ey.Entry_Year_Id).ToList(); ViewBag.Class_Prog = db.Mstr_Class_Program.Where(cp => cp.Class_Prog_Id == fnc_Course_Cost_Sks.Class_Prog_Id).First(); ViewBag.Term_Year = db.Mstr_Term_Year.Where(ty => ty.Term_Year_Id == fnc_Course_Cost_Sks.Term_Year_Id).First(); return(View(fnc_Course_Cost_Sks)); }