Exemple #1
0
        private void saveGroups(int folderId)
        {
            Business.BsGroups gps = new Business.BsGroups();
            int    x    = lstIGroups.Items.Count;
            string retn = "";

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

            for (int i = 0; i < list.Length; i++)
            {
                if (list[i] != "")
                {
                    Business.BsGroup ps = new Business.BsGroup();
                    ps.Id = Convert.ToInt32(list[i]);
                    ps.GetObject();
                    gps.Add(ps.Id, ps);
                    lstIAddGroups.Items.Add(new ListItem(ps.Description, ps.Id + ""));
                }
            }

            Business.BsFolder f = new Business.BsFolder();
            f.Id = folderId;
            f.Group.AddGroupsByFolder(gps, f);
            RegisterClientScriptBlock("ok1", "<script>top.closeLayerAlpha()</script>");
        }
Exemple #2
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 #3
0
        private void saveConfigGroups(int id)
        {
            Business.BsGroups gps = new Business.BsGroups();
            int    x    = lstIGroups.Items.Count;
            string retn = "";

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

            for (int i = 0; i < list.Length; i++)
            {
                if (list[i] != "")
                {
                    Business.BsGroup ps = new Business.BsGroup();
                    ps.Id = Convert.ToInt32(list[i]);
                    ps.GetObject();
                    gps.Add(ps.Id, ps);
                    lstIAddGroups.Items.Add(new ListItem(ps.Description, ps.Id + ""));
                }
            }

            Business.BsUser u = new Business.BsUser();
            u.Id = id;
            u.Group.AddGroupsByUser(gps, u);
            searchMemory();
        }
Exemple #4
0
 private void dgGroups_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
 {
     if (e.Item.ItemType != ListItemType.Footer && e.Item.ItemType != ListItemType.Header)
     {
         Business.BsGroup g = ((Business.BsGroup)DataBinder.Eval(e.Item.DataItem, "Value"));
         e.Item.Cells[0].Text = g.Description;
     }
 }
Exemple #5
0
        private void searchMemory()
        {
            enabledSearch();
            Business.BsGroup g = new Business.BsGroup();

            dgGroups.DataSource = g.GetObjects();
            dgGroups.DataBind();
        }
Exemple #6
0
 private void setComboGroups()
 {
     Business.BsGroup  g   = new Business.BsGroup();
     Business.BsGroups gps = g.GetObjects();
     for (int i = 0; i < gps.Count; i++)
     {
         lstIGroups.Items.Add(new ListItem(gps[i].Description, gps[i].Id + ""));
     }
 }
Exemple #7
0
        private void search()
        {
            enabledSearch();
            Business.BsGroup g = new Business.BsGroup();
            g.Description = txtDescription.Text;

            dgGroups.DataSource = g.GetObjects();
            dgGroups.DataBind();
        }
Exemple #8
0
        private void getData(int id)
        {
            fields();
            Business.BsGroup p = new Business.BsGroup();
            p.Id       = id;
            txtId.Text = id + "";
            p.GetObject();

            txtIDescription.Text = p.Description;
        }
Exemple #9
0
        private void getConfig(int folderId)
        {
            setComboGroups();
            Business.BsGroup gp = new Business.BsGroup();
            gp.Folders.Add(folderId, new Business.BsFolder(folderId));
            Business.BsGroups gps = gp.GetObjectsByFolders();

            lstIAddGroups.Items.Clear();
            for (int i = 0; i < gps.Count; i++)
            {
                ListItem l = new ListItem(gps[i].Description, gps[i].Id + "");
                lstIAddGroups.Items.Add(l);
                lstIGroups.Items.Remove(l);
            }
        }
Exemple #10
0
        private void getConfig(int id)
        {
            config(id);
            Business.BsGroup gp = new Business.BsGroup();
            gp.Users.Add(id, new Business.BsUser(id));
            Business.BsGroups gps = gp.GetObjectsByUsers();

            lstIAddGroups.Items.Clear();
            for (int i = 0; i < gps.Count; i++)
            {
                ListItem l = new ListItem(gps[i].Description, gps[i].Id + "");
                lstIAddGroups.Items.Add(l);
                lstIGroups.Items.Remove(l);
            }
        }
Exemple #11
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 && Request["CommandName"] == "Alter")
                {
                    getData(Convert.ToInt32(Request["id"]));
                }
                else if (Request["CommandName"] == "Config")
                {
                    getConfig(Convert.ToInt32(Request["id"]), Convert.ToInt32("0" + Request["paran"]));
                }
                else if (Request["CommandName"] != null && Request["CommandName"] == "Exclude")
                {
                    Business.BsGroup g = new Business.BsGroup();
                    g.Id = Convert.ToInt32(Request["id"]);
                    g.GetObject();
                    g.ExcludeObject();
                    searchMemory();
                }
                else
                {
                    searchMemory();
                }
            }
        }
Exemple #12
0
        private void btnInclu_Click(object sender, System.EventArgs e)
        {
            if (txtIDescription.Text == "")
            {
                RegisterClientScriptBlock("err", "<script>alert( 'Descrição Obrigatória' )</script>");
                return;
            }

            Business.BsGroup g = new Business.BsGroup();
            g.Description = txtIDescription.Text;

            g.Id = Convert.ToInt32("0" + txtId.Text);
            g.SaveObject();

            if (txtId.Text != "")
            {
                RegisterStartupScript("inclu", "<script>alert('Registro Salvo.')</script>");
                clearFields();
            }
            else
            {
                search();
            }
        }