void _superList_DragDropEx(object sender, SuperlistDragEventArgs ea) { bool changed = false; GroupSection gs = ea.SectionOver as GroupSection; if (gs != null) { IDataObject dataObject = ea.DragEventArgs.Data; string[] formats = dataObject.GetFormats(); foreach (string format in formats) { object[] items = dataObject.GetData(format) as object[]; foreach (object item in items) { RowIdentifier ri = item as RowIdentifier; if (ri != null) { foreach (Person p in ri.Items) { ApplyDragDropChanges(gs.RowIdentifier.GroupColumns, (Person)gs.RowIdentifier.Items[0], p); changed = true; } } } } } if (changed) { _superList.Items.Sort(); } }
public GroupSection Get(int?groupID, int?sectionID) { if (groupID == null || sectionID == null) { throw new ValidationException("Не задан ID", ""); } GroupSection item = Database.GroupSection.Get((int)groupID, (int)sectionID); if (item == null) { throw new ValidationException("Сущность не найдена", ""); } return(item); }
void _superList_DragOver(object sender, SuperlistDragEventArgs e) { // // In this example we're interested if the section over has a grouped section // for an ancestor. If it does then we allow dropping on the section GroupSection gs = e.SectionOver.GetAncestor <GroupSection>(true); if (gs != null) { e.SectionAllowedToDropOn = gs; return; } e.DragEventArgs.Effect = DragDropEffects.None; }
private PLBNode CreateTreeGroupSect(GroupSection section, string prefix) { PLBNode sectNode = new PLBNode(section.Id); PLBNode tempNode = null; sectNode.Name = prefix + '_' + sectNode.Name; sectNode.ContextMenuStrip = MenuContext_Containee; sectNode.item = section; TreeNode groupNode = new TreeNode(sectNode.Name + "_Groups"); groupNode.ContextMenuStrip = MenuContext_Container; groupNode.Text = "Groups"; if (section.Groups != null) { foreach (Group group in section.Groups) { groupNode.Nodes.Add(CreateTreeGroup(group, sectNode.Name)); } } TreeNode itemNode = new TreeNode(sectNode.Name + "_Items"); itemNode.ContextMenuStrip = MenuContext_Container; itemNode.Text = "Items"; if (section.Items != null) { foreach (ItemEntry item in section.Items) { tempNode = new PLBNode(item.Id); tempNode.Name = itemNode.Name + '_' + tempNode.Name; tempNode.ContextMenuStrip = MenuContext_Containee; tempNode.item = item; itemNode.Nodes.Add(tempNode); } } sectNode.Nodes.AddRange(new TreeNode[] { groupNode, itemNode }); return(sectNode); }
public LeftMenuPage GoToSelector(MenusType menusType, SubSectionMenu subSectionMenu) { if (menusType == MenusType.Album) { AlbumSection.Click(); Thread.Sleep(500); if (subSectionMenu == SubSectionMenu.List) { AlbumListSection.Click(); } else if (subSectionMenu == SubSectionMenu.Create) { AlbumCreateSection.Click(); } else if (subSectionMenu == SubSectionMenu.Update) { AlbumUpdateSection.Click(); } } else { GroupSection.Click(); Thread.Sleep(500); if (subSectionMenu == SubSectionMenu.List) { GroupListSection.Click(); } else if (subSectionMenu == SubSectionMenu.Create) { GroupCreateSection.Click(); } else if (subSectionMenu == SubSectionMenu.Update) { GroupUpdateSection.Click(); } } return(this); }
public PLBControlGroupSection(PLBNode nd) : base(nd) { section = (GroupSection)node.item; InitializeComponent(); InitData(); }
// ---------------- методы ---------------- public ScheduleViewModel () { //Инициализация данных Title = "Расписание"; dateSchedule = DateTime.Now; CloseCommand = new RelayCommand (o => { var intent = CreateIntent (); intent.GoBack (); }); FromScheduleCommand = new RelayCommand (o => { var vc = o as UIViewController; if(vc!=null){ var fromSearchList = FromStations (); ShowSearchSearchView("from", vc,fromSearchList); } }); ToScheduleCommand = new RelayCommand (o => { var vc = o as UIViewController; if(vc!=null){ var toSearchList = ToStations (); ShowSearchSearchView("to", vc,toSearchList); } }); items = new GroupRoot (); section1 = new GroupSection (); fromCell = new GroupCell (); fromCell.Tag = CellType_FromSchedule; fromCell.CellStyle = GroupCellStyle.Custom | GroupCellStyle.RowClick; fromCell.SecondaryText="From"; toCell = new GroupCell (); toCell.Tag = CellType_ToSchedule; toCell.CellStyle = GroupCellStyle.Custom | GroupCellStyle.RowClick; toCell.SecondaryText="To"; dateCell = new GroupCell (); dateCell.Tag = CellType_DateSchedule; dateCell.CellStyle = GroupCellStyle.Custom | GroupCellStyle.RowClick; dateCell.PrimaryText="Date"; dateCell.SecondaryText = DateScheduleToString; dateCell.Command = new RelayCommand (o => { OnShowSelectDateHandler(o); }); switchCell = new GroupCell (); switchCell.CellStyle = GroupCellStyle.Custom | GroupCellStyle.RowClick; switchCell.PrimaryText = "Отображать все станции"; switchCell.Tag = CellType_Switch; switchCell.Data = true; section1.Add (fromCell); section1.Add (toCell); section1.Add (dateCell); section1.Add (switchCell); items.Add (section1); }
// ---------------- методы ---------------- public InfoStationViewModel (Station station) { Title = "Станция"; //Инициализация данных от станции //Создание списка данных и последающая их передача вьюшке this.station = station; CloseCommand = new RelayCommand (o => { var intent = CreateIntent (); intent.GoBack (); }); items = new GroupRoot (); var section1 = new GroupSection (); var section2 = new GroupSection (); //ячейка - Страна var countryCell = new GroupCell (); countryCell.CellStyle = GroupCellStyle.Custom| GroupCellStyle.RowClick; countryCell.PrimaryText = "Country"; countryCell.Tag = CellType_Default; countryCell.SecondaryText = station.CountryTitle; section1.Add (countryCell); //ячейка - Город var cityCell = new GroupCell (); cityCell.CellStyle = GroupCellStyle.Custom| GroupCellStyle.RowClick; cityCell.PrimaryText = "City"; cityCell.Tag = CellType_Default; cityCell.SecondaryText = station.CityTitle; section1.Add (cityCell); if (!string.IsNullOrEmpty (station.RegionTitle)) { //ячейка - Регион var regionCell = new GroupCell (); regionCell.CellStyle = GroupCellStyle.Custom| GroupCellStyle.RowClick; regionCell.PrimaryText = "Region"; regionCell.Tag = CellType_Default; regionCell.SecondaryText = station.RegionTitle; section1.Add (regionCell); } if (!string.IsNullOrEmpty (station.StationTitle)) { //ячейка - Описание станции var titleCell = new GroupCell (); titleCell.CellStyle = GroupCellStyle.Custom| GroupCellStyle.RowClick; titleCell.PrimaryText = station.StationTitle; titleCell.Tag = CellType_ExtendedText; section1.Add (titleCell); } items.Add (section1); //Если есть данные о локации if (station.Point != null) { //ячейка - локация var pointCell = new GroupCell (); pointCell.CellStyle = GroupCellStyle.Custom | GroupCellStyle.RowClick; pointCell.PrimaryText = "Point"; pointCell.Tag = CellType_Date; pointCell.Data = station; pointCell.Command = new RelayCommand (o => { OpenMapForPlace(); }); section2.Add (pointCell); items.Add (section2); } }
public void Edit(GroupSection model) { Database.GroupSection.Update(model); Database.Save(); }
public void Delete(GroupSection model) { Database.GroupSection.Delete(model.GroupID, model.SectionID); Database.Save(); }
public void Create(GroupSection model) { Database.GroupSection.Create(model); Database.Save(); }