public void GetUserApplicationEmptyIdentifier() { var core = new ApplicationCore(); core.Get(new Application()); }
public void GetApplicationInformationNullUser() { var core = new ApplicationCore(); core.Get(null, Guid.NewGuid()); }
public void GetUserApplicationNull() { var core = new ApplicationCore(); core.Get((Application)null); }
public void GetApplicationInformationNull() { var core = new ApplicationCore(); core.Get((ApplicationInformation)null); }
public RoutesDefaultsWithLanguage(ApplicationCore core) : base(core) { Language = core.Get <Core.Languages.Manager>().GetUserLanguage().ShortName; }
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()); } } }
/// <summary> /// Get Applications /// </summary> /// <returns>Application Details Models</returns> private IEnumerable <ApplicationDetailsModel> GetApplications() { var applications = appCore.Get(User.Identity.Data(), ServerConfiguration.ApplicationIdentifier); return(applications.Convert(User.Identity.Data())); }