// [System.Web.Http.HttpPost]
        public IHttpActionResult POST(Client_SignupDto clientSignUpDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var clientSignUp = Mapper.Map <Client_SignupDto, Client_Signup>(clientSignUpDto);

            context.Client_Signup.Add(clientSignUp);
            context.SaveChanges();
            return(Created(new Uri(Request.RequestUri + "/" + clientSignUp.Client_ID), clientSignUpDto));
        }
        public Image_GalleryDto CreateBookmark(Image_GalleryDto a)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var abc = Mapper.Map <Image_GalleryDto, Image_Gallary>(a);

            context.Image_Gallary.Add(abc);
            context.SaveChanges();
            return(a);
        }
        public Image_TypeDto CreateImage_Type(Image_TypeDto image_TypeDto)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var img = Mapper.Map <Image_TypeDto, Image_Type>(image_TypeDto);

            context.Image_Type.Add(img);
            context.SaveChanges();
            return(image_TypeDto);
        }
        public ScoreboardDto CreateScoreboard(ScoreboardDto a)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var Scoreboard = Mapper.Map <ScoreboardDto, Scoreboard>(a);

            context.Scoreboards.Add(Scoreboard);
            context.SaveChanges();
            return(a);
        }
        public Company_Service_LocationDto CreateCompany_Service_Location(Company_Service_LocationDto a)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var abc = Mapper.Map <Company_Service_LocationDto, Company_Service_Location>(a);

            context.Company_Service_Location.Add(abc);
            context.SaveChanges();
            return(a);
        }
Exemplo n.º 6
0
        public BookmarkDto CreateBookmark(BookmarkDto a)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var abc = Mapper.Map <BookmarkDto, Bookmark>(a);

            context.Bookmarks.Add(abc);
            context.SaveChanges();
            return(a);
        }
        public Admin_SignupDto CreateAdmin_Signup(Admin_SignupDto adminDto)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var admin = Mapper.Map <Admin_SignupDto, Admin_Signup>(adminDto);

            context.Admin_Signup.Add(admin);
            context.SaveChanges();
            return(adminDto);
        }
Exemplo n.º 8
0
        public ActivityDto CreateActivity(ActivityDto a)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var abc = Mapper.Map <ActivityDto, Activity>(a);

            context.Activities.Add(abc);
            context.SaveChanges();
            return(a);
        }
Exemplo n.º 9
0
        // [System.Web.Http.HttpPost]
        public Client_SignupDto POST(Client_SignupDto clientSignUpDto)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var clientSignUp = Mapper.Map <Client_SignupDto, Client_Signup>(clientSignUpDto);

            context.Client_Signup.Add(clientSignUp);
            context.SaveChanges();
            return(clientSignUpDto);
        }
        public LocationDto CreateLocation(LocationDto locationDto)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var update = Mapper.Map <LocationDto, Location>(locationDto);

            context.Locations.Add(update);
            context.SaveChanges();
            return(locationDto);
        }
        public IHttpActionResult POST(Registration_CompanyDto registration_CompanyDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var registrationCompany = Mapper.Map <Registration_CompanyDto, Registration_Company>(registration_CompanyDto);

            context.Registration_Company.Add(registrationCompany);
            context.SaveChanges();

            registration_CompanyDto.Company_ID = registrationCompany.Company_ID;
            return(Created(new Uri(Request.RequestUri + "/" + registrationCompany.Company_ID), registration_CompanyDto));
        }