Esempio n. 1
0
        public void Insertar(int Id, string nombre)
        {
            try
            {
                BE = new SCE_TIENDA_BE();

                BE.ID_TIENDA  = Id;
                BE.NOM_TIENDA = nombre;

                DA.SCE_TIENDA_DA DA = new DA.SCE_TIENDA_DA(usrLogin);
                DA.Insertar(BE);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public List <SCE_TIENDA_BE> Listar()
        {
            List <SCE_TIENDA_BE> lstBE = new List <SCE_TIENDA_BE>();
            SCE_TIENDA_BE        BE    = null;

            try
            {
                using (SqlConnection cn = new SqlConnection(SCE_SQLCONEXION.GetCadConexion(usrLogin)))
                {
                    cn.Open();

                    string sql = "SP_SCE_TIENDA_SEL";

                    using (SqlCommand cmd = new SqlCommand(sql, cn))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;

                        SqlDataReader reader = cmd.ExecuteReader();

                        while (reader.Read())
                        {
                            BE = new SCE_TIENDA_BE();

                            BE.ID_TIENDA  = Convert.ToInt32(reader["ID_TIENDA"]);
                            BE.NOM_TIENDA = Convert.ToString(reader["NOM_TIENDA"]);

                            lstBE.Add(BE);
                        }

                        return(lstBE);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        public void Actualizar(SCE_TIENDA_BE BE)
        {
            try
            {
                using (SqlConnection cn = new SqlConnection(SCE_SQLCONEXION.GetCadConexion(usrLogin)))
                {
                    cn.Open();

                    string sql = "SP_SCE_TIENDA_UPD";

                    using (SqlCommand cmd = new SqlCommand(sql, cn))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@ID_TIENDA", BE.ID_TIENDA);
                        cmd.Parameters.AddWithValue("@NOM_TIENDA", BE.NOM_TIENDA);
                        cmd.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
        public SCE_TIENDA_BE ObtenerPorID(int Id)
        {
            SCE_TIENDA_BE BE = null;

            try
            {
                using (SqlConnection cn = new SqlConnection(SCE_SQLCONEXION.GetCadConexion(usrLogin)))
                {
                    cn.Open();

                    string sql = "SP_SCE_TIENDA_GET";

                    using (SqlCommand cmd = new SqlCommand(sql, cn))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@ID_TIENDA", Id);

                        SqlDataReader reader = cmd.ExecuteReader();

                        if (reader.Read())
                        {
                            BE = new SCE_TIENDA_BE();

                            BE.ID_TIENDA  = Convert.ToInt32(reader["ID_TIENDA"]);
                            BE.NOM_TIENDA = Convert.ToString(reader["NOM_TIENDA"]);
                        }

                        return(BE);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }