Ejemplo n.º 1
0
        public int SaveAsk(string token, string id, AskForUserDelyveryM askForUserDelyveryM, ref string description)
        {
            IRestResponse response = null;
            string        content  = null;

            try
            {
                string      strJsonAsk = JsonConvert.SerializeObject(askForUserDelyveryM);
                RestClient  client     = new RestClient(Config.BaseReqvesteUrl);
                RestRequest request    = new RestRequest("Mobile/Save/Ansver", Method.POST);
                request.AddHeader("Accept", "application/json");
                client.Timeout = 60000;
                request.AddParameter("token", token);
                request.AddParameter("idVe", id);
                request.AddParameter("jsonStrAsk", Compress(strJsonAsk));
                request.AddParameter("type", 5);
                response = client.Execute(request);
                content  = response.Content;
            }
            catch (Exception)
            {
                return(4);
            }
            if (content == "" || response.StatusCode == System.Net.HttpStatusCode.NotFound)
            {
                return(4);
            }
            else
            {
                return(GetData(content, ref description));
            }
        }
Ejemplo n.º 2
0
        public void SaveAskForUserDelyveryInDb(string idShiping, AskForUserDelyveryM askForUserDelyveryM)
        {
            Shipping shipping = context.Shipping.Where(v => v.Id == idShiping).FirstOrDefault();

            shipping.askForUserDelyveryM = askForUserDelyveryM;
            context.SaveChanges();
        }
Ejemplo n.º 3
0
 public async Task SaveAsk(string id, int type, string jsonStrAsk)
 {
     if (type == 1)
     {
         Ask ask = JsonConvert.DeserializeObject <Ask>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskInDb(id, ask);
     }
     else if (type == 2)
     {
         Ask1 ask1 = JsonConvert.DeserializeObject <Ask1>(jsonStrAsk);
         sqlCommandApiMobile.SaveAsk1InDb(id, ask1);
     }
     else if (type == 3)
     {
         AskFromUser askFromUser = JsonConvert.DeserializeObject <AskFromUser>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskFromUserInDb(id, askFromUser);
     }
     else if (type == 4)
     {
         AskDelyvery askDelyvery = JsonConvert.DeserializeObject <AskDelyvery>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskDelyveryInDb(id, askDelyvery);
     }
     else if (type == 5)
     {
         AskForUserDelyveryM askForUserDelyveryM = JsonConvert.DeserializeObject <AskForUserDelyveryM>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskForUserDelyveryInDb(id, askForUserDelyveryM);
     }
     else if (type == 6)
     {
         Ask2 ask2 = JsonConvert.DeserializeObject <Ask2>(jsonStrAsk);
         sqlCommandApiMobile.SaveAsk2InDb(id, ask2);
     }
     else if (type == 7)
     {
         List <Photo> photo = JsonConvert.DeserializeObject <List <Photo> >(jsonStrAsk);
         sqlCommandApiMobile.SavePhotoinTruckInDb(id, photo);
     }
     else if (type == 8)
     {
         List <Photo> photo = JsonConvert.DeserializeObject <List <Photo> >(jsonStrAsk);
         sqlCommandApiMobile.SavePhotoStrapInDb(id, photo);
     }
 }