public void SetDefaultUserProject(int projectId, string userId) { var writeUserProjectRepository = _userProjectRepositoryFactory.GetWrite(_unitOfWork); var userProject = new UserProjectEntity { ProjectId = projectId, UserId = userId, IsDeafult = true }; writeUserProjectRepository.UpdateAttached(userProject, up => up.IsDeafult); }
void LoadUserProjectComplete(object sender, EventArgs e) { UserProjectEntityDictionary.Clear(); LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.user_project user_project in loadOperation.Entities) { UserProjectEntity lUserProjectEntity = new UserProjectEntity(); lUserProjectEntity.UserProject = user_project; lUserProjectEntity.Update(); UserProjectEntity lUserProjectEntityTemp; if (!UserProjectEntityDictionary.TryGetValue(lUserProjectEntity.ManufactureNumber, out lUserProjectEntityTemp)) { UserProjectEntityDictionary.Add(lUserProjectEntity.ManufactureNumber, lUserProjectEntity); } } LoadOperation <ProductManager.Web.Model.department> loadOperationDepartment = SystemManageDomainContext.Load <ProductManager.Web.Model.department>(SystemManageDomainContext.GetDepartmentQuery()); loadOperationDepartment.Completed += loadOperationDepartment_Completed; }