Пример #1
0
        public ActionResult Create(string appType, Models.Applications.NewApplicationDetails model)
        {
            // Setup url for notification
            var url = Url.Action("Index", "Applications", null, Request.Url.Scheme);

            // Setup name
            var data = (NewApplicationDetails)model;

            data.Name = model.Name;

            // Create application
            Application application = _applications.Create(url, model, LoggedInUser);

            // Log details for industry good application
            if (application.IsIntroducedAsIndustryGood)
            {
                // Log industry good action
                _auditLog.Log(AuditStream.General, "Industry Good",
                              new
                {
                    id    = LoggedInUser.ID,
                    email = LoggedInUser.Email
                },
                              new
                {
                    remote_ip = Request.UserHostAddress,
                    browser   = Request.Browser.Browser
                });
            }

            // Setup status message
            Toastr.Success("Service was successfully created");
            return(RedirectToAction("Details", new { id = application.ID }));
        }
Пример #2
0
        public ActionResult Create(string appType)
        {
            // Check whether organisation is active
            if (!LoggedInUser.Organization.IsActive)
            {
                throw new BaseException("Your organization is inactive. Please check if your organization has approved Legal Officer. For more details contact DataLinker administrator.");
            }

            // Setup application model
            var model = new Models.Applications.NewApplicationDetails();

            model.AppType    = appType.Equals("service") ? "provider" : "consumer";
            model.IsProvider = appType.Equals("service");
            // Return result
            return(PartialView("_Create", model));
        }