private WSEditorial parseModelWS(Editorial editorial) { WSEditorial wSEditorial = new WSEditorial(); wSEditorial.nombre = editorial.Nombre; return(wSEditorial); }
private Editorial parseWSEditorialToEditorial(WSEditorial editorial) { Editorial aux = new Editorial(); aux.Nombre = editorial.Nombre; return(aux); }
private Editorial parseWSModel(WSEditorial WSEditorial) { Editorial editorial = new Editorial(); editorial.Nombre = WSEditorial.nombre; return(editorial); }
public WSEditorial GetById(int codEditorial) { Editorial editorial = eS.getById(codEditorial); WSEditorial wsEditorial = new WSEditorial(); wsEditorial = parseModelWS(editorial); return(wsEditorial); }
public List <WSEditorial> GetAll() { IList <Editorial> editoriales = eS.getAll(); List <WSEditorial> WSeditoriales = new List <WSEditorial>(); WSEditorial wsEditorial = null; foreach (Editorial ed in editoriales) { wsEditorial = parseModelWS(ed); WSeditoriales.Add(wsEditorial); } return(WSeditoriales); }
public List <WSEditorial> getAll() { IList <Editorial> listaEditoriales = eS.getAll(); List <WSEditorial> listaWSEditoriales = new List <WSEditorial>(); WSEditorial wsEditorial = new WSEditorial(); foreach (var editorial in listaEditoriales) { editorial.CodEditorial = wsEditorial.Codigo; editorial.Nombre = wsEditorial.Nombre; listaWSEditoriales.Add(wsEditorial); } return(listaWSEditoriales); }
public string update(WSEditorial editorial) { string resultado = ""; if (eS.getById(editorial.Codigo) != null) { eS.update(parseWSEditorialToEditorial(editorial)); resultado = "La Editorial se ha actualizado correctamente"; } else { resultado = "No se ha encontrado la Editorial"; } return(resultado); }
public string create(WSEditorial editorial) { string resultado = ""; if (eS.getById(editorial.Codigo) == null) { eS.create(parseWSEditorialToEditorial(editorial)); resultado = "Editorial creado"; } else { resultado = "No se ha podido crear la Editorial"; } return(resultado); }
public WSEditorial getEditorialById(int idEditorial) { WSEditorial wsEditorial = new WSEditorial(); Editorial editAux = eS.getById(idEditorial); if (editAux == null) { wsEditorial.ErrorMessage = "La Editorial no existe"; throw new Exception(); } else { wsEditorial.Nombre = editAux.Nombre; } return(wsEditorial); }
public string Update(WSEditorial WSEditorial) { Editorial editorial = parseWSModel(WSEditorial); string response = null; Editorial editorialDV = eS.update(editorial); if (editorialDV != null) { response = "Se ha modificado correctamente"; } else { response = "no se ha creado correctamente"; } return(response); }
public string Create(WSEditorial WSEditorial) { Editorial editorial = parseWSModel(WSEditorial); Editorial editorialDv = eS.create(editorial); string response = null; if (editorialDv != null) { response = "Se ha creado correctamente"; } else { response = "No se ha creado"; } return(response); }