public static tsh_ProductosListasDePreciosCategoriasCuentasDataset GetList(string IdNomenclaturaCuenta, string IdNomenclaturaProducto, string IdListaDePrecio)
        {
            tsh_ProductosListasDePreciosCategoriasCuentasDataset data = new tsh_ProductosListasDePreciosCategoriasCuentasDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

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

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

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

            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
        public static tsh_ProductosListasDePreciosCategoriasCuentasDataset.tsh_ProductosListasDePreciosCategoriasCuentasRow GetByPk(string IdNomenclaturaCuenta, string IdNomenclaturaProducto)
        {
            tsh_ProductosListasDePreciosCategoriasCuentasDataset data = new tsh_ProductosListasDePreciosCategoriasCuentasDataset();

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

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

            adapter.Fill(data);

            if (data.tsh_ProductosListasDePreciosCategoriasCuentas.Rows.Count == 1)
            {
                return((tsh_ProductosListasDePreciosCategoriasCuentasDataset.tsh_ProductosListasDePreciosCategoriasCuentasRow)data.tsh_ProductosListasDePreciosCategoriasCuentas.Rows[0]);
            }

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

            mz.erp.dataaccess.tsh_ProductosListasDePreciosCategoriasCuentas.Update(dataSet);
        }
Пример #4
0
        public tsh_ProductosListasDePreciosCategoriasCuentasDataset Commit(tsh_ProductosListasDePreciosCategoriasCuentasDataset data)
        {
            switch (_estado)
            {
            case "NEW":
            {
                tsh_ProductosListasDePreciosCategoriasCuentasDataset.tsh_ProductosListasDePreciosCategoriasCuentasRow rowPC = data.tsh_ProductosListasDePreciosCategoriasCuentas.Newtsh_ProductosListasDePreciosCategoriasCuentasRow();
                tsh_ProductosListasDePreciosCategoriasCuentas.SetRowDefaultValues(rowPC);

                rowPC.IdNomenclaturaCuenta   = _idNomenclaturaCuenta;
                rowPC.IdNomenclaturaProducto = _idNomenclaturaProducto;
                rowPC.IdListaDePrecio        = _idListaDePrecios;

                data.tsh_ProductosListasDePreciosCategoriasCuentas.Rows.Add(rowPC);
                break;
            }

            case "DEL":
            {
                tsh_ProductosListasDePreciosCategoriasCuentasDataset.tsh_ProductosListasDePreciosCategoriasCuentasRow rowPC = data.tsh_ProductosListasDePreciosCategoriasCuentas.FindByIdNomenclaturaCuentaIdNomenclaturaProducto(_idNomenclaturaCuenta, _idNomenclaturaProducto);
                if (rowPC == null)
                {
                    rowPC = mz.erp.businessrules.tsh_ProductosListasDePreciosCategoriasCuentas.GetByPk(_idNomenclaturaCuenta, _idNomenclaturaProducto);
                    rowPC.Delete();
                    data.tsh_ProductosListasDePreciosCategoriasCuentas.ImportRow(rowPC);
                }
                else
                {
                    rowPC.Delete();
                }
                break;
            }

            default:
                break;
            }
            return(data);
        }
        public static tsh_ProductosListasDePreciosCategoriasCuentasDataset GetList()
        {
            tsh_ProductosListasDePreciosCategoriasCuentasDataset data = new tsh_ProductosListasDePreciosCategoriasCuentasDataset();

            return((tsh_ProductosListasDePreciosCategoriasCuentasDataset)GetList(data));
        }
 public static void Update(tsh_ProductosListasDePreciosCategoriasCuentasDataset dataSet)
 {
     Update(dataSet.tsh_ProductosListasDePreciosCategoriasCuentas);
 }