Exemplo n.º 1
0
		public async Task<int> UpDateVendors (Vendors dato)
		{
			try {
				using (var Client = new  ApiClient ()) {

					var entity = JsonConvert.SerializeObject (dato);

					var Result = await Client.PostAsync ("Vendors/UpDateVendors", new StringContent (entity, UnicodeEncoding.UTF8, "application/json"));

					var ResultJson = Result.Content.ReadAsStringAsync ().Result;

					return JsonConvert.DeserializeObject<int> (ResultJson);

				}
			} catch (Exception) {

				throw;

			}
		}
Exemplo n.º 2
0
		public async Task<ResultLogin<Vendors>> LoginVendors (string email, string pwd)
		{
		
			try {
				using (var Client = new  ApiClient ()) {


					var Result = await Client.GetAsync ("Vendors/LoginVendors?email=" + email + "&pwd=" + pwd);

					var ResultJson = Result.Content.ReadAsStringAsync ().Result;

					var dato = JsonConvert.DeserializeObject<ResultLogin<Vendors>> (ResultJson);

					return dato;

				}
			} catch (Exception) {

				return null;//LoginVendors( email, pwd);
			}

		
		
		}
Exemplo n.º 3
0
		public async void SetConsultProduct (string id, string idp)
		{

			try {

				using (var Client = new  ApiClient ()) {

					await Client.GetAsync ("Clients/SetConsultProduct?id=" + id + "&idp=" + idp);

				}


			} catch (Exception) {

				return;
			}
		}
Exemplo n.º 4
0
		public async void SetLikeProductById (string id)
		{

			try {

				using (var Client = new  ApiClient ()) {
					
					await Client.GetAsync ("App/SetLikeProductById?id=" + id);

				}


			} catch (Exception) {

				return;
			}
		}
Exemplo n.º 5
0
		public async Task<List<Products>> GetProductByIdCategorys (string id)
		{

			try {

				using (var Client = new  ApiClient ()) {


					var Result = await Client.GetAsync ("App/GetProductByIdCategorys?id=" + id);

					var ResultJson = Result.Content.ReadAsStringAsync ().Result;

					var dato = JsonConvert.DeserializeObject<List<Products>> (ResultJson);

					return dato;

				}


			} catch (Exception) {

				return null;
			}
		}
Exemplo n.º 6
0
		public async Task <Vendors>GetUser (string email)
		{

			try {
				using (var Client = new  ApiClient ()) {


					var Result = await Client.GetAsync ("User/GetUser?email=" + email);

					var ResultJson = Result.Content.ReadAsStringAsync ().Result;

					var dato = JsonConvert.DeserializeObject<Vendors> (ResultJson);

					return dato;

				}
			} catch (Exception) {

				return null;//await GetUser (email);
			}


		}