public async Task <IActionResult> Seo(string urlType = null, int page = 1) { if (urlType == "Not-found" || urlType == null || urlType == "undefined") { return(null); } ViewBag.html = ""; ViewBag.page = page; if (urlType == null) { return(RedirectToAction("Error")); } //check Brand #region Brand Brand objBrand = this.brandBLL.SearchByUrl(urlType); if (objBrand != null) { ViewBag.Title = objBrand.MetaTitle; ViewBag.Name = objBrand.Name; ViewBag.Keyword = objBrand.MetaDescription; ViewBag.Description = objBrand.MetaDescription; ViewBag.Image = objBrand.DefaultImage; return(PartialView("~/Views/Component/BrandComponent.cshtml", objBrand)); } #endregion #region Subgroup SubGroup objSubGroup = this.subGroupBLL.SearchByUrl(urlType); if (objSubGroup != null) { ViewBag.Title = objSubGroup.MetaTitle; ViewBag.Name = objSubGroup.Name; ViewBag.Keyword = objSubGroup.MetaDescription; ViewBag.Description = objSubGroup.MetaDescription; ViewBag.Image = objSubGroup.DefaultImage; return(PartialView("~/Views/Component/SubGroupComponent.cshtml", objSubGroup)); } #endregion #region Categoryfilter Category objCategory = this.categoryBLL.SearchByUrl(urlType); if (objCategory != null) { ViewBag.Title = objCategory.MetaTitle; ViewBag.Name = objCategory.Name; ViewBag.Keyword = objCategory.MetaDescription; ViewBag.Description = objCategory.MetaDescription; ViewBag.Image = objCategory.DefaultImage; return(PartialView("~/Views/Component/CategoryComponent.cshtml", objCategory)); } #endregion // return(NotFound()); }
public void AddKeyField_EmptyKeyFieldsAndFields_AddsFieldToKeyFieldsAndFields() { var testField = new Field("TestField"); var subGroup = new SubGroup("/"); subGroup.AddKeyField(testField); Assert.Contains(testField, subGroup.KeyFields); Assert.Contains(testField, subGroup.Fields); }
public ActionResult DeleteSubGroup(int groupId) { SubGroup current = repository.SubGroup.FirstOrDefault(s => s.SubGroupId == groupId); if (current != null) { repository.SubGroup.Remove(current); } return(Redirect("ManageSubs")); }
public void RemoveGroup_Group_RemovesParentFromChild() { var rootGroup = new TestGroup_InheritsGroupBase("/"); var childGroup = new SubGroup("Child"); rootGroup.AddGroup(childGroup); rootGroup.RemoveGroup(childGroup); Assert.Null(childGroup.Parent); }
private SubGroup Clone(SubGroup sg) { return(new SubGroup { Entries = sg.Entries.ToList(), Tiles = sg.Tiles.ToDictionary(x => x.Key, x => x.Value), Treatment = sg.Treatment, TreatmentSetBy = sg.TreatmentSetBy, }); }
public async Task <IActionResult> DeleteSubGroup(SubGroup subGroup) { _genericsRepo.Delete(subGroup); if (await _genericsRepo.SaveAll()) { return(NoContent()); } return(BadRequest("Delete Failed!")); }
private void LoadSubGroup(string path, int groupIndex) { var subGroupName = new DirectoryInfo(path).Name; var subGroup = new SubGroup(); subGroup.Name = subGroupName; _groups[groupIndex].SubGroups.Add(subGroup); }
public async Task <IActionResult> UpdateSubGroup(SubGroup subGroup) { var updatedSubGroup = await _subGroupsService.UpdateSubGroup(subGroup); if (await _subGroupsService.SaveChangesInContext()) { return(Ok(updatedSubGroup)); } return(BadRequest("Update Failed or the same subgroup was sent")); }
public ActionResult CreateSub(int Parent, Sub sub) { SubGroup group = repository.SubGroup.FirstOrDefault(s => s.SubGroupId == Parent); if (group != null) { group.Subs.Add(sub); } return(Redirect("ManageSubs")); }
public void RemoveGroup_Group_RemovesChildFromGroups() { var rootGroup = new TestGroup_InheritsGroupBase("/"); var subGroup = new SubGroup("Child"); rootGroup.AddGroup(subGroup); rootGroup.RemoveGroup(subGroup); Assert.DoesNotContain(subGroup, rootGroup.SubGroups); }
public ActionResult Edit([Bind(Include = "subgId,subgroupName,subgroupDescription,subgroupIdentity,sGroup")] SubGroup subGroup) { if (ModelState.IsValid) { db.Entry(subGroup).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(subGroup)); }
public ActionResult Create([Bind(Include = "subgId,subgroupName,subgroupDescription,subgroupIdentity,sGroup")] SubGroup subGroup) { if (ModelState.IsValid) { db.SubGroup.Add(subGroup); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(subGroup)); }
public async Task <ActionResult <SubGroup> > Edit(string id, SubGroup value) { value.Id = ObjectId.Parse(id); value.Group = await _Group.GetById(value.GroupId.ToString()); _SubGroup.Update(value, id); await _uow.Commit(); return(RedirectToAction("Index")); }
public void RemoveKeyField_SubGroupOwnsKeyField_RemovesKeyField() { var testField = new Field("TestField"); var subGroup = new SubGroup("/"); subGroup.AddKeyField(testField); Assert.Contains(testField, subGroup.KeyFields); subGroup.RemoveKeyField(testField); Assert.Empty(subGroup.KeyFields); }
// Gets the rotation group containing Tile, creating it if it doesn't exist private void GetGroup(Tile tile, out SubGroup sg) { if (tileToSubGroup.TryGetValue(tile, out sg)) { return; } sg = new SubGroup(); sg.Tiles[new Rotation()] = tile; tileToSubGroup[tile] = sg; }
public ActionResult EditSubPost(int Parent, Sub sub) { SubGroup group = repository.SubGroup.FirstOrDefault(s => s.SubGroupId == Parent); if (group != null) { repository.Sub.Update(sub); } return(Redirect("ManageSubs")); }
private void RegisterSubGroupsOrDetailReceiver(InitializationContext context, TableDetail tableDetail) { if (SubGroup != null) { SubGroup.RegisterReceiver(context, tableDetail); } else { tableDetail?.RegisterReceiver(context); } }
public static void CreateTileNotification(ClassInstance classInstance, DateTime next) { var tile = AdaptiveTile.CreateTile(); var binding = TileBinding.Create(TemplateType.TileWide); binding.Branding = Branding.None; var subgroup = new SubGroup(); if (classInstance.classData != null) { var header = new Text(classInstance.classData.ToString()) { Style = TextStyle.Body }; subgroup.AddText(header); } if (classInstance.from != null) { var dateTime = new Text(Data.loader.GetString(classInstance.weekDay.ToString()) + " " + classInstance.from) { Style = TextStyle.Body }; subgroup.AddText(dateTime); } if (classInstance.room != null) { var classRoom = new Text(classInstance.room) { Style = TextStyle.Caption }; subgroup.AddText(classRoom); } if (classInstance.teacher != null) { var teacher = new Text(classInstance.teacher.ToString()) { Style = TextStyle.Caption }; subgroup.AddText(teacher); } binding.Add(subgroup); tile.Tiles.Add(binding); TileNotification tn = tile.GetNotification(); tn.ExpirationTime = new DateTimeOffset(next); TileUpdateManager.CreateTileUpdaterForApplication().Update(tn); }
public async Task <SpecializationForReturnDto> UpdateSubGroup(SubGroup subGroup) { var updatedSubGroup = await GetGroupById(subGroup.Id); updatedSubGroup.Name = subGroup.Name; updatedSubGroup.GroupId = subGroup.GroupId; var mappedDubGroup = _mapper.Map <SpecializationForReturnDto>(updatedSubGroup); return(mappedDubGroup); }
public void RemoveGroup_ParentDoesNotContainChild_DoesNothing() { var rootGroup = new TestGroup_InheritsGroupBase("/"); var subGroup = new SubGroup("Child"); var otherSubGroup = new SubGroup("Other"); rootGroup.AddGroup(subGroup); rootGroup.RemoveGroup(otherSubGroup); Assert.Contains(subGroup, rootGroup.SubGroups); Assert.DoesNotContain(otherSubGroup, rootGroup.SubGroups); }
public IActionResult Update(Guid id, SubGroup modelIn) { var model = _subGroupService.GetById(id); if (model == null) { return(NotFound()); } _subGroupService.Update(modelIn); return(NoContent()); }
public void RemoveField_KeyFieldHasFieldAndGroupOwnsKeyField_RemovesKeyField() { var testField = new Field("TestField"); var subGroup = new SubGroup("/"); subGroup.AddKeyField(testField); Assert.Contains(testField, subGroup.KeyFields); Assert.Contains(testField, subGroup.Fields); subGroup.RemoveField(testField); Assert.DoesNotContain(testField, subGroup.KeyFields); Assert.DoesNotContain(testField, subGroup.Fields); }
private bool Set(SubGroup sg, Rotation rotation, Tile tile, string action) { if (sg.Tiles.TryGetValue(rotation, out var current)) { if (current != tile) { throw new Exception($"Cannot {action}: conflict between {current} and {tile}"); } return(false); } sg.Tiles[rotation] = tile; return(true); }
private void LoadAndParseSettingsFiles() { UserLevel userLevelToAddTo = null; Category categoryToAddTo = null; Group groupToAddTo = null; SubGroup subGroupToAddTo = null; foreach (string line in AggContext.StaticData.ReadAllLines(Path.Combine("SliceSettings", "Layouts.txt"))) { if (line.Length > 0) { string sanitizedLine = line.Replace('"', ' ').Trim(); switch (CountLeadingSpaces(line)) { case 0: userLevelToAddTo = new UserLevel(sanitizedLine); UserLevels.Add(sanitizedLine, userLevelToAddTo); break; case 2: categoryToAddTo = new Category(sanitizedLine, userLevelToAddTo); userLevelToAddTo.Categories.Add(categoryToAddTo); break; case 4: groupToAddTo = new Group(sanitizedLine, categoryToAddTo); categoryToAddTo.Groups.Add(groupToAddTo); break; case 6: subGroupToAddTo = new SubGroup(sanitizedLine, groupToAddTo); groupToAddTo.SubGroups.Add(subGroupToAddTo); break; case 8: SliceSettingData data = GetSettingsData(sanitizedLine); if (data != null) { subGroupToAddTo.Settings.Add(data); data.OrganizerSubGroup = subGroupToAddTo; userLevelToAddTo.AddSetting(data.SlicerConfigName, subGroupToAddTo); } break; default: throw new Exception("Bad file, too many spaces (must be 0, 2, 4 or 6)."); } } } }
private void Showbtn_Click(object sender, EventArgs e) { string tacc_code = acctxt.Text; if (!SubGroup.IsSubGroup(tacc_code)) { GUIutils.ShowMessage("Account does not exist"); return; } DataTable dt = LedgerBalance.LedgerTable(tacc_code); Report2(dt); }
// GET: SubGroups/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SubGroup subGroup = db.SubGroup.Find(id); if (subGroup == null) { return(HttpNotFound()); } return(View(subGroup)); }
public async Task <bool> SubGroupExists(SubGroup subGroup) { var subGroups = await GetSubGroups(); foreach (var existingSubGroup in subGroups) { if (subGroup.Name == existingSubGroup.Name) { return(true); } } return(false); }
public async Task <IActionResult> EditSubGroup(string id) { //chưa xử lý code SubGroup objsubgroup = await this.SubGroupBLL.Find(id); ViewModels.PM.SubGroup.EditSubGroupViewModel editSubGroupModel = new ViewModels.PM.SubGroup.EditSubGroupViewModel { Name = objsubgroup.Name, Description = objsubgroup.Description, TypeSex = objsubgroup.TypeSex, OldImage = objsubgroup.DefaultImage }; return(View(editSubGroupModel)); }
public static void CreateTileNotification(Task taskInstance) { var tile = AdaptiveTile.CreateTile(); var binding = TileBinding.Create(TemplateType.TileWide); binding.Branding = Branding.None; var subgroup = new SubGroup(); if (!string.IsNullOrWhiteSpace(taskInstance.title)) { var header = new Text(taskInstance.title) { Style = TextStyle.Body }; subgroup.AddText(header); } if (taskInstance.deadline != null) { var dateTime = new Text(taskInstance.deadline.ToString()) { Style = TextStyle.Body, IsNumeralStyle = true }; subgroup.AddText(dateTime); } if (taskInstance.classTarget != null) { var classRoom = new Text(taskInstance.classTarget.ToString()) { Style = TextStyle.Caption, IsSubtleStyle = true }; subgroup.AddText(classRoom); } if (taskInstance.description != null) { var description = new Text(taskInstance.description); subgroup.AddText(description); } binding.Add(subgroup); tile.Tiles.Add(binding); TileNotification tn = tile.GetNotification(); tn.ExpirationTime = new DateTimeOffset(taskInstance.deadline); TileUpdateManager.CreateTileUpdaterForApplication().Update(tn); }
public void AddGroup_SubGroupHasParent_OriginalParentRemovesChild() { var originalParent = new TestGroup_InheritsGroupBase("OriginalParent"); var subGroup = new SubGroup("Child"); originalParent.AddGroup(subGroup); var newParent = new TestGroup_InheritsGroupBase("NewParent"); newParent.AddGroup(subGroup); Assert.DoesNotContain(subGroup, originalParent.SubGroups); Assert.Same(newParent, subGroup.Parent); }
protected Group(Character leader, byte maxGroupUnits) { // m_syncLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); m_syncLock = new ReaderWriterLockSlim(); m_subGroups = new SubGroup[maxGroupUnits]; for (byte i = 0; i < maxGroupUnits; i++) { m_subGroups[i] = new SubGroup(this, i); } m_targetIcons = new EntityId[TargetIconCount]; for (int i = 0; i < m_targetIcons.Length; i++) m_targetIcons[i] = EntityId.Zero; m_lootMethod = LootMethod.GroupLoot; m_lootThreshold = ItemQuality.Uncommon; m_DungeonDifficulty = 0; var member = AddMember(leader, false); Leader = member; m_masterLooter = null; // update will follow when the 2nd guy joins }
/// <summary> /// Moves a member of the raid group into another subgroup. /// </summary> /// <param name="member">the member to move</param> /// <param name="group">the target subgroup</param> /// <returns>Whether the move was successful or false if the target group was full</returns> public bool MoveMember(GroupMember member, SubGroup group) { if (group.IsFull) return false; var oldGroup = member.SubGroup; oldGroup.m_members.Remove(member); group.AddMember(member); return true; }
public bool CheckFull(GroupMember member, SubGroup group) { if (group.IsFull) { var chr = member.Character; if (chr != null) { GroupHandler.SendResult(chr.Client, GroupResult.GroupIsFull); } return false; } return true; }