Exemple #1
0
        private void saveConfigUsers(int id)
        {
            Business.BsUsers us = new Business.BsUsers();
            int    x            = lstIUsers.Items.Count;
            string retn         = "";

            if (Request["lstIAddUsers"] != null)
            {
                retn = Request["lstIAddUsers"].ToString();
            }
            string [] list = retn.Split(new char[] { ',' });
            lstIAddUsers.Items.Clear();

            for (int i = 0; i < list.Length; i++)
            {
                if (list[i] != "")
                {
                    Business.BsUser ps = new Business.BsUser();
                    ps.Id = Convert.ToInt32(list[i]);
                    ps.GetObject();
                    us.Add(ps.Id, ps);
                    lstIAddUsers.Items.Add(new ListItem(ps.Name, ps.Id + ""));
                }
            }

            Business.BsGroup g = new Business.BsGroup();
            g.Id = id;
            g.User.AddUsersByGroup(us, g);
            searchMemory();
        }
Exemple #2
0
        public void getData(int id)
        {
            enabledAlter();
            Business.BsUser objUser = new Business.BsUser();
            objUser.Id    = id;
            txtId.Text    = id + "";
            objUser.Name  = "";
            objUser.Login = "";
            objUser.GetObject();

            txtAName.Text           = objUser.Name;
            txtALogin.Text          = objUser.Login;
            txtASenha.Text          = objUser.Password;
            txtACSenha.Text         = objUser.Password;
            txtAEmail.Text          = objUser.Email;
            rdlAdmin2.SelectedValue = objUser.Admin.ToString().ToLower();
        }
Exemple #3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!Business.BsUser.UserOn())
            {
                Response.Write("<script>alert( 'Sua sessão expirou!' );top.login();</script>");
                Response.End();
            }
            else
            {
                usr = Business.BsUser.GetUserOn();
            }

            if (!Page.IsPostBack)
            {
                if (Request["CommandName"] != null)
                {
                    if (Request["CommandName"] == "Alter")
                    {
                        getData(Convert.ToInt32(Request["id"]));
                    }
                    else if (Request["CommandName"] == "Config")
                    {
                        getConfig(Convert.ToInt32(Request["id"]));
                    }
                    else if (Request["CommandName"] == "Exclude")
                    {
                        Business.BsUser u = new Business.BsUser();
                        u.Id = Convert.ToInt32(Request["id"]);
                        u.GetObject();
                        u.ExcludeObject();
                        searchMemory();
                    }
                }
                else
                {
                    searchMemory();
                }
            }
        }