예제 #1
0
        public static ResultEntry CreateErrorEntry(string ErrorMessage)
        {
            ResultEntry result = new ResultEntry();

            result.state   = false;
            result.message = ErrorMessage;
            result.value   = "";
            return(result);
        }
예제 #2
0
        public static ResultEntry CreateSuccessEntry(string Value)
        {
            ResultEntry result = new ResultEntry();

            result.state   = true;
            result.message = "";
            result.value   = Value;
            return(result);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public ResultEntry ConnectTest()
        {
            ResultEntry result = ResultEntry.CreateSuccessEntry("this is test");

            return(result);
        }