public ActionResult Create(MASTER_REFERENCES references) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("MASTER_REFERENCES"); var datenow = MixHelper.ConvertDateNow(); var fname = "REF_ID, REF_TYPE, REF_CODE, REF_NAME, REF_CREATE_BY, REF_CREATE_DATE, REF_STATUS, REF_LOG_CODE"; var fvalue = "'" + lastid + "', " + "'2', " + "'" + references.REF_CODE + "', " + "'" + references.REF_NAME + "'," + "'" + UserId + "', " + datenow + "," + "'1'," + "'" + logcode + "'"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_REFERENCES (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Edit(int id = 0) { MASTER_REFERENCES referenceData = db.MASTER_REFERENCES.Find(id); if (referenceData == null) { return(HttpNotFound()); } return(View(referenceData)); }