Пример #1
0
        private void UsersSelected(PriceList pl)
        {
            ltUsers.Clear();
            //usuario de la lista de precios
            ArrayList users = PermissionManager.GetUsersForEntity(pl, pl.ID.ToString(), PermissionAction.Create) as ArrayList;
            //usuarios del sitio
            IList <UserMember> lstUsers = MembershipManager.ListBySite();
            bool wasAdded = false;

            foreach (UserMember u in lstUsers)
            {
                if (pl != null)
                {
                    foreach (string um in users)
                    {
                        wasAdded = false;
                        if (um == u.Email)
                        {
                            wasAdded = true;
                            ltUsers.AddDestinationItem(new ListItem(u.UserName, u.ID.ToString()));
                            break;
                        }
                    }
                    if (!wasAdded)
                    {
                        ltUsers.AddItem(new ListItem(u.UserName, u.ID.ToString()));
                    }
                }
                else
                {
                    ltUsers.AddItem(new ListItem(u.UserName, u.ID.ToString()));
                }
            }
        }
Пример #2
0
        public override void Refresh()
        {
            IList <UserMember>           lst      = MembershipManager.ListBySite();
            IList <MembershipHelperUser> lstfinal = new List <MembershipHelperUser>();

            foreach (UserMember member in lst)
            {
                lstfinal.Add(MembershipHelper.GetUser(member.ID));
            }
            DataSource     = lstfinal;
            DataTextField  = "FullName";
            DataValueField = "UserId";
            DataBind();
            Items.Insert(0, new ListItem("--Usuario--", "0"));
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Numeros num = new Numeros();
                DropDownList3.DataSource = PermissionManager.GetEntitysForAction(num.GetType(), PermissionAction.Create);
                DropDownList3.DataBind();

                DropDownList2.DataSource = PermissionManager.GetEntitysForAction(num.GetType(), PermissionAction.Create);
                DropDownList2.DataBind();

                ListBox1.DataSource     = MembershipManager.ListBySite();
                ListBox1.DataTextField  = "UserName";
                ListBox1.DataValueField = "ID";
                ListBox1.DataBind();

                DropDownList1.DataSource     = MembershipManager.ListBySite();
                DropDownList1.DataTextField  = "UserName";
                DropDownList1.DataValueField = "ID";
                DropDownList1.DataBind();
            }
        }