public ShoplistViewModel(Shoplist s) { Id = s.Id; Name = s.Name; Description = s.Description; LocationId = s.LocationId; AddedUserId = s.AddedUserId; }
public ShoplistViewModel(Shoplist shops) { if (shops != null) { Id = shops.Id; Name = shops.Name; Store = shops.Store; AddedUserId = shops.AddedUserId; Description = shops.Description; } }
public ShoplistViewModel(Shoplist shop) { Shopitems = new List <Shopitem>(); if (shop != null) { ID = shop.Id; Name = shop.Name; Store = shop.Store; Description = shop.Description; CreatedUserId = shop.CreatedUserId; } }
public bool Delete(Guid id) { try { HttpResponseMessage resp = client.DeleteAsync(UrlHelper.ShopList_Url + @"/DeleteShopList/" + id).Result; Shoplist t = JsonConvert.DeserializeObject <Shoplist>(resp.Content.ReadAsStringAsync().Result); return(true); } catch { return(false); } }
public async Task <IHttpActionResult> DeleteShopList(Guid id) { Shoplist storage = _shoplistRepository.GetSingle(e => e.Id == id); if (storage == null) { return(NotFound()); } await _shoplistRepository.DeleteAsync(storage); return(Ok(storage)); }
public bool Edit(Guid id, Shoplist data) { var content = new FormUrlEncodedContent(new[] { new KeyValuePair <string, string>("Name", data.Name.ToString()), new KeyValuePair <string, string>("Description", data.Description.ToString()), new KeyValuePair <string, string>("LocationId", data.LocationId.ToString()), new KeyValuePair <string, string>("AddedUserId", data.CreatedUserId.ToString()), }); try { HttpResponseMessage resp = client.PutAsync(UrlHelper.ShopList_Url + @"/PutShopList/" + id, content).Result; Shoplist t = JsonConvert.DeserializeObject <Shoplist>(resp.Content.ReadAsStringAsync().Result); return(true); } catch { return(false); } }