Пример #1
0
        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>");
        }
Пример #2
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 + ""));
     }
 }
Пример #3
0
 public static int[] ConvertToArrayGroups(BsGroups gs_)
 {
     int [] groupsId = new int[gs_.Count];
     for (int i = 0; i < gs_.Count; i++)
     {
         groupsId[i] = gs_[i]._id;
     }
     return(groupsId);
 }
Пример #4
0
 public BsItemForm(int id_, BsFolder folder_, BsForm form_, BsGenericItens gFields_, BsUser user_, BsGroups groups_)
 {
     _id      = id_;
     _folder  = folder_;
     _form    = form_;
     _gFields = gFields_;
     _user    = user_;
     _groups  = groups_;
 }
Пример #5
0
        private BsGroups addObjectsList(DataTable dt_)
        {
            BsGroups objects = new BsGroups();

            foreach (DataRow dr in dt_.Rows)
            {
                objects.Add(Convert.ToInt32(dr["groupId"]), setObject(new BsGroup(), dr));
            }
            return(objects);
        }
Пример #6
0
 public void Clear()
 {
     _id       = 0;
     _name     = "";
     _idParent = -1;
     _group    = null;
     _groups   = null;
     _form     = null;
     _forms    = null;
     _user     = null;
 }
Пример #7
0
 public void AddGroupsByUser(BsGroups gs_, BsUser user_)
 {
     if (user_.Id <= 0)
     {
         throw new Exception("id user not found");
     }
     Database.DaGroups.DelGroupsByUserId(user_.Id);
     for (int i = 0; i < gs_.Count; i++)
     {
         Database.DaGroups.AddGroupUser(user_.Id, gs_[i].Id);
     }
 }
Пример #8
0
 public void AddGroupsByItemForm(BsGroups gs_, BsItemForm item_)
 {
     if (item_.Id == 0 || item_.Form.Id == 0)
     {
         throw new Exception("id item ou form not found");
     }
     Database.DaGroups.DelGroupsByItemFormId(item_.Id, item_.Form.Id);
     for (int i = 0; i < gs_.Count; i++)
     {
         Database.DaGroups.AddGroupItemForm(gs_[i].Id, item_.Id, item_.Form.Id);
     }
 }
Пример #9
0
 public void AddGroupsByField(BsGroups gs_, BsField field_)
 {
     if (field_.Id <= 0)
     {
         throw new Exception("id field not found");
     }
     Database.DaGroups.DelGroupsByFieldId(field_.Id);
     for (int i = 0; i < gs_.Count; i++)
     {
         Database.DaGroups.AddGroupField(field_.Id, gs_[i].Id);
     }
 }
Пример #10
0
 public void AddGroupsByFolder(BsGroups gs_, BsFolder folder_)
 {
     if (folder_.Id <= 0)
     {
         throw new Exception("id folder not found");
     }
     Database.DaGroups.DelGroupsByFolderId(folder_.Id);
     for (int i = 0; i < gs_.Count; i++)
     {
         Database.DaGroups.AddGroupFolder(gs_[i].Id, folder_.Id);
     }
 }
Пример #11
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);
            }
        }
Пример #12
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_;
 }
Пример #13
0
 public static int CountChild(BsFolder f, BsGroups g)
 {
     return(Database.DaFolders.CountChild(f.Id, BsGroup.ConvertToArrayGroups(g)));
 }