コード例 #1
0
ファイル: CompraVenta.aspx.cs プロジェクト: farby/SACG
        protected void removeDicoseDestino()
        {
            IRepoEstablecimiento repoEst = new RepoEstablecimiento();
            List <Int64>         activos = repoEst.All();
            // Create a table to store data for the DropDownList control.
            DataTable dt = new DataTable();

            // Define the columns of the table.
            dt.Columns.Add(new DataColumn("TextField", typeof(String)));
            dt.Columns.Add(new DataColumn("ValueField", typeof(String)));

            Int64 dicoseVendedor = Convert.ToInt64(listEstablecimientos.SelectedItem.Value);

            foreach (Int64 dicose in activos)
            {
                // Populate the table with sample values.
                if (dicoseVendedor != dicose)
                {
                    dt.Rows.Add(CreateRow(Convert.ToString(dicose), Convert.ToString(dicose), dt));
                }
            }

            listEstablecimientosDestino.DataSource     = new DataView(dt);
            listEstablecimientosDestino.DataTextField  = "TextField";
            listEstablecimientosDestino.DataValueField = "ValueField";

            // Bind the data to the control.
            listEstablecimientosDestino.DataBind();

            // Set the default selected item, if desired.
            listEstablecimientosDestino.SelectedIndex = 0;
        }
コード例 #2
0
ファイル: CompraVenta.aspx.cs プロジェクト: farby/SACG
        protected void FillDicoseList()
        {
            IRepoEstablecimiento repoEst = new RepoEstablecimiento();
            List <Int64>         activos = repoEst.All();
            // Create a table to store data for the DropDownList control.
            DataTable dt = new DataTable();

            // Define the columns of the table.
            dt.Columns.Add(new DataColumn("TextField", typeof(String)));
            dt.Columns.Add(new DataColumn("ValueField", typeof(String)));

            foreach (Int64 dicose in activos)
            {
                // Populate the table with sample values.
                dt.Rows.Add(CreateRow(Convert.ToString(dicose), Convert.ToString(dicose), dt));
            }

            // Create a DataView from the DataTable to act as the data source
            // for the DropDownList control.
            listEstablecimientos.DataSource     = new DataView(dt);
            listEstablecimientos.DataTextField  = "TextField";
            listEstablecimientos.DataValueField = "ValueField";

            // Bind the data to the control.
            listEstablecimientos.DataBind();

            // Set the default selected item, if desired.
            listEstablecimientos.SelectedIndex = 0;
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IRepoEstablecimiento repo = new RepoEstablecimiento();

            if (!IsPostBack)
            {
                lstPendientes.DataSource = repo.Sby();
                lstPendientes.DataBind();

                lstActivos.DataSource = repo.All();
                lstActivos.DataBind();
            }
        }