public HttpResponseMessage Post(MemberDTO member)
        {
            MemberBL memberBL = new MemberBL();
            ResponseFormat <bool> response = new ResponseFormat <bool>();

            response.Data = memberBL.Create(member);
            if (response.Data)
            {
                response.Message = "Member Created";
                response.Success = true;
                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
            else
            {
                response.Message = "There Was Some Error";
                response.Success = false;
                return(Request.CreateResponse(HttpStatusCode.BadRequest, response));
            }
        }
Exemple #2
0
        public HttpResponseMessage Post(AddMemberModel model)
        {
            MemberBL  memberBL = new MemberBL();
            MemberDTO member   = model.member;

            member.Image = saveImage(model.image, model.name);
            ResponseFormat <bool> response = new ResponseFormat <bool>();

            response.Data = memberBL.Create(member);
            if (response.Data)
            {
                response.Message = "Member Created";
                response.Success = true;
                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
            else
            {
                response.Message = "There Was Some Error";
                response.Success = false;
                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
        }