public ActionResult DeleteConfirmed(HR_KEWANGAN8 pegawai)
        {
            pegawai = db.HR_KEWANGAN8.SingleOrDefault(s => s.HR_KOD_KEW8 == pegawai.HR_KOD_KEW8);

            db.HR_KEWANGAN8.Remove(pegawai);
            db.SaveChanges();
            return(RedirectToAction("SenaraiPerubahan"));
        }
 public ActionResult EditPendapatanPegawai([Bind(Include = "HR_KOD_KEW8,HR_PENERANGAN,HR_SINGKATAN,HR_PENYATA_IND,HR_GAJI_IND")] HR_KEWANGAN8 pegawai)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pegawai).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("SenaraiPerubahan"));
     }
     return(View(pegawai));
 }
        public ActionResult PadamPendapatanPegawai(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HR_KEWANGAN8 pegawai = db.HR_KEWANGAN8.Find(id);

            if (pegawai == null)
            {
                return(HttpNotFound());
            }

            return(PartialView("_PadamPendapatanPegawai", pegawai));
        }
        public ActionResult TambahPendapatanPegawai([Bind(Include = "HR_KOD_KEW8,HR_PENERANGAN,HR_SINGKATAN,HR_PENYATA_IND,HR_GAJI_IND")] HR_KEWANGAN8 pegawai)
        {
            if (ModelState.IsValid)
            {
                var SelectLastID = db.HR_KEWANGAN8.OrderByDescending(s => s.HR_KOD_KEW8).FirstOrDefault().HR_KOD_KEW8;
                var LastID       = new string(SelectLastID.SkipWhile(x => x == '0').ToArray());
                var Increment    = Convert.ToSingle(LastID) + 1;
                var KodPegawai   = Convert.ToString(Increment).PadLeft(5, '0');
                pegawai.HR_KOD_KEW8 = KodPegawai;

                db.HR_KEWANGAN8.Add(pegawai);
                db.SaveChanges();
                return(RedirectToAction("SenaraiPerubahan"));
            }

            return(View(pegawai));
        }