Exemplo n.º 1
0
        public TicketObject(TicketObject item)
        {
            this.Id          = item.Id;
            this.Contract    = item.Contract;
            this.CreatedDate = item.CreatedDate;
            this.IsStatus    = item.IsStatus;
            switch (item.IsStatus)
            {
            case 1:
                this.TicketStatus = "New";
                break;

            case 2:
                this.TicketStatus = "Confirmed";
                break;

            case 3:
                this.TicketStatus = "Deliveried";
                break;

            case 4:
                this.TicketStatus = "Paid";
                break;

            case 5:
                this.TicketStatus = "Finish";
                break;
            }
        }
Exemplo n.º 2
0
        public async Task SaveTicketObjectAsync(TicketObject item, bool isNewItem = false)
        {
            try
            {
                var json    = JsonConvert.SerializeObject(item);
                var content = new StringContent(json, Encoding.UTF8, "application/json");

                HttpResponseMessage response = null;
                if (isNewItem)
                {
                    response = await client.PostAsync(new Uri(string.Format(Constants.TicketObjectInsert, String.Empty)), content);
                }
                else
                {
                    response = await client.PutAsync(new Uri(string.Format(Constants.TicketObjectUpdate, String.Empty)), content);
                }

                if (response.IsSuccessStatusCode)
                {
                    Debug.WriteLine(@"Item successfully saved.");
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(@"ERROR {0}", ex.Message);
            }
        }
Exemplo n.º 3
0
        void OnAddItemClicked(object sender, EventArgs e)
        {
            var ticket = new TicketObject();
            //var OnlineProduct = new OnlineProduct () {
            //	Id = Guid.NewGuid ().ToString ()
            //};
            var todoPage = new TicketDetailListPage(0);

            todoPage.BindingContext = ticket;
            Navigation.PushAsync(todoPage);
        }
Exemplo n.º 4
0
 public Task SaveTicketObjectTaskAsync(TicketObject item, bool isNewItem = false)
 {
     return(restService.SaveTicketObjectAsync(item, isNewItem));
 }