public ActionResultDTO Post(ComputerBootMenuEntity tObject) { Request.Method = Method.POST; Request.AddJsonBody(tObject); Request.Resource = string.Format("api/{0}/Post/", Resource); var response = _apiRequest.Execute <ActionResultDTO>(Request); if (response.Id == 0) { response.Success = false; } return(response); }
public void UpdateGroupMemberBootMenus(GroupBootMenuEntity groupBootMenu) { foreach (var computer in new GroupServices().GetGroupMembersWithImages(groupBootMenu.GroupId)) { var computerBootMenu = new ComputerBootMenuEntity { ComputerId = computer.Id, BiosMenu = groupBootMenu.BiosMenu, Efi32Menu = groupBootMenu.Efi32Menu, Efi64Menu = groupBootMenu.Efi64Menu }; new ComputerBootMenuServices().UpdateComputerBootMenu(computerBootMenu); new ComputerServices().ToggleComputerBootMenu(computer.Id, true); } }
public ActionResultDTO UpdateComputerBootMenu(ComputerBootMenuEntity computerBootMenu) { if (_uow.ComputerBootMenuRepository.Exists(x => x.ComputerId == computerBootMenu.ComputerId)) { computerBootMenu.Id = _uow.ComputerBootMenuRepository.GetFirstOrDefault( x => x.ComputerId == computerBootMenu.ComputerId).Id; _uow.ComputerBootMenuRepository.Update(computerBootMenu, computerBootMenu.Id); } else { _uow.ComputerBootMenuRepository.Insert(computerBootMenu); } _uow.Save(); var result = new ActionResultDTO(); result.Success = true; result.Id = computerBootMenu.Id; return(result); }
public ActionResultDTO Post(ComputerBootMenuEntity computerBootMenu) { return(_computerBootMenuServices.UpdateComputerBootMenu(computerBootMenu)); }