예제 #1
0
        private async void RestoreClientAsync(ClientName job)
        {
            bool result = await RecoverClientWarning();

            if (!result)
            {
                if (job.Name != null)
                {
                    job.IsSoftDeleted = false;
                    ClientList.Remove(job);
                }
                else
                {
                    job.IsSoftDeleted = false;
                    EstimateList.Remove(job);
                }

                database.Update(job);

                //start
                RefreshList();

                SearchBarVisible();
                ESearchBarVisible();

                if (ClientList.Count == 3)
                {
                    SearchText = "";
                    SearchTextChanged();
                }
                else
                {
                    SearchTextChanged();
                }

                if (EstimateList.Count == 3)
                {
                    ESearchText = "";
                    SearchETextChanged();
                }
                else
                {
                    SearchETextChanged();
                }
                //finish
            }
        }
예제 #2
0
        //finish

        private async void RemoveClientAsync(ClientName job)
        {
            bool result = await DeleteClientWarning();

            if (!result)
            {
                if (job.Name != null)
                {
                    ClientList.Remove(job);
                }
                else
                {
                    EstimateList.Remove(job);
                }

                database.Table <ClientName>().Delete(x => x.Id == job.Id);

                database.Update(job);

                //start
                RefreshList();

                SearchBarVisible();
                ESearchBarVisible();

                if (ClientList.Count == 3)
                {
                    SearchText = "";
                    SearchTextChanged();
                }
                else
                {
                    SearchTextChanged();
                }

                if (EstimateList.Count == 3)
                {
                    ESearchText = "";
                    SearchETextChanged();
                }
                else
                {
                    SearchETextChanged();
                }
                //finish
            }
        }
예제 #3
0
        public async void RemoveClient(ClientName client)
        {
            bool result = await DeleteClientWarning();

            if (!result)
            {
                if (client.Name != null)
                {
                    ClientList.Remove(client);
                }
                else
                {
                    EstimateList.Remove(client);
                }

                client.IsSoftDeleted = true;

                database.Update(client);

                RefreshList();

                SearchBarVisible();
                ESearchBarVisible();

                if (ClientList.Count == 3)
                {
                    SearchText = "";
                    SearchTextChanged();
                }
                else
                {
                    SearchTextChanged();
                }

                if (EstimateList.Count == 3)
                {
                    ESearchText = "";
                    SearchETextChanged();
                }
                else
                {
                    SearchETextChanged();
                }
            }
        }
예제 #4
0
        public void OkEstimate()
        {
            ErrorCleanup();

            if (CheckEstimateEntry())
            {
                clientName = new ClientName
                {
                    EstimateName = NewClient.EstimateName
                };

                AllList.Add(clientName);
                database.Insert(clientName);
                EstimateList.Add(clientName);

                ItIsVisible = false;

                Navigation.PushAsync(new EditPage(clientName.Id, "client"));
            }
        }
 internal static EstimateList getEstimateList(HttpResponseMessage responce)
 {
     var estimateList = new EstimateList();
     var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(responce.Content.ReadAsStringAsync().Result);
     if (jsonObj.ContainsKey("estimates"))
     {
         var estimatesArray = JsonConvert.DeserializeObject<List<object>>(jsonObj["estimates"].ToString());
         foreach(var estimateObj in estimatesArray)
         {
             var estimate = new Estimate();
             estimate = JsonConvert.DeserializeObject<Estimate>(estimateObj.ToString());
             estimateList.Add(estimate);
         }
     }
     if (jsonObj.ContainsKey("page_context"))
     {
         var pageContext = new PageContext();
         pageContext = JsonConvert.DeserializeObject<PageContext>(jsonObj["page_context"].ToString());
         estimateList.page_context = pageContext;
     }
     return estimateList;
 }
        internal static EstimateList getEstimateList(HttpResponseMessage responce)
        {
            var estimateList = new EstimateList();
            var jsonObj      = JsonConvert.DeserializeObject <Dictionary <string, object> >(responce.Content.ReadAsStringAsync().Result);

            if (jsonObj.ContainsKey("estimates"))
            {
                var estimatesArray = JsonConvert.DeserializeObject <List <object> >(jsonObj["estimates"].ToString());
                foreach (var estimateObj in estimatesArray)
                {
                    var estimate = new Estimate();
                    estimate = JsonConvert.DeserializeObject <Estimate>(estimateObj.ToString());
                    estimateList.Add(estimate);
                }
            }
            if (jsonObj.ContainsKey("page_context"))
            {
                var pageContext = new PageContext();
                pageContext = JsonConvert.DeserializeObject <PageContext>(jsonObj["page_context"].ToString());
                estimateList.page_context = pageContext;
            }
            return(estimateList);
        }
 public async Task<EstimateList.response> EstimateList(EstimateList.request request, CancellationToken? token = null)
 {
     return await SendAsync<EstimateList.response>(request.ToXmlString(), token.GetValueOrDefault(CancellationToken.None));
 }