Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(HR_KADAR_PERBATUAN kadar)
        {
            kadar = db.HR_KADAR_PERBATUAN.SingleOrDefault(s => s.HR_KELAS == kadar.HR_KELAS && s.HR_KM_MULA == kadar.HR_KM_MULA);

            db.HR_KADAR_PERBATUAN.Remove(kadar);
            db.SaveChanges();
            return(RedirectToAction("SenaraiKadarTuntutan"));
        }
Exemplo n.º 2
0
        public ActionResult EditElaunPerjalanan([Bind(Include = "HR_KELAS,HR_KM_MULA,HR_KM_AKHIR,HR_NILAI,HR_AKTIF_IND")] HR_KADAR_PERBATUAN kadar)
        {
            if (ModelState.IsValid)
            {
                db.Entry(kadar).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("SenaraiKadarTuntutan"));
            }

            return(View(kadar));
        }
Exemplo n.º 3
0
        public ActionResult TambahElaunPerjalanan([Bind(Include = "HR_KELAS,HR_KM_MULA,HR_KM_AKHIR,HR_NILAI,HR_AKTIF_IND")] HR_KADAR_PERBATUAN kadar)
        {
            if (ModelState.IsValid)
            {
                List <HR_KADAR_PERBATUAN> selectPerjalanan = db.HR_KADAR_PERBATUAN.Where(s => s.HR_KELAS == kadar.HR_KELAS && s.HR_KM_MULA == kadar.HR_KM_MULA).ToList();
                if (selectPerjalanan.Count() <= 0)
                {
                    db.HR_KADAR_PERBATUAN.Add(kadar);
                    db.SaveChanges();
                }
                return(RedirectToAction("SenaraiKadarTuntutan"));
            }

            return(View(kadar));
        }
Exemplo n.º 4
0
        public ActionResult PadamElaunPerjalanan(string kelas, decimal?mula)
        {
            if (kelas == null || mula == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            HR_KADAR_PERBATUAN kadar = db.HR_KADAR_PERBATUAN.SingleOrDefault(s => s.HR_KELAS == kelas && s.HR_KM_MULA == mula);


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

            return(PartialView("_PadamElaunPerjalanan", kadar));
        }