public static ResultEntry CreateErrorEntry(string ErrorMessage) { ResultEntry result = new ResultEntry(); result.state = false; result.message = ErrorMessage; result.value = ""; return(result); }
public static ResultEntry CreateSuccessEntry(string Value) { ResultEntry result = new ResultEntry(); result.state = true; result.message = ""; result.value = Value; return(result); }
public ResultEntry ReadFile(string value) { ResultEntry result = ResultEntry.CreateSuccessEntry(""); //调用service层的功能方法 JsonDataFileController controller = new JsonDataFileController(); if (controller.IsFileExist(value) == false) { return(result.UpdateState(false, controller.DisplayError_FileNotExsit(value))); } if (controller.ReadFileValue(value) == false) { return(result.UpdateState(false, controller.DisplayError_FileReadError(value))); } result.UpdateResult(controller.Result); controller.Release(); return(result); }
public ResultEntry ConnectTest() { ResultEntry result = ResultEntry.CreateSuccessEntry("this is test"); return(result); }