Ejemplo n.º 1
0
 public IActionResult LogsAdd(object datas)
 {
     try
     {
         var data = JsonConvert.DeserializeObject <Dictionary <string, string> >(datas.ToString());
         LogsServices.Log(data["page"], "", 2);
         return(Ok(ResponseHandler.ResponseMessageHandler(200, "Success")));
     }
     catch (Exception ex)
     {
         LogsServices.Log("Logs - Add", ex.Message.ToString(), 3);
         return(Ok(ResponseHandler.ResponseMessageHandler(400, "Error")));
     }
 }
 public IActionResult Get(object datas)
 {
     try
     {
         var            CityId   = JsonConvert.DeserializeObject <Dictionary <string, int> >(datas.ToString());
         CountyServices countyDb = new CountyServices();
         var            countys  = countyDb.Where(x => x.CityId == CityId["CityId"]).OrderBy(x => x.Name).Select(x => new { id = x.Id, Name = x.Name }).ToList();
         return(Ok(ResponseHandler.ResponseMessageHandler(200, "Success", countys)));
     }
     catch (Exception ex)
     {
         LogsServices.Log("County - Get", ex.Message.ToString(), 3);
         return(Ok(ResponseHandler.ResponseMessageHandler(400, "Error")));
     }
 }