private void saveGroups(BsItemForm item)
        {
            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 + ""));
                }
            }

            item.Group.AddGroupsByItemForm(gps, item);
            RegisterClientScriptBlock("ok1", "<script>top.closeLayerAlpha()</script>");
        }
 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 + ""));
     }
 }
示例#3
0
        public BsFields GetObjectsByGroups()
        {
            DataTable dt = Database.DaFields.GetFieldsByGroups(
                _id,
                BsGroup.ConvertToArrayGroups(Groups)
                );

            return(addObjectsList(dt));
        }
示例#4
0
        public BsUsers GetObjectsByGroups()
        {
            Database.DaUsers ass = new Database.DaUsers();
            DataTable        dt  = ass.GetUsersByGroups(
                _id,
                BsGroup.ConvertToArrayGroups(Groups)
                );

            return(addObjectsList(dt));
        }
示例#5
0
 public void Clear()
 {
     _id       = 0;
     _name     = "";
     _idParent = -1;
     _group    = null;
     _groups   = null;
     _form     = null;
     _forms    = null;
     _user     = null;
 }
示例#6
0
        public BsFolders GetObjectsByGroups()
        {
            DataTable dt = Database.DaFolders.GetFoldersByGroups(
                _id,
                _idParent,
                _name,
                BsGroup.ConvertToArrayGroups(Groups)
                );

            return(addObjectsList(dt));
        }
示例#7
0
        public BsItensForm GetObjectsByGroups(string order, string where)
        {
            DataTable dt = Database.DaItensForms.GetItensFormByGroups(
                _id,
                Form.Id,
                Folder.Id, order, where,
                BsGroup.ConvertToArrayGroups(Groups)
                );

            return(addObjectsList(dt));
        }
示例#8
0
 public void AddFoldersByGroup(BsFolders f_, BsGroup group_)
 {
     if (group_.Id <= 0)
     {
         throw new Exception("id group not found");
     }
     Database.DaFolders.DelFoldersByGroupId(group_.Id);
     for (int i = 0; i < f_.Count; i++)
     {
         Database.DaGroups.AddGroupFolder(group_.Id, f_[i].Id);
     }
 }
示例#9
0
 public void AddFieldsByGroup(BsFields fds_, BsGroup g_)
 {
     if (g_.Id <= 0)
     {
         throw new Exception("id group not found");
     }
     Database.DaFields.DelFieldsByGroupId(g_.Id);
     for (int i = 0; i < fds_.Count; i++)
     {
         Database.DaGroups.AddGroupField(fds_[i].Id, g_.Id);
     }
 }
示例#10
0
 public void AddUsersByGroup(BsUsers u_, BsGroup g_)
 {
     if (g_.Id <= 0)
     {
         throw new Exception("id group not found");
     }
     Database.DaUsers u = new Database.DaUsers();
     u.DelUsersByGroupId(g_.Id);
     for (int i = 0; i < u_.Count; i++)
     {
         Database.DaGroups.AddGroupUser(u_[i].Id, g_.Id);
     }
 }
示例#11
0
 public void AddItenFormByGroup(BsItensForm f_, BsGroup g_)
 {
     if (g_.Id == 0)
     {
         throw new Exception("id group not found");
     }
     if (f_.Count > 0)
     {
         Database.DaItensForms.DelItensFormByGroupId(g_.Id, f_[0].Form.Id);
     }
     for (int i = 0; i < f_.Count; i++)
     {
         Database.DaGroups.AddGroupItemForm(g_.Id, f_[i].Id, f_[i].Form.Id);
     }
 }
示例#12
0
        private void getConfig(BsItemForm item)
        {
            item.GetObject();
            setComboGroups();
            Business.BsGroup gp = new Business.BsGroup();
            gp.ItensForm.Add(item.Id, item);
            Business.BsGroups gps = gp.GetObjectsByItensForm();

            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);
            }
        }
示例#13
0
 public BsFolder(int id_, string name_, int idParent_,
                 BsGroup group_,
                 BsGroups groups_,
                 BsForm form_,
                 BsForms forms_,
                 BsUser user_)
 {
     this._id       = id_;
     this._name     = name_;
     this._idParent = idParent_;
     this._group    = group_;
     this._groups   = groups_;
     this._form     = form_;
     this._forms    = forms_;
     this._user     = user_;
 }
示例#14
0
 public static int CountChild(BsFolder f, BsGroups g)
 {
     return(Database.DaFolders.CountChild(f.Id, BsGroup.ConvertToArrayGroups(g)));
 }
示例#15
0
 private BsGroup setObject(BsGroup g_, DataRow dr_)
 {
     g_._id          = Convert.ToInt32(dr_["groupId"]);
     g_._description = dr_["description"].ToString();
     return(g_);
 }