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); }
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); }
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); }
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); }
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); }
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); }
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); }
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; }
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); }
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); }