Esempio n. 1
0
        public void CRE_Bodega(SqlCommand comando, MOD_Bodega obj)
        {
            try
            {
                string sp = "SP_CRE_Bodega";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@BOD_ID_BODEGA", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@BOD_ID_SURCURSAL", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@BOD_ID_CENTRO_ATENCION", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@BOD_DESCRIPCION", SqlDbType.VarChar));

                comando.Parameters[0].Value = obj.BOD_id_bodega;
                comando.Parameters[1].Value = obj.BOD_id_sucursal;
                comando.Parameters[2].Value = obj.BOD_id_centro_atencion;
                comando.Parameters[3].Value = obj.BOD_descripcion;

                comando.ExecuteNonQuery();
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Esempio n. 2
0
 public void CRE_Bodega(MOD_Bodega obj)
 {
     try
     {
         this.IniciarTransaccion();
         AD_Bodega objBodega = new AD_Bodega();
         objBodega.CRE_Bodega(this.comando, obj);
         this.ConfirmarTransaccion();
     }
     catch (Exception exc)
     {
         this.DeshacerTransaccion();
         throw exc;
     }
 }
Esempio n. 3
0
        public Boolean CRE_Bodega(MOD_Bodega obj)
        {
            try
            {
                LOG_Bodega Logica = new LOG_Bodega();
                Logica.CRE_Bodega(obj);
                return true;
            }
            catch (Exception )
            {
                return false;
                throw ;

            }
        }
Esempio n. 4
0
        public List<MOD_Bodega> SEL_DL_Bodega(SqlCommand comando, int centro_atencion)
        {
            try
            {
                string sp = "SP_SEL_DL_Bodega";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@BOD_ID_CENTRO_ATENCION", SqlDbType.Int));

                comando.Parameters[0].Value = centro_atencion;

                IDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                List<MOD_Bodega> lista = new List<MOD_Bodega>();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Bodega obj = new MOD_Bodega();
                    obj.BOD_id_bodega = Convert.ToInt32(dt.Rows[i]["BOD_ID_BODEGA"]);
                    obj.BOD_descripcion = dt.Rows[i]["BOD_DESCRIPCION"].ToString();
                    lista.Add(obj);
                }

                return lista;

            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Esempio n. 5
0
        public MOD_Bodega SEL_Grid_By_Id_Bodega(SqlCommand comando, int codigo, int codigo_sucursal, int Centro_Atencion)
        {
            try
            {
                string sp = "SP_SEL_GRID_BY_ID_Bodega";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@BOD_ID_BODEGA", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@BOD_ID_SURCURSAL", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@BOD_ID_CENTRO_ATENCION", SqlDbType.Int));

                comando.Parameters[0].Value = codigo;
                comando.Parameters[1].Value = codigo_sucursal;
                comando.Parameters[2].Value = Centro_Atencion;

                IDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                MOD_Bodega obj = new MOD_Bodega();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.BOD_id_bodega = Convert.ToInt32(dt.Rows[i]["BOD_ID_Bodega"]);
                    obj.BOD_descripcion = dt.Rows[i]["BOD_Descripcion"].ToString();
                    obj.BOD_id_sucursal = Convert.ToInt32(dt.Rows[i]["BOD_ID_surcursal"]);
                    obj.SUC_nombre = dt.Rows[i]["SUC_NOMBRE"].ToString();
                    obj.BOD_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["BOD_ID_CENTRO_ATENCION"]);
                    obj.CEA_nombre = dt.Rows[i]["CEA_NOMBRE"].ToString();

                }

                return obj;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Esempio n. 6
0
        public List<MOD_Bodega> SEL_Grid_Bodega(SqlCommand comando, int Centro_Atencion, string buscar)
        {
            try
            {
                string sp = "SP_SEL_Grid_Bodega";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@BOD_ID_CENTRO_ATENCION", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@BUSCAR", SqlDbType.VarChar));

                comando.Parameters[0].Value = Centro_Atencion;
                comando.Parameters[1].Value = buscar;

                IDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                List<MOD_Bodega> lista = new List<MOD_Bodega>();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Bodega obj = new MOD_Bodega();
                    obj.BOD_id_bodega = Convert.ToInt32(dt.Rows[i]["BOD_ID_Bodega"]);
                    obj.BOD_descripcion = dt.Rows[i]["BOD_Descripcion"].ToString();
                    obj.BOD_id_sucursal = Convert.ToInt32(dt.Rows[i]["BOD_ID_surcursal"]);
                    obj.SUC_nombre = dt.Rows[i]["SUC_NOMBRE"].ToString();
                    obj.BOD_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["BOD_ID_CENTRO_ATENCION"]);
                    obj.CEA_nombre = dt.Rows[i]["CEA_NOMBRE"].ToString();

                    lista.Add(obj);
                }

                return lista;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Esempio n. 7
0
 public void UPD_Bodega(MOD_Bodega obj)
 {
     try
     {
         LOG_Bodega Logica = new LOG_Bodega();
         Logica.UPD_Bodega(obj);
     }
     catch (Exception )
     {
         throw ;
     }
 }