Exemplo n.º 1
0
        public GetGenderResponse GetGender()
        {
            GetGenderResponse response = new GetGenderResponse();

            try

            {
                var gender = helperClass.GetAllGender();
                if (gender == null)
                {
                    return(response = new GetGenderResponse
                    {
                        StatusCode = 201,
                        Data = null,
                    });;
                }
                return(response = new GetGenderResponse
                {
                    StatusCode = 200,
                    Data = gender,
                });
            }
            catch (Exception e)
            {
                return(response = new GetGenderResponse
                {
                    StatusCode = 201,
                    Data = null,
                });;
            }
        }
        public GetGenderResponse GetGender(GetGenderRequest request)
        {
            var response = new GetGenderResponse();

            try
            {
                response.GenderList = ModelTranslator.Translate(BLL.Gender.GetGender());
                response.Success    = true;
            }
            catch (Exception ex)
            {
                response.Success      = false;
                response.ErrorMessage = ex.ToString();
                response.Errors       = ErrorCodes.Invalid;
            }

            return(response);
        }