Exemple #1
0
        public ApiResponse ListAll()
        {
            EmployeeStatusProcessor = new EmployeeStatusProcessor();
            Response = new ApiResponse();

            try
            {
                EmployeeStatusProcessor.Find();
                Response.text   = JsonConverter.JsonConverter.ObjToJson(EmployeeStatusProcessor.Find());
                Response.result = true;

                return(Response);
            }
            catch
            {
                Response.text   = "Unfortunately something went wrong :(";
                Response.result = false;

                return(Response);
            }
        }
Exemple #2
0
        public ApiResponse FindByPK(long id)
        {
            EmployeeStatusProcessor = new EmployeeStatusProcessor();
            Response = new ApiResponse();

            try
            {
                EmployeeStatusProcessor.Find(id);
                Response.text   = "Account with this PK has been found" + Environment.NewLine + JsonConverter.JsonConverter.ObjToJson(EmployeeStatusProcessor.Find(id));
                Response.result = true;

                return(Response);
            }
            catch
            {
                Response.text   = "An account with this id does not exist";
                Response.result = false;

                return(Response);
            }
        }