public ActionResult onRowUpdating(ConfigInfomation item) { ConfigInfomation row = new ConfigInfomation().GetByID(item.Config_id); row.Config_Field = item.Config_Field; row.Config_Title = item.Config_Title; row.Config_Value = item.Config_Value; row.Update(); return(JsonMax(new { result = "Success" })); }
/// <summary> /// Returns the app config /// </summary> /// <param name="args">no relvant</param> /// <param name="result">returned value - if success or not </param> /// <returns></returns> public string Execute(string[] args, out bool result) { try { ConfigInfomation info = ConfigInfomation.Instance; result = true; return(info.ToJson()); } catch (Exception) { result = false; return("Couldn't get the config information"); } }
public ActionResult onRowRemoving(ConfigInfomation item) { ConfigInfomation location = new ConfigInfomation().GetByID(item.Config_id); try { location.DeleteByID(); return(JsonMax(new { result = "Success" })); } catch (Exception ex) { return(JsonMax(new { result = "NG", data = ex.ToString() })); ; throw ex; } }
/// <summary> /// Close the relevant handler /// </summary> /// <param name="args">contain path to handler</param> /// <param name="result">returned value</param> /// <returns></returns> public string Execute(string[] args, out bool result) { try { string path = args[0]; ConfigInfomation info = ConfigInfomation.Instance; info.RemoveHandlers(path); CommandRecievedEventArgs e = new CommandRecievedEventArgs((int)CommandEnum.CloseCommand, null, path); CloseHandlerEvent?.Invoke(this, e); result = true; return(path); } catch (Exception) { result = false; return("Couldn't get the config information"); } }
public ActionResult onRowInserting(ConfigInfomation item) { int id = item.Insert(); return(JsonMax(new { result = "Success", data = id })); }