public ActionResult Edit(int id = 0) { SYS_CONFIG config = db.SYS_CONFIG.Find(id); if (config == null) { return(HttpNotFound()); } return(View(config)); }
public OperationResult Insert(SYS_CONFIGModel model) { var entity = new SYS_CONFIG { ID = model.ID, ConfigName = model.ConfigName, ConfigContent = model.ConfigContent, FieldProperty = model.FieldProperty, IsSystem = model.IsSystem, }; SYS_CONFIGRepository.Insert(entity); return(new OperationResult(OperationResultType.Success, "Added successfully")); }
public ActionResult Edit(SYS_CONFIG config) { var UserId = Session["USER_ID"]; var datenow = MixHelper.ConvertDateNow(); var logcode = config.CONFIG_LOG_CODE; var fupdate = "CONFIG_NAME = '" + config.CONFIG_NAME + "'," + "CONFIG_VALUE = '" + config.CONFIG_VALUE + "'," + "CONFIG_UPDATE_BY = '" + UserId + "'," + "CONFIG_UPDATE_DATE = " + datenow; db.Database.ExecuteSqlCommand("UPDATE SYS_CONFIG SET " + fupdate + " WHERE CONFIG_ID = " + config.CONFIG_ID); String objek = fupdate.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public JsonResult actionEdit() { try { var id = Request.Form.GetValues("id").FirstOrDefault(); var value = Request.Form.GetValues("value").FirstOrDefault(); if (!string.IsNullOrWhiteSpace(id)) { string ID = id.ToString(); string VALUE = string.IsNullOrWhiteSpace(value)? "" : value.ToString(); SYS_CONFIG item = DA_Config.Instance.GetById(ID); item.Value = VALUE; return(Json(DA_Config.Instance.Update(item) > 0 ? true : false)); } return(Json(false)); } catch (Exception ex) { return(Json(false)); } }