public ActionResult DeleteConfirmed(HR_SUBJEK temuduga) { temuduga = db.HR_SUBJEK.SingleOrDefault(s => s.HR_KOD_SUBJEK == temuduga.HR_KOD_SUBJEK); db.HR_SUBJEK.Remove(temuduga); db.SaveChanges(); return(RedirectToAction("SenaraiTemuduga")); }
public ActionResult EditTemuduga([Bind(Include = "HR_KOD_JENIS,HR_KOD_SUBJEK,HR_SUBJEK1,HR_MARKAH")] HR_SUBJEK temuduga) { if (ModelState.IsValid) { db.HR_SUBJEK.RemoveRange(db.HR_SUBJEK.Where(s => s.HR_KOD_SUBJEK == temuduga.HR_KOD_SUBJEK)); db.HR_SUBJEK.Add(temuduga); //db.Entry(temuduga).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("SenaraiTemuduga")); } return(View(temuduga)); }
public ActionResult EditTemuduga(string jenis, short?kod) { if (jenis == null || kod == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HR_SUBJEK temuduga = db.HR_SUBJEK.SingleOrDefault(s => s.HR_KOD_JENIS == jenis && s.HR_KOD_SUBJEK == kod); if (temuduga == null) { return(HttpNotFound()); } ViewBag.HR_KOD_JENIS = new SelectList(db2.GE_PARAMTABLE.Where(s => s.GROUPID == 122), "ORDINAL", "SHORT_DESCRIPTION"); return(PartialView("_EditTemuduga", temuduga)); }
public ActionResult TambahTemuduga([Bind(Include = "HR_KOD_JENIS,HR_KOD_SUBJEK,HR_SUBJEK1,HR_MARKAH")] HR_SUBJEK temuduga) { if (ModelState.IsValid) { List <HR_SUBJEK> selectTemuduga = db.HR_SUBJEK.Where(s => s.HR_KOD_JENIS == temuduga.HR_KOD_JENIS && s.HR_KOD_SUBJEK == temuduga.HR_KOD_SUBJEK).ToList(); if (selectTemuduga.Count() <= 0) { var SelectLastID = db.HR_SUBJEK.OrderByDescending(s => s.HR_KOD_SUBJEK).FirstOrDefault().HR_KOD_SUBJEK; var Increment = SelectLastID + 1; temuduga.HR_KOD_SUBJEK = Convert.ToInt16(Increment); db.HR_SUBJEK.Add(temuduga); db.SaveChanges(); } return(RedirectToAction("SenaraiTemuduga")); } return(View(temuduga)); }