コード例 #1
0
 public void AddInvoice(OrdemServicoDTO dto)
 {
     dao.AddInvoice(dto);
 }
コード例 #2
0
        public OrdemServicoDTO ObterPorPK(OrdemServicoDTO dto)
        {
            try
            {
                ComandText = "stp_AUTO_ORDEM_SERVICO_OBTERPORPK";
                AddParameter("@OS_ID", dto.WorkOrderID);

                MySqlDataReader dr = ExecuteReader();
                dto = new OrdemServicoDTO();
                if (dr.Read())
                {
                    dto.WorkOrderID              = int.Parse(dr[0].ToString());
                    dto.DocumentID               = int.Parse(dr[1].ToString());
                    dto.SerieID                  = int.Parse(dr[2].ToString() == string.Empty ? "-1" : dr[2].ToString());
                    dto.OsType                   = int.Parse(dr[3].ToString());
                    dto.Reference                = dr[4].ToString();
                    dto.DocumentNumber           = dr[5].ToString();
                    dto.DocumentStatus           = int.Parse(dr[6].ToString());
                    dto.TechnicianID             = int.Parse(dr[37].ToString() == string.Empty ? "-1" : dr[37].ToString());
                    dto.VehicleID                = int.Parse(dr[8].ToString());
                    dto.InitialKM                = decimal.Parse(dr[9].ToString());
                    dto.OsStatus                 = int.Parse(dr[10].ToString());
                    dto.BookingUser              = dr[11].ToString();
                    dto.BookingDate              = dr[12].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[12].ToString());
                    dto.CheckInTechnicianID      = int.Parse(dr[38].ToString() == string.Empty ? "-1" :  dr[38].ToString());
                    dto.CheckInDate              = dr[14].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[14].ToString());
                    dto.DriverPerson             = dr[15].ToString();
                    dto.DriverContact            = dr[16].ToString();
                    dto.OsBeginDate              = dr[17].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[17].ToString());
                    dto.OsEndDate                = dr[18].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[18].ToString());
                    dto.CheckOutTechnicianID     = int.Parse(dr[39].ToString() == string.Empty ? "-1" : dr[39].ToString());
                    dto.CheckOutDate             = dr[20].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[20].ToString());
                    dto.FreeNotes                = dr[21].ToString();
                    dto.Actived                  = dr[22].ToString() == "1" ? true : false;
                    dto.CreatedBy                = dr[23].ToString();
                    dto.CreatedDate              = dr[24].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[24].ToString());
                    dto.UpdatedBy                = dr[25].ToString();
                    dto.UpdatedDate              = dr[26].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[26].ToString());
                    dto.Filial                   = dr[27].ToString();
                    dto.PredictionClosing        = dr[28].ToString() == string.Empty ? DateTime.MinValue : DateTime.Parse(dr[28].ToString());
                    dto.BillingEntityID          = int.Parse(dr[30].ToString());
                    dto.WorkOrderTechnicianName  = dr[32].ToString(); // NOME DO TECNICO RESPONSAVEL
                    dto.BillingEntityDesignation = dr[33].ToString(); // NOME DO CLIENTE A FACTURAR
                    dto.CheckInTechnicianName    = dr[34].ToString(); // NOME DO RECEPCIONISTA
                    dto.CheckOutTechnicianName   = dr[35].ToString(); // NOME DO RESPONSÁVEL PELA SAÍDA
                    dto.DesignacaoEntidade       = dr[36].ToString(); // NOME DO PROPRIETARIO
                }
            }
            catch (Exception ex)
            {
                dto.MensagemErro = ex.Message.Replace("'", string.Empty);
            }
            finally
            {
                FecharConexao();
                if (dto.WorkOrderID > 0)
                {
                    var _oDetail = new OrderDetailDTO();
                    _oDetail.OrderID      = dto.WorkOrderID;
                    _oDetail.TechnicianID = -1;
                    dto.OrderDetailsList  = ObterDetalhesPorFiltro(_oDetail);
                    dto.CheckListOrder    = ObterCheckList(new CheckListDTO(dto.WorkOrderID));
                }
            }

            return(dto);
        }
コード例 #3
0
        public OrdemServicoDTO Excluir(OrdemServicoDTO dto)
        {
            dao.Excluir(dto);

            return(dto);
        }
コード例 #4
0
 public string CreateBooking(OrdemServicoDTO dto)
 {
     return(Save(dto).Item2);
 }
コード例 #5
0
 public List <OrdemServicoDTO> ObterPorFiltro(OrdemServicoDTO dto)
 {
     return(dao.ObterPorFiltro(dto));
 }
コード例 #6
0
 public OrdemServicoDTO ObterPorPK(OrdemServicoDTO dto)
 {
     dto         = dao.ObterPorPK(dto);
     dto.Veiculo = VeiculoRN.GetInstance().ObterPorPK(new VeiculoDTO(dto.VehicleID));
     return(dto);
 }
コード例 #7
0
 public void ExcluirOrdemServico(OrdemServicoDTO dto)
 {
     dao.Delete("tbl_os", dto, 0);
 }
コード例 #8
0
 public void AlterarOrdemServico(OrdemServicoDTO dto)
 {
     dao.Update("tbl_os", dto, 0);
 }
コード例 #9
0
 public void InserirOrdemServico(OrdemServicoDTO dto)
 {
     dao.Insert("tbl_os", dto);
 }