Ejemplo n.º 1
0
        public static tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow GetByDescripcion(string Descripcion)
        {
            tsy_TiposDeComprobantesDataset data = new tsy_TiposDeComprobantesDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

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

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

            cmd.CommandType = CommandType.StoredProcedure;

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

            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            if (data.tsy_TiposDeComprobantes.Rows.Count == 1)
            {
                return((tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow)data.tsy_TiposDeComprobantes.Rows[0]);
            }

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

            mz.erp.dataaccess.tsy_TiposDeComprobantes.Update(dataSet);
        }
Ejemplo n.º 3
0
        public static DataSet GetList([SearchParameterInfo("IdTipoDeComprobante", IsAlternativePrimaryKey = true)] string IdTipoDeComprobante,
                                      [SearchParameterInfo("Descripcion", IsDescription = true)] string Descripcion
                                      )
        {
            tsy_TiposDeComprobantesDataset data = mz.erp.businessrules.tsy_TiposDeComprobantes.GetList(IdTipoDeComprobante, Descripcion, true, int.MinValue, null);

            return(( DataSet )data);
        }
Ejemplo n.º 4
0
        public static Hashtable GetListHashTable()
        {
            Hashtable table = new Hashtable();
            tsy_TiposDeComprobantesDataset data = GetList();

            foreach (tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow row in data.tsy_TiposDeComprobantes.Rows)
            {
                table.Add(row.IdTipoDeComprobante, row.Descripcion);
            }
            return(table);
        }
Ejemplo n.º 5
0
        public static string ObtenerClave(string unNombre)
        {
            string nombre = null;
            tsy_TiposDeComprobantesDataset data = tsy_TiposDeComprobantes.GetList(null, unNombre, false, int.MinValue, null);

            if (data.tsy_TiposDeComprobantes.Rows.Count > 0)
            {
                nombre = ((tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow)data.tsy_TiposDeComprobantes.Rows[0]).IdTipoDeComprobante;
            }
            return(nombre);
        }
Ejemplo n.º 6
0
        public static string MomentoAsociado(string unTipoDeComprobante)
        {
            tsy_TiposDeComprobantesDataset data = mz.erp.dataaccess.tsy_TiposDeComprobantes.GetList(unTipoDeComprobante, null, false, int.MinValue, null, null);

            tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow row = (tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow)data.tsy_TiposDeComprobantes.Rows[0];
            if (!(row.IsMomentoNull()))
            {
                return(row.Momento);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 7
0
        public static string Mascara(string unTipoDeComprobante)
        {
            tsy_TiposDeComprobantesDataset data = mz.erp.dataaccess.tsy_TiposDeComprobantes.GetList(unTipoDeComprobante, null, false, int.MinValue, null, null);

            if (data.tsy_TiposDeComprobantes.Rows.Count > 0)
            {
                tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow row = (tsy_TiposDeComprobantesDataset.tsy_TiposDeComprobantesRow)data.tsy_TiposDeComprobantes.Rows[0];
                if (!(row.IsMascaraNull()))
                {
                    return(row.Mascara);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 8
0
        public static tsy_TiposDeComprobantesDataset GetList(string IdTipoDeComprobante, string Descripcion, bool Activo, int Signo, string TiposComprobantesMomento, string Momento)
        {
            tsy_TiposDeComprobantesDataset data = new tsy_TiposDeComprobantesDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

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

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

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdTipoDeComprobante", SqlDbType.VarChar));
            if (IdTipoDeComprobante == null || IdTipoDeComprobante.Equals(string.Empty))
            {
                cmd.Parameters["@IdTipoDeComprobante"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdTipoDeComprobante"].Value = IdTipoDeComprobante;
            }

            cmd.Parameters.Add(new SqlParameter("@Descripcion", SqlDbType.VarChar));
            if (Descripcion == null || Descripcion.Equals(string.Empty))
            {
                cmd.Parameters["@Descripcion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@Descripcion"].Value = Descripcion;
            }

            cmd.Parameters.Add(new SqlParameter("@Activo", SqlDbType.Bit));
            cmd.Parameters["@Activo"].Value = System.DBNull.Value;

            cmd.Parameters.Add(new SqlParameter("@Signo", SqlDbType.Int));
            if (Signo.Equals(int.MinValue))
            {
                cmd.Parameters["@Signo"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@Signo"].Value = Signo;
            }

            cmd.Parameters.Add(new SqlParameter("@TiposComprobantesMomento", SqlDbType.VarChar));
            if (TiposComprobantesMomento == null || TiposComprobantesMomento.Equals(string.Empty))
            {
                cmd.Parameters["@TiposComprobantesMomento"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@TiposComprobantesMomento"].Value = TiposComprobantesMomento;
            }

            cmd.Parameters.Add(new SqlParameter("@Momento", SqlDbType.VarChar));
            if (Momento == null || Momento.Equals(string.Empty))
            {
                cmd.Parameters["@Momento"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@Momento"].Value = Momento;
            }


            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
Ejemplo n.º 9
0
        public static tsy_TiposDeComprobantesDataset GetList()
        {
            tsy_TiposDeComprobantesDataset data = new tsy_TiposDeComprobantesDataset();

            return(( tsy_TiposDeComprobantesDataset )GetList(data));
        }
Ejemplo n.º 10
0
 public static void Update(tsy_TiposDeComprobantesDataset dataSet)
 {
     Update(dataSet.tsy_TiposDeComprobantes);
 }