Ejemplo n.º 1
0
        public async Task<bool> Save(Flower flower)
        {
            using (var client = new HttpClient())
            {
                var url = string.Format(
                    RequestUrl,
                    WebConstants.AuthenticationKey,
                    WebConstants.AuthenticationId,
                    WebConstants.ActionKey,
                    WebConstants.ActionSave,
                    DateTime.Now.Ticks);

                var json = JsonConvert.SerializeObject(flower);

                var content = new FormUrlEncodedContent(
                    new[]
                    {
                        new KeyValuePair<string, string>("flower", json)
                    });

                var response = await client.PostAsync(url, content);
                return response.StatusCode == System.Net.HttpStatusCode.OK;
            }
        }
Ejemplo n.º 2
0
 public FlowerViewModel(IFlowersService flowerService, Flower model)
 {
     _flowerService = flowerService;
     Model = model;
 }
Ejemplo n.º 3
0
 public Task<bool> Save(Flower flower)
 {
     return null;
 }