Esempio n. 1
0
        /// <summary>
        /// Envia los cambios del tsh_AsociacionCodigosDataset a la base de datos.
        /// </summary>
        public static void Update(tsh_AsociacionCodigosDataset dataSet)
        {
            ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber);
            ApplicationAssert.Check(dataSet.tsh_AsociacionCodigos.Rows.Count > 0, "La tabla dataSet.tsh_AsociacionCodigosDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tsh_AsociacionCodigos.Update(dataSet);
        }
Esempio n. 2
0
        public static tsh_AsociacionCodigosDataset.tsh_AsociacionCodigosRow GetByPk(string IdProducto, string CodigoSecundario)
        {
            tsh_AsociacionCodigosDataset data = new tsh_AsociacionCodigosDataset();

            SqlCommand cmd = new SqlCommand("Pr_tsh_AsociacionCodigos_GetByPk", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar));
            cmd.Parameters["@IdProducto"].Value = IdProducto;

            cmd.Parameters.Add(new SqlParameter("@CodigoSecundario", SqlDbType.VarChar));
            cmd.Parameters["@CodigoSecundario"].Value = CodigoSecundario;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.TableMappings.Add("Table", "tsh_AsociacionCodigos");

            adapter.Fill(data);

            if (data.tsh_AsociacionCodigos.Rows.Count == 1)
            {
                return((tsh_AsociacionCodigosDataset.tsh_AsociacionCodigosRow)data.tsh_AsociacionCodigos.Rows[0]);
            }

            return(null);
        }
Esempio n. 3
0
        public static tsh_AsociacionCodigosDataset GetList(string IdProducto, string CodigoSecundario, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdEmpresa)
        {
            tsh_AsociacionCodigosDataset data = new tsh_AsociacionCodigosDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "tsh_AsociacionCodigos");

            SqlCommand cmd = new SqlCommand("Pr_tsh_AsociacionCodigos_Search", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar));
            cmd.Parameters["@IdProducto"].Value = IdProducto;

            cmd.Parameters.Add(new SqlParameter("@CodigoSecundario", SqlDbType.VarChar));
            cmd.Parameters["@CodigoSecundario"].Value = CodigoSecundario;

            cmd.Parameters.Add(new SqlParameter("@FechaCreacion", SqlDbType.DateTime));
            cmd.Parameters["@FechaCreacion"].Value = FechaCreacion;

            cmd.Parameters.Add(new SqlParameter("@IdConexionCreacion", SqlDbType.BigInt));
            cmd.Parameters["@IdConexionCreacion"].Value = IdConexionCreacion;

            cmd.Parameters.Add(new SqlParameter("@UltimaModificacion", SqlDbType.Timestamp));
            cmd.Parameters["@UltimaModificacion"].Value = UltimaModificacion;

            cmd.Parameters.Add(new SqlParameter("@IdConexionUltimaModificacion", SqlDbType.BigInt));
            cmd.Parameters["@IdConexionUltimaModificacion"].Value = IdConexionUltimaModificacion;

            cmd.Parameters.Add(new SqlParameter("@IdReservado", SqlDbType.BigInt));
            cmd.Parameters["@IdReservado"].Value = IdReservado;

            cmd.Parameters.Add(new SqlParameter("@RowId", SqlDbType.UniqueIdentifier));
            cmd.Parameters["@RowId"].Value = RowId;

            cmd.Parameters.Add(new SqlParameter("@IdEmpresa", SqlDbType.BigInt));
            cmd.Parameters["@IdEmpresa"].Value = IdEmpresa;


            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
Esempio n. 4
0
        public static tsh_AsociacionCodigosDataset GetList()
        {
            tsh_AsociacionCodigosDataset data = new tsh_AsociacionCodigosDataset();

            return(( tsh_AsociacionCodigosDataset )GetList(data));
        }
Esempio n. 5
0
 public static void Update(tsh_AsociacionCodigosDataset dataSet)
 {
     Update(dataSet.tsh_AsociacionCodigos);
 }