Ejemplo n.º 1
0
        public bool GrabarVentaReposicion(VentaReposicionPost oVentaReposicionPost, ref string rMsg)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_RESULTADO",          DbType.Int64,  ParameterDirection.Output),
                new DAABRequest.Parameter("P_REPO_DOC_SAP",       DbType.String,                         20,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_NRO_CONT",      DbType.String,                         20,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_NRO_PED",       DbType.String,                         20,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_TIP_OFI",       DbType.String,                          2,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_OFICINA",       DbType.String,                          4,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_COD_VEN",       DbType.String,                         10,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_TIP_DOC_CLIEN", DbType.String,                          2,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_NRO_DOC",       DbType.String,                         16,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_NRO_TELEF",     DbType.String,                         15,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_NOM_CLIEN",     DbType.String,                         80,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_APE_CLIEN",     DbType.String,                         80,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_REP_LEGAL",     DbType.String,                         80,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_RAZ_SOCIAL",    DbType.String,                         80,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_TIP_VENTA",     DbType.String,                          2,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_TIP_OPER",      DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_SERIE",         DbType.String,                         18,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_COD_MAT",       DbType.String,                         10,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_COD_CAMP",      DbType.String,                          3,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_LIST_PREC",     DbType.String,                          3,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_PLAN_TARIF",    DbType.String,                          4,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_COSTO",         DbType.Double, ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_USUARIO",       DbType.String,                         20,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_DEPAC_CODIGO",  DbType.String,                          2,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_PROVC_CODIGO",  DbType.String,                          3,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_DISTC_CODIGO",  DbType.String,                          4,ParameterDirection.Input),
                new DAABRequest.Parameter("P_REPO_EST_REPOS",     DbType.String,                          2,ParameterDirection.Input)
            };
            int i = 0;

            for (i = 0; i < arrParam.Length; i++)
            {
                arrParam[i].Value = DBNull.Value;
            }

            i = 1; arrParam[i].Value = oVentaReposicionPost.repo_doc_sap;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_nro_cont;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_nro_ped;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_tip_ofi;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_oficina;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_cod_ven;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_tip_doc_clien;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_nro_doc;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_nro_telef;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_nom_clien;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_ape_clien;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_rep_legal;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_raz_social;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_tip_venta;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_tip_oper;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_serie;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_cod_mat;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_cod_camp;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_list_prec;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_plan_tarif;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_costo;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_usuario;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_depac_codigo;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_provc_codigo;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_distc_codigo;
            i++; arrParam[i].Value = oVentaReposicionPost.repo_est_repos;

            bool salida = false;

            BDSISACT    obj       = new BDSISACT(BaseDatos.BD_SISACT);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.PKG_SISACT_VENTA_EXPRESS + ".SP_INSERT_VENTA_REPO_POST";
            obRequest.Parameters.AddRange(arrParam);
            obRequest.Transactional = true;
            try
            {
                obRequest.Factory.ExecuteNonQuery(ref obRequest);
                obRequest.Factory.CommitTransaction();
                salida = true;
            }
            catch (Exception ex)
            {
                obRequest.Factory.RollBackTransaction();
                rMsg = "Error al Insertar la venta reposición. \nMensaje : " + ex.Message;
                throw ex;
            }
            finally
            {
                obRequest.Factory.Dispose();
            }
            return(salida);
        }
        public bool GrabarVentaReposicion(VentaReposicionPost oVentaReposicionPost, ref string rMsg)
        {
            ChipRepuestoPostpagoDatos obj = new ChipRepuestoPostpagoDatos();

            return(obj.GrabarVentaReposicion(oVentaReposicionPost, ref rMsg));
        }