Ejemplo n.º 1
0
        /*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);
        }
Ejemplo n.º 2
0
        public Car()
        {
            Coders_TextFile MyTextFile = new Coders_TextFile();
            String          FileName   = Environment.CurrentDirectory + "/Configure.ini";
            String          Configure  = MyTextFile.Load(FileName);
            //System.Windows.Forms.MessageBox.Show(Configure);
            dynamic ServerSetting = Coders_Parsing.JsonString_ToExpandoObject(Configure);

            URL = (String)ServerSetting.WebServer;
        }
Ejemplo n.º 3
0
        /*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);
        }
Ejemplo n.º 4
0
        /*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);
        }
Ejemplo n.º 5
0
        /*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);
        }