public dynamic Get(string id)
 {
     var cop = new CoperativaRepository().Get(int.Parse(id));
     return Json(cop, new JsonSerializerSettings()
     {
         NullValueHandling = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Ignore
     });
 }
        public dynamic Get()
        {
            var ret1 = new CoperativaRepository().GetGrid();

            return Json(ret1, new JsonSerializerSettings()
            {
                NullValueHandling = NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });
        }
 public dynamic Post(Coperativa usua)
 {
     try
     {
         usua.DataCadastro = DateTime.Now;
         usua.Controles[0].DataContrato = DateTime.Now;
         var user = new CoperativaRepository().Post(usua);
         return Json(new { error = "" });
     }
     catch (Exception ex)
     {
         return Json(new { error = ex.Message });
     }
 }