예제 #1
0
        public static Clases.ETipo_Articulo Lee_Tipo_Articulo(string id)
        {
            Clases.ETipo_Articulo ii_Tipo = new Clases.ETipo_Articulo();
            DataSet DS    = new DataSet();
            string  Error = "";
            string  sql   = "  SELECT * from TIPO_ARTICULO WHERE  id_t_articulo = '" + id + "'";

            DS = funciones.EjecutaSQL(sql, ref Error);
            if (DS.Tables[0].Rows.Count > 0)
            {
                ii_Tipo.id          = id;
                ii_Tipo.descripcion = DS.Tables[0].Rows[0][1].ToString();
                ii_Tipo.estado      = DS.Tables[0].Rows[0][2].ToString();
                ii_Tipo.unidad      = DS.Tables[0].Rows[0][3].ToString();
                return(ii_Tipo);
            }
            return(null);
        }
예제 #2
0
 void Llena_Datos()
 {
     aa_ETipo = funciones.Lee_Tipo_Articulo(tid.Text.ToString().Trim());
     if (aa_ETipo != null)
     {
         aa_modo      = "m";
         tdescr.Text  = aa_ETipo.descripcion;
         Tunidad.Text = aa_ETipo.unidad;
         if (aa_ETipo.estado.ToUpper() == "A")
         {
             cb_estado.SelectedIndex = 0;
         }
         else
         {
             cb_estado.SelectedIndex = 1;
         }
     }
     else
     {
         Valida_codigo();
     }
 }