Пример #1
0
        public string DeletarLote_X_Servicos(TRegistro_Lote_X_Servicos val)
        {
            System.Collections.Hashtable hs = new System.Collections.Hashtable(3);
            hs.Add("@P_ID_LOTE", val.Id_lote);
            hs.Add("@P_ID_OS", val.Id_os);
            hs.Add("@P_CD_EMPRESA", val.Cd_empresa);

            return(this.executarProc("EXCLUI_OSE_LOTE_X_SERVICO", hs));
        }
Пример #2
0
        public TList_Lote_X_Servicos Select(TpBusca[] vBusca, int vTop, string vNM_Campo)
        {
            TList_Lote_X_Servicos lista = new TList_Lote_X_Servicos();
            bool podeFecharBco          = false;

            if (Banco_Dados == null)
            {
                this.CriarBanco_Dados(false);
                podeFecharBco = true;
            }
            SqlDataReader reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo));

            try
            {
                while (reader.Read())
                {
                    TRegistro_Lote_X_Servicos reg = new TRegistro_Lote_X_Servicos();
                    if (!reader.IsDBNull(reader.GetOrdinal("ID_LOte")))
                    {
                        reg.Id_lote = reader.GetDecimal(reader.GetOrdinal("ID_LOte"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("ID_OS")))
                    {
                        reg.Id_os = reader.GetDecimal(reader.GetOrdinal("ID_OS"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("CD_Empresa")))
                    {
                        reg.Cd_empresa = reader.GetString(reader.GetOrdinal("CD_Empresa"));
                    }

                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    this.deletarBanco_Dados();
                }
            }
            return(lista);
        }