public ActionResult TambahMatrik(HR_MATRIKS_GAJI model) { ViewBag.HR_PERINGKAT = new SelectList(db.HR_JADUAL_GAJI.AsEnumerable().Where(s => s.HR_GRED_GAJI == model.HR_GRED_GAJI).Select(s => new { HR_PERINGKAT = Convert.ToInt16(s.HR_PERINGKAT.Substring(1, 1)) }).ToList(), "HR_PERINGKAT", "HR_PERINGKAT"); ViewBag.HR_GRED_GAJI = new SelectList(db2.GE_PARAMTABLE.Where(s => s.GROUPID == 109), "SHORT_DESCRIPTION", "SHORT_DESCRIPTION"); ViewBag.gred = model.HR_GRED_GAJI; return(PartialView("_TambahMatrik")); }
public JsonResult GenerateMatrik(HR_MATRIKS_GAJI model) { try { ge.Z_INSERT_MATRIKS_GAJI_IND_TEST(model.HR_GRED_GAJI, model.HR_GAJI_POKOK, new ObjectParameter("pi_BEZA", typeof(int)), model.HR_TAHAP, model.HR_KOD_GAJI, model.HR_PERINGKAT, new ObjectParameter("tAHAPMAX", typeof(int)));//PEGANGDATADARIDZATUL return(Json(new { msg = "Data berjaya dimasukkan", gred = model.HR_GRED_GAJI, error = false }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { msg = "Data tidak berjaya dimasukkan", gred = model.HR_GRED_GAJI, error = true }, JsonRequestBehavior.AllowGet)); } }
public ActionResult MatrikInfo(string id, string value, int?kod, decimal?exp, decimal?min, string jenis) { if (id == null && kod == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HR_MATRIKS_GAJI matrik = db.HR_MATRIKS_GAJI.FirstOrDefault(s => s.HR_SISTEM_SARAAN == id && s.HR_GRED_GAJI == value && s.HR_PERINGKAT == kod && s.HR_TAHAP == exp && s.HR_GAJI_MIN == min); if (matrik == null) { return(HttpNotFound()); } return(PartialView("_GajiList" + jenis, matrik)); }
public JsonResult DeleteConfirmed(HR_MATRIKS_GAJI matrik) { try { String[] arr = Convert.ToString(matrik.HR_TAHAP).Split('.'); decimal n = Convert.ToDecimal(arr[0]); List <HR_MATRIKS_GAJI> mat = db.HR_MATRIKS_GAJI.Where(s => s.HR_SISTEM_SARAAN == matrik.HR_SISTEM_SARAAN && s.HR_GRED_GAJI == matrik.HR_GRED_GAJI && s.HR_PERINGKAT == matrik.HR_PERINGKAT && (s.HR_TAHAP >= n && s.HR_TAHAP < (n + 1))).ToList(); db.HR_MATRIKS_GAJI.RemoveRange(mat); db.SaveChanges(); return(Json(new { msg = "Data berjaya dipadam", gred = matrik.HR_GRED_GAJI, error = false }, JsonRequestBehavior.AllowGet)); } catch { return(Json(new { msg = "Data tidak berjaya dipadam", gred = matrik.HR_GRED_GAJI, error = true }, JsonRequestBehavior.AllowGet)); } }
public JsonResult EditMatrik(HR_MATRIKS_GAJI matrik) { try { String[] arr = Convert.ToString(matrik.HR_TAHAP).Split('.'); decimal n = Convert.ToDecimal(arr[0]); List <HR_MATRIKS_GAJI> mat = db.HR_MATRIKS_GAJI.Where(s => s.HR_SISTEM_SARAAN == matrik.HR_SISTEM_SARAAN && s.HR_GRED_GAJI == matrik.HR_GRED_GAJI && s.HR_PERINGKAT == matrik.HR_PERINGKAT && (s.HR_TAHAP >= n && s.HR_TAHAP < (n + 1))).ToList(); db.HR_MATRIKS_GAJI.RemoveRange(mat); db.SaveChanges(); ge.Z_INSERT_MATRIKS_GAJI_IND_TEST(matrik.HR_GRED_GAJI, matrik.HR_GAJI_POKOK, new ObjectParameter("pi_BEZA", typeof(int)), n, matrik.HR_KOD_GAJI, matrik.HR_PERINGKAT, new ObjectParameter("tAHAPMAX", typeof(int))); return(Json(new { msg = "Data berjaya dikemaskini", gred = matrik.HR_GRED_GAJI, error = false }, JsonRequestBehavior.AllowGet)); } catch { return(Json(new { msg = "Data tidak berjaya dikemaskini", gred = matrik.HR_GRED_GAJI, error = true }, JsonRequestBehavior.AllowGet)); } }