コード例 #1
0
 public bool Insert_ImportaExcel(string empresaid, tb_co_Compras BE)
 {
     //return tablaDA.Insert_ImportaExcel(empresaid, BE);
     bool zreturn = tablaDA.Insert_ImportaExcel(empresaid, BE);
     Sql_Error = tablaDA.Sql_Error;
     return zreturn;
 }
コード例 #2
0
 public DataSet RenameCompra(string empresaid, tb_co_Compras BE)
 {
     //return tablaDA.RenameCompra(empresaid, BE);
     DataSet xreturn = tablaDA.RenameCompra(empresaid, BE);
     Sql_Error = tablaDA.Sql_Error;
     return xreturn;
 }
コード例 #3
0
 public bool Delete(string empresaid, tb_co_Compras BE)
 {
     //return tablaDA.Delete(empresaid, BE);
     bool zreturn = tablaDA.Delete(empresaid, BE);
     Sql_Error = tablaDA.Sql_Error;
     return zreturn;
 }
コード例 #4
0
 //public DataSet GetOne(string empresaid, tb_co_Compras BE)
 //{
 //    return tablaDA.GetOne(empresaid, BE);
 //}
 public DataSet GenPendienteNIAtoRCompra(string empresaid, tb_co_Compras BE)
 {
     //return tablaDA.GenPendienteNIAtoRCompra(empresaid, BE);
     DataSet xreturn = tablaDA.GenPendienteNIAtoRCompra(empresaid, BE);
     Sql_Error = tablaDA.Sql_Error;
     return xreturn;
 }
コード例 #5
0
        public bool DELETE_ImportaExcel(string empresaid, tb_co_Compras BE)
        {
            using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
            {
                using (SqlCommand cmd = new SqlCommand("gspTbCoCompras_DELETE_ImportaExcel", cnx))
                {
                    cmd.CommandTimeout = 0;
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add("@perianio", SqlDbType.Char, 4).Value = BE.perianio;
                    cmd.Parameters.Add("@perimes", SqlDbType.Char, 2).Value = BE.perimes;
                    cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                    cmd.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                    cmd.Parameters.Add("@diarioid", SqlDbType.Char, 4).Value = BE.diarioid;

                    try
                    {
                        cnx.Open();
                        if (cmd.ExecuteNonQuery() > 0)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    catch (Exception ex)
                    {
                        Sql_Error = ex.Message;
                        throw new Exception(ex.Message);
                    }
                }
            }
        }
コード例 #6
0
 public DataSet ReporteRegCompraResumen(string empresaid, tb_co_Compras BE)
 {
     DataSet zreturn = tablaDA.ReporteRegCompraResumen(empresaid, BE);
     //return tablaDA.ReporteRegCompraResumen(empresaid, BE);
     Sql_Error = tablaDA.Sql_Error;
     return zreturn;
 }
コード例 #7
0
 public DataSet ReporteRegCompraAnalitico(string empresaid, tb_co_Compras BE)
 {
     DataSet zreturn = tablaDA.ReporteRegCompraAnalitico(empresaid, BE);
     Sql_Error = tablaDA.Sql_Error;
     return zreturn;
 }
コード例 #8
0
        public bool Update(string empresaid, tb_co_Compras BE)
        {
            using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
            {
                using (SqlCommand cmd1 = new SqlCommand("gspTbCoCompras_UPDATE", cnx))
                {
                    cmd1.CommandTimeout = 0;
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.Add("@perianio", SqlDbType.Char, 4).Value = BE.perianio;
                    cmd1.Parameters.Add("@perimes", SqlDbType.Char, 2).Value = BE.perimes;
                    cmd1.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                    cmd1.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                    cmd1.Parameters.Add("@diarioid", SqlDbType.Char, 4).Value = BE.diarioid;
                    cmd1.Parameters.Add("@asiento", SqlDbType.Char, 6).Value = BE.asiento;
                    cmd1.Parameters.Add("@tipodoc", SqlDbType.Char, 2).Value = BE.tipodoc;
                    cmd1.Parameters.Add("@serdoc", SqlDbType.Char, 4).Value = BE.serdoc;
                    cmd1.Parameters.Add("@numdoc", SqlDbType.Char, 10).Value = BE.numdoc;
                    cmd1.Parameters.Add("@status", SqlDbType.Char, 1).Value = BE.status;
                    cmd1.Parameters.Add("@fechdoc", SqlDbType.DateTime).Value = BE.fechdoc;
                    cmd1.Parameters.Add("@ctacte", SqlDbType.Char, 7).Value = BE.ctacte;
                    cmd1.Parameters.Add("@ctactename", SqlDbType.VarChar, 70).Value = BE.ctactename;
                    cmd1.Parameters.Add("@direc", SqlDbType.VarChar, 70).Value = BE.direc;
                    cmd1.Parameters.Add("@ubige", SqlDbType.Char, 6).Value = BE.ubige;
                    cmd1.Parameters.Add("@tipdid", SqlDbType.Char, 1).Value = BE.tipdid;
                    cmd1.Parameters.Add("@nmruc", SqlDbType.Char, 11).Value = BE.nmruc;
                    cmd1.Parameters.Add("@tipref", SqlDbType.Char, 2).Value = BE.tipref;
                    cmd1.Parameters.Add("@serref", SqlDbType.Char, 4).Value = BE.serref;
                    cmd1.Parameters.Add("@numref", SqlDbType.Char, 10).Value = BE.numref;
                    cmd1.Parameters.Add("@fechref", SqlDbType.DateTime).Value = BE.fechref;
                    cmd1.Parameters.Add("@tipOp", SqlDbType.Char, 2).Value = BE.tipOp;
                    cmd1.Parameters.Add("@serOp", SqlDbType.Char, 4).Value = BE.serOp;
                    cmd1.Parameters.Add("@numOp", SqlDbType.Char, 10).Value = BE.numOp;
                    cmd1.Parameters.Add("@arrayguias", SqlDbType.VarChar, 80).Value = BE.arrayguias;
                    cmd1.Parameters.Add("@arrayfechasguia", SqlDbType.VarChar, 50).Value = BE.arrayfechasguia;
                    cmd1.Parameters.Add("@cencosid", SqlDbType.Char, 5).Value = BE.cencosid;
                    cmd1.Parameters.Add("@compradorid", SqlDbType.Char, 4).Value = BE.compradorid;
                    cmd1.Parameters.Add("@condcompraid", SqlDbType.Char, 4).Value = BE.condcompraid;
                    cmd1.Parameters.Add("@bruto", SqlDbType.Decimal).Value = BE.bruto;
                    cmd1.Parameters.Add("@dscto3", SqlDbType.Decimal).Value = BE.dscto3;
                    cmd1.Parameters.Add("@totdscto3", SqlDbType.Decimal).Value = BE.totdscto3;
                    cmd1.Parameters.Add("@transporte", SqlDbType.Decimal).Value = BE.transporte;
                    cmd1.Parameters.Add("@embalaje", SqlDbType.Decimal).Value = BE.embalaje;
                    cmd1.Parameters.Add("@otros", SqlDbType.Decimal).Value = BE.otros;
                    cmd1.Parameters.Add("@tipimptoid", SqlDbType.Char, 1).Value = BE.tipimptoid;
                    cmd1.Parameters.Add("@igv", SqlDbType.Decimal).Value = BE.igv;
                    cmd1.Parameters.Add("@incprec", SqlDbType.Bit).Value = BE.incprec;
                    cmd1.Parameters.Add("@impexo", SqlDbType.Decimal).Value = BE.impexo;
                    cmd1.Parameters.Add("@valorcompra1", SqlDbType.Decimal).Value = BE.valorcompra1;
                    cmd1.Parameters.Add("@igv1", SqlDbType.Decimal).Value = BE.igv1;
                    cmd1.Parameters.Add("@cargo", SqlDbType.Decimal).Value = BE.cargo;
                    cmd1.Parameters.Add("@preciocompra1", SqlDbType.Decimal).Value = BE.preciocompra1;
                    cmd1.Parameters.Add("@moneda", SqlDbType.Char, 1).Value = BE.moneda;
                    cmd1.Parameters.Add("@tipcamb", SqlDbType.Decimal).Value = BE.tipcamb;
                    cmd1.Parameters.Add("@codctadebe", SqlDbType.Char, 10).Value = BE.codctadebe;
                    cmd1.Parameters.Add("@tipoid", SqlDbType.Char, 2).Value = BE.tipoid;
                    cmd1.Parameters.Add("@glosa", SqlDbType.VarChar, 100).Value = BE.glosa;
                    cmd1.Parameters.Add("@totpzas", SqlDbType.Decimal).Value = BE.totpzas;
                    cmd1.Parameters.Add("@fechentrega", SqlDbType.DateTime).Value = BE.fechentrega;
                    cmd1.Parameters.Add("@fechpago", SqlDbType.DateTime).Value = BE.fechpago;
                    cmd1.Parameters.Add("@fechcancel", SqlDbType.DateTime).Value = BE.fechcancel;
                    cmd1.Parameters.Add("@modofactu", SqlDbType.Char, 1).Value = BE.modofactu;
                    cmd1.Parameters.Add("@items", SqlDbType.Decimal).Value = BE.items;
                    cmd1.Parameters.Add("@fechregistro", SqlDbType.DateTime).Value = BE.fechregistro;
                    cmd1.Parameters.Add("@vinculante", SqlDbType.Char, 1).Value = BE.vinculante;
                    cmd1.Parameters.Add("@origen", SqlDbType.Char, 2).Value = BE.origen;
                    cmd1.Parameters.Add("@afecdetraccion", SqlDbType.Bit).Value = BE.afecdetraccion;
                    cmd1.Parameters.Add("@nconstdetrac", SqlDbType.Char, 10).Value = BE.nconstdetrac;
                    cmd1.Parameters.Add("@fechconstdetrac", SqlDbType.DateTime).Value = BE.fechconstdetrac;
                    cmd1.Parameters.Add("@detraccionid", SqlDbType.Char, 5).Value = BE.detraccionid;
                    cmd1.Parameters.Add("@porcdetraccion", SqlDbType.Decimal).Value = BE.porcdetraccion;
                    cmd1.Parameters.Add("@bnctadetraccion", SqlDbType.VarChar, 40).Value = BE.bnctadetraccion;
                    cmd1.Parameters.Add("@afectretencion", SqlDbType.Bit).Value = BE.afectretencion;
                    cmd1.Parameters.Add("@afecpercepcion", SqlDbType.Bit).Value = BE.afecpercepcion;
                    cmd1.Parameters.Add("@serdocpercepcion", SqlDbType.Char, 4).Value = BE.serdocpercepcion;
                    cmd1.Parameters.Add("@numdocpercepcion", SqlDbType.Char, 10).Value = BE.numdocpercepcion;
                    cmd1.Parameters.Add("@percepcionid", SqlDbType.Char, 2).Value = BE.percepcionid;
                    cmd1.Parameters.Add("@afectoigvid", SqlDbType.Bit).Value = BE.afectoigvid;
                    cmd1.Parameters.Add("@aduanaid", SqlDbType.Char, 3).Value = BE.aduanaid;
                    cmd1.Parameters.Add("@aniodua", SqlDbType.Char, 4).Value = BE.aniodua;
                    cmd1.Parameters.Add("@numdua", SqlDbType.Char, 10).Value = BE.numdua;
                    cmd1.Parameters.Add("@fechembdua", SqlDbType.DateTime).Value = BE.fechembdua;
                    cmd1.Parameters.Add("@fechreguldua", SqlDbType.DateTime).Value = BE.fechreguldua;
                    cmd1.Parameters.Add("@valorfobdua", SqlDbType.Decimal).Value = BE.valorfobdua;
                    cmd1.Parameters.Add("@tipoexportid", SqlDbType.Char, 2).Value = BE.tipoexportid;
                    cmd1.Parameters.Add("@valor2", SqlDbType.Decimal).Value = BE.valor2;
                    cmd1.Parameters.Add("@dscto2", SqlDbType.Decimal).Value = BE.dscto2;
                    cmd1.Parameters.Add("@impexo2", SqlDbType.Decimal).Value = BE.impexo2;
                    cmd1.Parameters.Add("@valorcompra2", SqlDbType.Decimal).Value = BE.valorcompra2;
                    cmd1.Parameters.Add("@igv2", SqlDbType.Decimal).Value = BE.igv2;
                    cmd1.Parameters.Add("@preciocompra2", SqlDbType.Decimal).Value = BE.preciocompra2;
                    cmd1.Parameters.Add("@tipersona", SqlDbType.Char, 2).Value = BE.tipersona;
                    cmd1.Parameters.Add("@usuar", SqlDbType.Char, 15).Value = BE.usuar;

                    cmd1.Parameters.Add("@XML", SqlDbType.Xml).Value = BE.GetItemXML();

                    try
                    {
                        cnx.Open();
                        if (cmd1.ExecuteNonQuery() > 0)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    catch (Exception ex)
                    {
                        Sql_Error = ex.Message;
                        throw new Exception(ex.Message);
                    }
                }
            }
        }
コード例 #9
0
 public DataSet ReporteRegCompraResumen01(string empresaid, tb_co_Compras BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd1 = new SqlCommand("gspTbCoMovimientos_ReporteRegCompraResumenProveedor01", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd1.CommandTimeout = 0;
                 cmd1.CommandType = CommandType.StoredProcedure;
                 if (BE.fechaini == "")
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = BE.fechaini; }
                 //cmd1.Parameters.Add("@fechaini", SqlDbType.DateTime).Value = BE.fechaini;
                 if (BE.fechafin == "")
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = BE.fechafin; }
                 //cmd1.Parameters.Add("@fechafin", SqlDbType.DateTime).Value = BE.fechafin;
                 cmd1.Parameters.AddWithValue("@Almacen", string.IsNullOrEmpty(BE.almacen) ? (object)DBNull.Value : BE.almacen);
                 cmd1.Parameters.AddWithValue("@tipdoc", string.IsNullOrEmpty(BE.tipodoc) ? (object)DBNull.Value : BE.tipodoc);
                 cmd1.Parameters.AddWithValue("@nmruc", string.IsNullOrEmpty(BE.nmruc) ? (object)DBNull.Value : BE.nmruc);
                 cmd1.Parameters.Add("@moneda", SqlDbType.Char, 1).Value = BE.moneda;
                 cmd1.Parameters.Add("@TipoResumen", SqlDbType.Int).Value = BE.resumen;
                 cmd1.Parameters.AddWithValue("@rubroid", string.IsNullOrEmpty(BE.rubroid) ? (object)DBNull.Value : BE.rubroid);
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd1))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 Sql_Error = ex.Message;
                 throw new Exception(ex.Message);
             }
         }
     }
 }
コード例 #10
0
 public DataSet ReporteRegistroCompraDetracciones(string empresaid, tb_co_Compras BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd1 = new SqlCommand("gspTbCoMovimientos_ReporteRegistroCompraDetracciones", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd1.CommandTimeout = 0;
                 cmd1.CommandType = CommandType.StoredProcedure;
                 cmd1.Parameters.Add("@perianio", SqlDbType.Char, 4).Value = BE.perianio;
                 if (BE.fechaini == "")
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = BE.fechaini; }
                 if (BE.fechafin == "")
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = BE.fechafin; }
                 cmd1.Parameters.Add("@moneda", SqlDbType.Char, 1).Value = BE.moneda;
                 cmd1.Parameters.Add("@norden", SqlDbType.Int).Value = BE.norden;
                 cmd1.Parameters.Add("@ntipofecha", SqlDbType.Int).Value = BE.ntipofecha;
                 cmd1.Parameters.Add("@nestado", SqlDbType.Int).Value = BE.nestado;
                 cmd1.Parameters.Add("@tipdoc", SqlDbType.Char, 2).Value = BE.tipodoc;
                 cmd1.Parameters.Add("@serdoc", SqlDbType.Char, 4).Value = BE.serdoc;
                 cmd1.Parameters.Add("@numdoc", SqlDbType.Char, 10).Value = BE.numdoc;
                 cmd1.Parameters.Add("@nmruc", SqlDbType.Char, 11).Value = BE.nmruc;
                 cmd1.Parameters.Add("@percepcion", SqlDbType.Int).Value = BE.percepcion;
                 cmd1.Parameters.Add("@excel", SqlDbType.Int).Value = BE.excel;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd1))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 Sql_Error = ex.Message;
                 throw new Exception(ex.Message);
             }
         }
     }
 }
コード例 #11
0
 public DataSet ReporteRegCompraAux(string empresaid, tb_co_Compras BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd1 = new SqlCommand("gspTbCoMovimientos_ReporteRegCompraAux", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd1.CommandTimeout = 0;
                 cmd1.CommandType = CommandType.StoredProcedure;
                 cmd1.Parameters.Add("@perianio", SqlDbType.Char, 4).Value = BE.perianio;
                 if (BE.fechaini == "")
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = BE.fechaini; }
                 //cmd1.Parameters.Add("@fechaini", SqlDbType.DateTime).Value = BE.fechaini;
                 if (BE.fechafin == "")
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = BE.fechafin; }
                 //cmd1.Parameters.Add("@fechafin", SqlDbType.DateTime).Value = BE.fechafin;
                 cmd1.Parameters.Add("@rubroid", SqlDbType.Char, 4).Value = BE.rubroid;
                 cmd1.Parameters.Add("@nmruc", SqlDbType.Char, 11).Value = BE.nmruc;
                 cmd1.Parameters.Add("@cencosid", SqlDbType.Char, 11).Value = BE.cencosid;
                 cmd1.Parameters.Add("@tipdoc", SqlDbType.Char, 2).Value = BE.tipodoc;
                 cmd1.Parameters.Add("@moneda", SqlDbType.Char, 1).Value = BE.moneda;
                 cmd1.Parameters.Add("@norden", SqlDbType.Int).Value = BE.norden;
                 cmd1.Parameters.Add("@nquiebre", SqlDbType.Int).Value = BE.nquiebre;
                 cmd1.Parameters.Add("@ntipofecha", SqlDbType.Int).Value = BE.ntipofecha;
                 cmd1.Parameters.Add("@nestado", SqlDbType.Int).Value = BE.nestado;
                 if (BE.fimpresion == "")
                 { cmd1.Parameters.Add("@fimpresion", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fimpresion", System.Data.SqlDbType.DateTime).Value = BE.fimpresion; }
                 //cmd1.Parameters.AddWithValue("@fimpresion", string.IsNullOrEmpty(BE.fimpresion) ? (object)DBNull.Value : BE.fimpresion);
                 cmd1.Parameters.Add("@afecdetraccion", SqlDbType.Bit).Value = BE.afecdetraccion;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd1))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 Sql_Error = ex.Message;
                 throw new Exception(ex.Message);
             }
         }
     }
 }
コード例 #12
0
 public DataSet ReporteRegCompraAnalitico(string empresaid, tb_co_Compras BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd1 = new SqlCommand("gspTbCoMovimientos_ReporteRegComprasAnaliticoProveedor", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd1.CommandTimeout = 0;
                 cmd1.CommandType = CommandType.StoredProcedure;
                 cmd1.Parameters.Add("@perianio", SqlDbType.Char, 4).Value = BE.perianio;
                 if (BE.fechaini == "")
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = BE.fechaini; }
                 //cmd1.Parameters.Add("@fechaini", SqlDbType.DateTime).Value = BE.fechaini;
                 if (BE.fechafin == "")
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = BE.fechafin; }
                 //cmd1.Parameters.Add("@fechafin", SqlDbType.DateTime).Value = BE.fechafin;
                 cmd1.Parameters.AddWithValue("@nmruc", string.IsNullOrEmpty(BE.nmruc) ? (object)DBNull.Value : BE.nmruc);
                 cmd1.Parameters.AddWithValue("@tipdoc", string.IsNullOrEmpty(BE.tipodoc) ? (object)DBNull.Value : BE.tipodoc);
                 cmd1.Parameters.AddWithValue("@productid", string.IsNullOrEmpty(BE.productid) ? (object)DBNull.Value : BE.productid);
                 cmd1.Parameters.Add("@moneda", SqlDbType.Char, 1).Value = BE.moneda;
                 cmd1.Parameters.Add("@considerar_docs_sin_producto", SqlDbType.Int).Value = BE.considerar_docs_sin_producto;
                 cmd1.Parameters.Add("@quiebre", SqlDbType.Int).Value = BE.nquiebre;
                 cmd1.Parameters.Add("@orden", SqlDbType.Int).Value = BE.norden;
                 //cmd1.Parameters.Add("@cencosid", SqlDbType.Char, 11).Value = BE.cencosid;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd1))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 Sql_Error = ex.Message;
                 throw new Exception(ex.Message);
             }
         }
     }
 }
コード例 #13
0
        public DataSet RenameCompra(string empresaid, tb_co_Compras BE)
        {
            using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
            {
                using (SqlCommand cmd1 = new SqlCommand("gspTbCoMovimientos_RenameRegCompras", cnx))
                {
                    DataSet ds = new DataSet();
                    {
                        cmd1.CommandTimeout = 0;
                        cmd1.CommandType = CommandType.StoredProcedure;
                        cmd1.Parameters.Add("@periodo", SqlDbType.Char, 4).Value = BE.perianio;
                        cmd1.Parameters.Add("@regmes", SqlDbType.Char, 2).Value = BE.perimes;
                        cmd1.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                        cmd1.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                        cmd1.Parameters.Add("@regdiario", SqlDbType.Char, 4).Value = BE.diarioid;
                        cmd1.Parameters.Add("@regnumero", SqlDbType.Char, 6).Value = BE.asiento;

                        cmd1.Parameters.Add("@regmesnuevo", SqlDbType.Char, 2).Value = BE.regmesnuevo;
                        cmd1.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                        cmd1.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                        cmd1.Parameters.Add("@regdiarionuevo", SqlDbType.Char, 4).Value = BE.regdiarionuevo;
                        cmd1.Parameters.Add("@regnumeronuevo", SqlDbType.Char, 6).Value = BE.regnumeronuevo;
                    }
                    try
                    {
                        cnx.Open();
                        using (SqlDataAdapter da = new SqlDataAdapter(cmd1))
                        {
                            da.Fill(ds);
                        }
                        return ds;
                    }
                    catch (Exception ex)
                    {
                        Sql_Error = ex.Message;
                        throw new Exception(ex.Message);
                    }
                }
            }
        }
コード例 #14
0
 public DataSet ReporteRegCompraResumen01(string empresaid, tb_co_Compras BE)
 {
     return tablaDA.ReporteRegCompraResumen01(empresaid, BE);
 }
コード例 #15
0
 public DataSet ReporteRegistroCompraDetracciones(string empresaid, tb_co_Compras BE)
 {
     //return tablaDA.ReporteRegistroCompra(empresaid, BE);
     DataSet xreturn = null;
     xreturn = tablaDA.ReporteRegistroCompraDetracciones(empresaid, BE);
     Sql_Error = tablaDA.Sql_Error;
     return xreturn;
 }
コード例 #16
0
        public void LlenarGridMovimientoAlmacen()
        {
            btnRefrescar.Enabled = false;
            string xfecha1 = "";
            string xfecha2 = "";
            string xalmacen = "";
            string xctacte = "";
            string xtipdoc = ""; string xserdoc = ""; string xnumdoc = "";

            if (Fecha1.Enabled)
            { xfecha1 = VariablesPublicas.DTOS(Fecha1.Value); }
            if (fecha2.Enabled)
            { xfecha2 = VariablesPublicas.DTOS(fecha2.Value); }

            if (txtCtacte.Text.Trim().Length > 0)
            {
                xctacte = txtCtacte.Text;
                ValidaProveedor();
            }

            if (txtSerdoc.Enabled)
            { xserdoc = txtSerdoc.Text.Trim(); }
            if (txtNumdoc.Enabled)
            { xnumdoc = txtNumdoc.Text.Trim(); }

            if (txtcodalmacen.Enabled)
            {
                xalmacen = txtcodalmacen.Text;
            }
            tb_co_ComprasBL BL = new tb_co_ComprasBL();
            tb_co_Compras BE = new tb_co_Compras();

            BE.almacen = xalmacen;
            BE.fechaini = xfecha1;
            BE.fechafin = xfecha2;
            BE.ctacte = xctacte;
            BE.tipodoc = xtipdoc;
            BE.numdoc = (xserdoc.Trim().Length > 0 & xnumdoc.Trim().Length > 0 ? xserdoc.Trim() + "-" + xnumdoc.Trim() : xserdoc.Trim());
            dw = BL.GenPendienteNIAtoRCompra(VariablesPublicas.EmpresaID, BE).Tables[0];
            if (BL.Sql_Error.Length > 0)
            {
                sw_load = false;
                Frm_Class.ShowError(BL.Sql_Error, this);
                return;
            }
            SortOrder sorted = default(SortOrder);
            string xnomcolumna = "";
            if ((GridMovimientoAlmacen.SortedColumn != null))
            {
                xnomcolumna = GridMovimientoAlmacen.Columns[GridMovimientoAlmacen.SortedColumn.Index].Name;
                sorted = GridMovimientoAlmacen.SortOrder;
            }

            GridMovimientoAlmacen.AutoGenerateColumns = false;
            GridMovimientoAlmacen.DataSource = dw;
            for (lc_cont = 0; lc_cont <= GridMovimientoAlmacen.ColumnCount - 1; lc_cont++)
            {
                if (GridMovimientoAlmacen.Columns[lc_cont].Name.ToUpper() == "selecciona".ToUpper())
                {
                    GridMovimientoAlmacen.Columns[lc_cont].ReadOnly = false;
                }
                else
                {
                    GridMovimientoAlmacen.Columns[lc_cont].ReadOnly = true;
                }
            }

            if (xnomcolumna.Trim().Length > 0)
            {
                if (sorted == SortOrder.Ascending)
                {
                    GridMovimientoAlmacen.Sort(GridMovimientoAlmacen.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Ascending);
                }
                else
                {
                    GridMovimientoAlmacen.Sort(GridMovimientoAlmacen.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Descending);
                }
            }
            else
            {
                GridMovimientoAlmacen.Sort(GridMovimientoAlmacen.Columns["d_femisiondoc"], System.ComponentModel.ListSortDirection.Descending);
            }
            btnRefrescar.Enabled = true;
        }
コード例 #17
0
 public DataSet GenPendienteNIAtoRCompra(string empresaid, tb_co_Compras BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd1 = new SqlCommand("gspTbCoMovimientos_GenPendienteNIA_RCompra", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd1.CommandTimeout = 0;
                 cmd1.CommandType = CommandType.StoredProcedure;
                 cmd1.Parameters.AddWithValue("@almacen", string.IsNullOrEmpty(BE.almacen) ? (object)DBNull.Value : BE.almacen);
                 if (BE.fechaini == "")
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechaini", System.Data.SqlDbType.DateTime).Value = BE.fechaini; }
                 if (BE.fechafin == "")
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = System.Data.SqlTypes.SqlDateTime.Null; }
                 else
                 { cmd1.Parameters.Add("@fechafin", System.Data.SqlDbType.DateTime).Value = BE.fechafin; }
                 cmd1.Parameters.AddWithValue("@ctacte", string.IsNullOrEmpty(BE.ctacte) ? (object)DBNull.Value : BE.ctacte);
                 cmd1.Parameters.AddWithValue("@tipdoc", string.IsNullOrEmpty(BE.tipodoc) ? (object)DBNull.Value : BE.tipodoc);
                 cmd1.Parameters.AddWithValue("@numdoc", string.IsNullOrEmpty(BE.numdoc) ? (object)DBNull.Value : BE.numdoc);
             }
             cnx.Open();
             try
             {
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd1))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 Sql_Error = ex.Message;
                 throw new Exception(ex.Message);
             }
         }
     }
 }