public async Task <string> InsertPlataforma(PlataformaDTO plataforma) { try { return(await _commonRepository.InsertObjeto(plataforma, new PlataformaDTO() { descripcion = plataforma.descripcion, idEstado = 1, numeroMaximoUsuarios = plataforma.numeroMaximoUsuarios, precio = plataforma.precio }, _context)); } catch (Exception ex) { Console.WriteLine(ex.Message); return(_commonRepository.ExceptionMessage(plataforma, "C")); } }
public async Task <string> DeletePlataforma(PlataformaDTO plataforma) { PlataformaDTO account = await GetPlataformabyId(plataforma.idPlataforma); try { return(await _commonRepository.DeleteLogicoObjeto(plataforma, new PlataformaDTO() { idPlataforma = account.idPlataforma, descripcion = plataforma.descripcion, idEstado = 2, numeroMaximoUsuarios = account.numeroMaximoUsuarios, precio = account.precio }, _context)); } catch (Exception ex) { Console.WriteLine(ex.Message); return(_commonRepository.ExceptionMessage(plataforma, "D")); } }
public async Task <string> UpdatePlataforma(PlataformaDTO plataforma) { PlataformaDTO account = await GetPlataformabyId(plataforma.idPlataforma); List <int> idPlataformasAgregar = new List <int>(); List <int> idPlataformasEliminar = new List <int>(); try { return(await _commonRepository.UpdateObjeto(plataforma, new PlataformaDTO() { idPlataforma = plataforma.idPlataforma, descripcion = account.descripcion, idEstado = plataforma.idEstado, numeroMaximoUsuarios = plataforma.numeroMaximoUsuarios, precio = account.precio }, _context)); } catch (Exception ex) { Console.WriteLine(ex.Message); return(_commonRepository.ExceptionMessage(plataforma, "U")); } }