/*SEARCH*/ public async Task <dynamic> Search(String _CarId) { URL = URL + "\\" + URLPage; dynamic MyCar = new ExpandoObject(); MyCar.Process = "LoadCarsProfile"; MyCar.CarID = _CarId; var RecordJSon = Coders_Parsing.ExpandoObject_ToJsonString(MyCar); String RecieveJSon = await MyRestAPI.ExecuteHttpWebRequest(URL, RecordJSon); try { MyCar = Coders_Parsing.JsonString_ToExpandoObject(RecieveJSon); if (((String)MyCar.Record.CarID).Trim() != "") { MyCar.Status = "Record_Found"; } else { MyCar.Status = "No_Record_Found"; } } catch { MyCar.Status = RecieveJSon; } return(MyCar); }
/*SAVE*/ public async Task <String> Update(dynamic MyCar) { String _Status = ""; URL = URL + "\\" + URLPage; var RecordJSon = Coders_Parsing.ExpandoObject_ToJsonString(MyCar); String RecieveJSon = await MyRestAPI.ExecuteHttpWebRequest(URL, RecordJSon); try { MyCar = Coders_Parsing.JsonString_ToExpandoObject(RecieveJSon); _Status = MyCar.Status; } catch { _Status = RecieveJSon; } return(_Status); }
/*LOAD CAR DATA*/ public async Task <dynamic> LoadCarList() { URL = URL + "\\" + URLPage; dynamic MyCar = new ExpandoObject(); MyCar.Process = "LoadCarList"; var RecordJSon = Coders_Parsing.ExpandoObject_ToJsonString(MyCar); String RecieveJSon = await MyRestAPI.ExecuteHttpWebRequest(URL, RecordJSon); try { MyCar = Coders_Parsing.JsonString_ToExpandoObject(RecieveJSon); } catch { MyCar.Status = RecieveJSon; } return(MyCar); }
/*DELETE CAR*/ public async Task <dynamic> Delete(String _CarID) { URL = URL + "\\" + URLPage; dynamic MyCar = new ExpandoObject(); MyCar.Process = "RemoveCarsProfile"; MyCar.CarID = _CarID; var RecordJSon = Coders_Parsing.ExpandoObject_ToJsonString(MyCar); String RecieveJSon = await MyRestAPI.ExecuteHttpWebRequest(URL, RecordJSon); try { MyCar = Coders_Parsing.JsonString_ToExpandoObject(RecieveJSon); } catch { MyCar.RecordCountDeleted = "0"; MyCar.Status = RecieveJSon; } return(MyCar); }