Пример #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;
            }
        }
Пример #2
0
 public FlowerViewModel(IFlowersService flowerService, Flower model)
 {
     _flowerService = flowerService;
     Model = model;
 }
Пример #3
0
 public Task<bool> Save(Flower flower)
 {
     return null;
 }