예제 #1
0
 public IHttpActionResult Put(int id, Dto.Photo photo)
 {
     photo.ValidateNotNullParameter("photo");
     RestStatus status;
     Dto.Photo dto = this.StoreService.EditPhoto(id, photo.Description, out status);
     return RestfulPut(status, dto);
 }
예제 #2
0
 public IHttpActionResult Post(Dto.Photo photo)
 {
     photo.ValidateNotNullParameter("photo");
     RestStatus status;
     Dto.Photo dto = this.StoreService.CreatePhoto(photo.Description, photo.Url, out status);
     string location = String.Format("{0}/{1}", this.Request.RequestUri, photo.Id);
     return RestfulPost(status, location, dto);
 }
예제 #3
0
 public IHttpActionResult Put(Dto.Store store)
 {
     store.ValidateNotNullParameter("store");
     RestStatus status;
     Dto.Store dto = this.StoreService.EditStore(new WeekSchedule(store.Hours), store.PhoneNumber, store.StreetAddress, store.City, store.State, store.Zip,
     store.Directions, store.Email, store.FacebookUrl, store.TwitterUrl, store.GooglePlusUrl, store.InstagramUrl,
     store.PinterestUrl, store.YoutubeUrl, store.Home, store.About, store.Contact, out status);
     return RestfulPut(status, dto);
 }
예제 #4
0
 public IHttpActionResult Post(Dto.Department department)
 {
     department.ValidateNotNullParameter("department");
     RestStatus status;
     Dto.Department dto = this.EditService.CreateDepartment(department.Name, department.Description, department.ImageUrl, out status);
     string location = String.Format("{0}/{1}", this.Request.RequestUri, department.Id);
     return RestfulPost(status, location, dto);
 }
예제 #5
0
 public IHttpActionResult Put(int id, Dto.Department department)
 {
     department.ValidateNotNullParameter("department");
     RestStatus status;
     Dto.Department dto = this.EditService.EditDepartment(id, department.Name, department.Description, department.ImageUrl, out status);
     return RestfulPut(status, dto);
 }
예제 #6
0
 public IHttpActionResult Put(int id, Dto.Product product)
 {
     product.ValidateNotNullParameter("product");
     RestStatus status;
     Dto.Product dto = this.EditService.EditProduct(id, product.CategoryId, product.Name, product.Description, GetPrice(product), product.ImageUrl, out status);
     return RestfulPut(status, dto);
 }
예제 #7
0
 public IHttpActionResult Post(Dto.Product product)
 {
     product.ValidateNotNullParameter("product");
     RestStatus status;
     Dto.Product dto = this.EditService.CreateProduct(product.CategoryId, product.Name, product.Description, GetPrice(product), product.ImageUrl, out status);
     string location = String.Format("{0}/{1}", this.Request.RequestUri, product.Id);
     return RestfulPost(status, location, dto);
 }
예제 #8
0
 private static Price GetPrice(Dto.Product product)
 {
     product.ValidateNotNullParameter("product");
     Price price = product.ExactPrice.HasValue ? new Price(product.ExactPrice.Value) : new Price(product.FromPrice ?? 0, product.ToPrice ?? 0);
     return price;
 }
예제 #9
0
 public IHttpActionResult Post(Dto.Category category)
 {
     category.ValidateNotNullParameter("category");
     RestStatus status;
     Dto.Category dto = this.EditService.CreateCategory(category.DepartmentId, category.Name, category.Description, category.ImageUrl, out status);
     string location = String.Format("{0}/{1}", this.Request.RequestUri, category.Id);
     return RestfulPost(status, location, dto);
 }
예제 #10
0
 public IHttpActionResult Put(int id, Dto.Category category)
 {
     category.ValidateNotNullParameter("category");
     RestStatus status;
     Dto.Category dto = this.EditService.EditCategory(id, category.DepartmentId, category.Name, category.Description, category.ImageUrl, out status);
     return RestfulPut(status, dto);
 }