public async Task <IActionResult> Create(SuObjectAndStatusViewModel FromForm) { if (ModelState.IsValid) { var Project = new SuProjectModel { ModifiedDate = DateTime.Now, CreatedDate = DateTime.Now, ProjectStatusId = FromForm.SuObject.Status }; if (FromForm.SuObject.NullId != 0) { Project.ParentProjectId = FromForm.SuObject.NullId; } var NewProject = _Project.AddProject(Project); var CurrentUser = await _userManager.GetUserAsync(User); var ProjectLanguage = new SuProjectLanguageModel { Name = FromForm.SuObject.Name, Description = FromForm.SuObject.Description, MouseOver = FromForm.SuObject.MouseOver, ProjectId = NewProject.Id, LanguageId = CurrentUser.DefaultLanguageId }; _ProjectLanguage.AddProjectLanguage(ProjectLanguage); } return(RedirectToAction("Index")); }
public SuProjectLanguageModel UpdateProjectLanguage(SuProjectLanguageModel suProjectLanguageChanges) { var changedProjectLanguage = context.DbProjectLanguage.Attach(suProjectLanguageChanges); changedProjectLanguage.State = Microsoft.EntityFrameworkCore.EntityState.Modified; context.SaveChanges(); return(suProjectLanguageChanges); }
public IActionResult LanguageCreate(SuObjectLanguageEditGetWitLanguageListModel FromForm) { if (ModelState.IsValid) { var ProjectLanguage = new SuProjectLanguageModel { Name = FromForm.SuObject.Name, Description = FromForm.SuObject.Description, MouseOver = FromForm.SuObject.MouseOver, ProjectId = FromForm.SuObject.OId, LanguageId = FromForm.SuObject.LanguageId }; _ProjectLanguage.AddProjectLanguage(ProjectLanguage); } return(RedirectToAction("LanguageIndex", new { Id = FromForm.SuObject.OId.ToString() })); }
public SuProjectLanguageModel AddProjectLanguage(SuProjectLanguageModel suProjectLanguage) { context.DbProjectLanguage.Add(suProjectLanguage); context.SaveChanges(); return(suProjectLanguage); }