public void UpdateStatus(int IDOrdemServico, OrdemServicoStatusEnum Status) { OrdemServicoEN ordemServicoEN = _repositoryOrdemServico.GetByID(IDOrdemServico); ordemServicoEN.Status = Status; _repositoryOrdemServico.Edit(ordemServicoEN); _unitOfWork.Commit(); }
public int Save(int IDOrdemServico, int IDCompany, int IDUser, DateTime DataServico, string HorarioServico, OrdemServicoStatusEnum Status, int IDEmpresa, int IDResp, int IDLocal, string NomeContato, string Telefone, string WhatsApp, bool OSExpress) { OrdemServicoEN ordemServicoEN = _repositoryOrdemServico.GetByID(IDOrdemServico); if (ordemServicoEN != null) { ordemServicoEN.UpdateProperties ( IDCompany, IDUser, DataServico, HorarioServico, Status, IDEmpresa, IDResp, IDLocal, NomeContato, Telefone, WhatsApp, OSExpress ); _repositoryOrdemServico.Edit(ordemServicoEN); } else { ordemServicoEN = new OrdemServicoEN ( IDCompany, IDUser, DataServico, HorarioServico, Status, IDEmpresa, IDResp, IDLocal, NomeContato, Telefone, WhatsApp, OSExpress ); ordemServicoEN.DataCadastro = DateTime.Now.ToLocalTime(); _repositoryOrdemServico.Save(ordemServicoEN); } _unitOfWork.Commit(); return(ordemServicoEN.IDOrdemServico); }