Exemple #1
0
        public void UpdateStatus(int IDOrdemServico, OrdemServicoStatusEnum Status)
        {
            OrdemServicoEN ordemServicoEN = _repositoryOrdemServico.GetByID(IDOrdemServico);

            ordemServicoEN.Status = Status;

            _repositoryOrdemServico.Edit(ordemServicoEN);

            _unitOfWork.Commit();
        }
Exemple #2
0
        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);
        }