public ActionResult DeleteConfirmed(HR_TINDAKAN tindakan) { tindakan = db.HR_TINDAKAN.SingleOrDefault(s => s.HR_KOD_TINDAKAN == tindakan.HR_KOD_TINDAKAN); db.HR_TINDAKAN.Remove(tindakan); db.SaveChanges(); return(RedirectToAction("SenaraiJenis")); }
public ActionResult EditTindakanDisiplin([Bind(Include = " HR_KOD_TINDAKAN, HR_PENERANGAN, HR_SINGKATAN")] HR_TINDAKAN tindakan) { if (ModelState.IsValid) { db.Entry(tindakan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("SenaraiJenis")); } return(View(tindakan)); }
public ActionResult PadamTindakanDisiplin(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HR_TINDAKAN tindakan = db.HR_TINDAKAN.Find(id); if (tindakan == null) { return(HttpNotFound()); } ViewBag.HR_TINDAKAN = db.HR_TINDAKAN.ToList(); return(PartialView("_PadamTindakanDisiplin", tindakan)); }
public ActionResult TambahTindakanDisiplin([Bind(Include = " HR_KOD_TINDAKAN, HR_PENERANGAN, HR_SINGKATAN")] HR_TINDAKAN tindakan) { if (ModelState.IsValid) { var SelectLastID = db.HR_TINDAKAN.OrderByDescending(s => s.HR_KOD_TINDAKAN).FirstOrDefault().HR_KOD_TINDAKAN; var LastID = new string(SelectLastID.SkipWhile(x => x == '0').ToArray()); var Increment = Convert.ToSingle(LastID) + 1; var KodTindakan = Convert.ToString(Increment).PadLeft(5, '0'); tindakan.HR_KOD_TINDAKAN = KodTindakan; db.HR_TINDAKAN.Add(tindakan); db.SaveChanges(); return(RedirectToAction("SenaraiJenis")); } return(View(tindakan)); }