public void UserIsAssociatedEmptyEditorUserIdentifier() { var core = new ApplicationCore(); var editor = this.UserApplication(Guid.NewGuid()); editor.User.Identifier = Guid.Empty; core.UserIsAssociated(editor, this.App(Guid.NewGuid())); }
public void UserIsAssociatedNullEditorUser() { var core = new ApplicationCore(); var editor = this.UserApplication(Guid.NewGuid()); editor.User = null; core.UserIsAssociated(editor, this.App(Guid.NewGuid())); }
public void UserIsAssociatedEmptyApplicationIdentifier() { var core = new ApplicationCore(); core.UserIsAssociated(this.UserApplication(Guid.NewGuid()), this.App(Guid.Empty)); }
public void UserIsAssociatedNullApplication() { var core = new ApplicationCore(); core.UserIsAssociated(this.UserApplication(Guid.NewGuid()), null); }
public void UserIsAssociatedNullEditor() { var core = new ApplicationCore(); core.UserIsAssociated(null, this.App(Guid.NewGuid())); }
public ActionResult Details(Guid appId) { using (new PerformanceMonitor()) { var app = new Application() { Identifier = appId, }; try { var canCreateApplication = this.CanCreateAnApplication(); if (canCreateApplication && Guid.Empty == appId) { var newApp = new ApplicationDetailsModel() { ApplicationId = Guid.NewGuid(), IsValid = true, New = true, Deleted = false, Active = true, ValidUntil = DateTime.UtcNow.AddYears(1), }; newApp.PublicKey = newApp.ApplicationId.ToAscii85().GetHexMD5(); this.ViewData.Model = newApp; } else if (Guid.Empty != appId && appCore.UserIsAssociated(User.Identity.Editor(), app)) { var info = new ApplicationInformation() { Identifier = appId, }; var appInfo = appCore.Get(info); if (null != appInfo) { var model = appInfo.Convert(); try { if (Guid.Empty != appInfo.OwnerId) { var userCore = new UserCore(); var application = new Application() { Identifier = appId, }; var user = new User() { Identifier = appInfo.OwnerId, }; var userApp = new UserApplication() { Application = application, User = user, }; var userLoaded = userCore.Get(userApp); model.User = userLoaded.Convert().Convert(); } } catch (Exception ex) { log.Log(ex, EventTypes.Error, (int)Fault.Unknown); } this.ViewData.Model = model; } } else { return(this.RedirectToAction("Application")); } ViewBag.CanCreateAnApplication = canCreateApplication; return(this.View()); } catch (Exception ex) { log.Log(ex, EventTypes.Error, (int)Fault.Unknown); return(View()); } } }