Ejemplo n.º 1
0
        public static tfi_ResponsablesCajasDataset.tfi_ResponsablesCajasRow GetByPk(string IdCaja, string IdResponsable)
        {
            tfi_ResponsablesCajasDataset data = new tfi_ResponsablesCajasDataset();

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

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

            adapter.Fill(data);

            if (data.tfi_ResponsablesCajas.Rows.Count == 1)
            {
                return((tfi_ResponsablesCajasDataset.tfi_ResponsablesCajasRow)data.tfi_ResponsablesCajas.Rows[0]);
            }

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

            mz.erp.dataaccess.tfi_ResponsablesCajas.Update(dataSet);
        }
Ejemplo n.º 3
0
        public static ArrayList GetCajas(string IdResponsable)
        {
            ArrayList _array = new ArrayList();
            tfi_ResponsablesCajasDataset _data = GetList(null, IdResponsable);

            foreach (tfi_ResponsablesCajasDataset.tfi_ResponsablesCajasRow row in _data.tfi_ResponsablesCajas.Rows)
            {
                _array.Add(Convert.ToString(row["IdCaja"]));
            }
            return(_array);
        }
Ejemplo n.º 4
0
        public static tfi_ResponsablesCajasDataset GetList(string IdCaja, string IdResponsable)
        {
            tfi_ResponsablesCajasDataset data = new tfi_ResponsablesCajasDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

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

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

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

            cmd.CommandType = CommandType.StoredProcedure;

            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
Ejemplo n.º 5
0
 public static void Update(tfi_ResponsablesCajasDataset dataSet)
 {
     Update(dataSet.tfi_ResponsablesCajas);
 }