public IResultadoOperaciones <Person> Create([FromForm] Person Person) { foreach (var item in HttpContext.Request.Form.Files) { var PathPhoto = Person.passport + Path.GetExtension(item.FileName); Person.photo = PathPhoto; IResultadoOperaciones <Person> result = _PersonServices.Create(Person); if (result == null) { return(BasicOperationResult <Person> .Fail(result.Message)); } var filePath = "Documentos"; if (item.Length > 0) { using (var stream = new FileStream(Path.Combine(Environment.CurrentDirectory, filePath, PathPhoto), FileMode.Create)) { item.CopyToAsync(stream); stream.Close(); } } return(result); } return(BasicOperationResult <Person> .Fail("No estan todos los datos disponibles")); }
public IResultadoOperaciones <Person> Create(Person entity) { IResultadoOperaciones <Person> result = _PersonDB.Create(entity); if (result == null) { return(BasicOperationResult <Person> .Fail(result.Message)); } return(result); }
public IResultadoOperaciones <Person> Update(Person Persons) { IResultadoOperaciones <Person> result = _PersonServices.Update(Persons); if (result == null) { return(BasicOperationResult <Person> .Fail(result.Message)); } return(result); }
public IResultadoOperaciones <Person> Remove([FromQuery] int PersonId) { IResultadoOperaciones <Person> result = _PersonServices.Remove(PersonId); if (result == null) { return(BasicOperationResult <Person> .Fail(result.Message)); } return(result); }
public IResultadoOperaciones <Request> Remove([FromQuery] int RequestId) { IResultadoOperaciones <Request> result = _RequestServices.Remove(RequestId); if (result == null) { return(BasicOperationResult <Request> .Fail(result.Message)); } return(result); }
public IResultadoOperaciones <Request> Create(Request entity) { IResultadoOperaciones <Request> result = _requestDB.Create(entity); if (result == null) { return(BasicOperationResult <Request> .Fail(result.Message)); } return(result); }
public IResultadoOperaciones <Person> Remove(int Id) { Person PersonDeleted = _PersonDB.Find(ps => ps.Id == Id); if (PersonDeleted != null) { IResultadoOperaciones <Person> deleted = _PersonDB.Delete(PersonDeleted, "Persona eliminado Correctamente"); return(deleted); } return(null); }
public IResultadoOperaciones <Request> Update(int RequestId) { Request RequestUpdate = _RequestServices.GetAll().ToList().Find(x => x.Id == RequestId); IResultadoOperaciones <Request> result = _RequestServices.Update(RequestUpdate); if (result == null) { return(BasicOperationResult <Request> .Fail(result.Message)); } return(result); }
public IResultadoOperaciones <Request> Remove(int Id) { Request RequestDeleted = _requestDB.Find(ps => ps.Id == Id); if (RequestDeleted != null) { IResultadoOperaciones <Request> deleted = _requestDB.Delete(RequestDeleted, "Solicitud eliminado Correctamente"); return(deleted); } return(null); }
public IResultadoOperaciones <Request> Create([FromBody] Request Request) { Request.statusId = 1; Request.creationDate = DateTime.Now; IResultadoOperaciones <Request> result = _RequestServices.Create(Request); if (result == null) { return(BasicOperationResult <Request> .Fail(result.Message)); } return(result); }
public IResultadoOperaciones <Person> Update(Person entity) { IResultadoOperaciones <Person> Updated = _PersonDB.Update(entity, "Persona Actualizado Correctamente"); return(Updated); }
public IResultadoOperaciones <Request> Update(Request entity) { IResultadoOperaciones <Request> Updated = _requestDB.Delete(entity, "Persona Actualizado Correctamente"); return(Updated); }