Example #1
0
 public void AddItem(GroupModel groupModel, GroupItemModel groupItems,List<SessionModel> session)
 {
     _groupModels.Add(groupModel);
     _groupItems.Add(groupItems);
     Redraw(session);
 }
Example #2
0
        private void AddListControl_SaveClick(object sender, EventArgs e)
        {
            var group = new GroupModel
            {
                GroupName = _addListControl.textBoxXListName.Text,
                TimeFrame = _addListControl.cmbHistoricalPeriod.SelectedItem.ToString(),
                Start = new DateTime(),
                End = new DateTime(),
                CntType = _addListControl.cmbContinuationType.SelectedItem.ToString()
            };

            if (!_groupItems.Exists(a => a.GroupModel.GroupName == group.GroupName) &&
                !ClientDatabaseManager.GetAllGroups(ApplicationType.DataNet).Exists(a => a.GroupName == group.GroupName))
            {
                if (ClientDatabaseManager.AddGroupOfSymbols(group))
                {
                    group.GroupId = ClientDatabaseManager.GetGroupIdByName(group.GroupName);

                    ClientDatabaseManager.AddGroupForUser(_client.UserID, group, ApplicationType.DataNet);
                    //groupList4.GroupModels = group;
                    var symbols =
                    ClientDatabaseManager.GetSymbolsInGroup(group.GroupId).Select(oo => oo.SymbolName).ToList();
                    var sessions = ClientDatabaseManager.GetSessionsInGroup(group.GroupId);
                    var groupItem = new GroupItemModel
                    {
                        GroupModel = group,
                        GroupState = GroupState.NotInQueue,
                        AllSymbols = symbols,
                        CollectedSymbols = new List<string>(),
                    };
                    //groupList4.GroupItems = groupItem;
                    //groupList4.AddItem(group,groupItem, new List<SessionModel>());
                    RefreshGroups();

                    _clientService.ServiceProxy.onSymbolGroupListRecieved("");

                    CloseAddListControl();
                }
            }
            else
            {
                ToastNotification.Show(_addListControl, @"List with this name is already exists!");
            }
        }
Example #3
0
        public void SetItem(int ind, GroupModel groupModel, GroupItemModel groupItems,List<SessionModel> session)
        {
            if (ind < panelEx1.Controls.Count && ind < _groupModels.Count  && ind < _groupItems.Count)
            {
                var item = _groupModels[ind];
                var gi = (GroupItem)(panelEx1.Controls[ind]);
                if (gi != null)
                {
                    gi.ItemName = item.GroupName;
                    gi.TimeFrame = item.TimeFrame;
                    gi.Time = item.End;
                    gi.ContType = item.CntType;
                    gi.Sessions = session;
                    //gi.ItemIsSelected = false;
                    gi.ItemIndex = ind;
                    gi.GroupID = item.GroupId;
                    gi.ItemState = _groupItems[ind].GroupState;
                    gi.Symbols = _groupItems[ind].AllSymbols;
                    gi.SetCount(_groupItems[ind].CollectedSymbols.Count, _groupItems[ind].AllSymbols.Count);
                    //gi.ItemIsAutoCollect = false;
                    //gi.ItemSelectedChanged += gi_ItemSelectedChanged;
                    //gi.ItemEditGroupClick += gi_ItemEditGroupClick;

                }
            }
            else
            {
                AddItem(groupModel, groupItems,session);
            }
        }