예제 #1
0
파일: Bussines.cs 프로젝트: jhondiaz/Poraka
		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;

			}
		}
예제 #2
0
파일: Bussines.cs 프로젝트: jhondiaz/Poraka
		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);
			}

		
		
		}
예제 #3
0
파일: Bussines.cs 프로젝트: jhondiaz/Poraka
		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;
			}
		}
예제 #4
0
파일: Bussines.cs 프로젝트: jhondiaz/Poraka
		public async void SetLikeProductById (string id)
		{

			try {

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

				}


			} catch (Exception) {

				return;
			}
		}
예제 #5
0
파일: Bussines.cs 프로젝트: jhondiaz/Poraka
		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;
			}
		}
예제 #6
0
파일: Bussines.cs 프로젝트: jhondiaz/Poraka
		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);
			}


		}