示例#1
0
    public void InitializeQuestTable(ApplicationModel applicationModelInstance_)
    {
        /* Create Main Quests */
        QuestKill _mainQuestOne = new QuestKill();
        _mainQuestOne.ConstructQuest();
        _mainQuestOne.Title = "Primeira Quest";
        _mainQuestOne.Description = "Primeira quest de todas as quests do jogo";
        _mainQuestOne.QuestActionType = QuestActionTypeEnum.KILL;
        _mainQuestOne.QuestType = QuestTypeEnum.MAIN;
        _mainQuestOne.Active = true;
        _mainQuestOne.TargetAmount = 3;
        _mainQuestOne.CurrentAmount = 0;
        //_mainQuestOne.TargetID = EnemyTable.GetMainQuestOneEnemyId;

        QuestBase _mainQuestTwo = new QuestBase();
        _mainQuestOne.QuestChild = _mainQuestTwo;
        _mainQuestTwo.QuestFather = _mainQuestOne;
        _mainQuestTwo.Title = "Segunda Quest";
        _mainQuestTwo.Description = "Segunda quest de todas as quests principais do Jogo";
        _mainQuestTwo.QuestType = QuestTypeEnum.MAIN;
        _mainQuestTwo.QuestActionType = QuestActionTypeEnum.DELIVER;

        QuestBase _mainQuestThre = new QuestBase();
        _mainQuestTwo.QuestChild = _mainQuestThre;
        _mainQuestThre.QuestFather = _mainQuestTwo;
    }
示例#2
0
 public AXAClaimController(IUnityContainer unityContainer, IClaimClientService claimClientService, IMetadataClientService metadataClientService, ApplicationModel applicationModel, AXAClaimModel claimModel, ClaimsPayloadManager claimPayloadManager, ClaimsRetrievalManager claimsRetrievalManager, IClaimNameSearchHandler claimNameSearchHandler, AppModel appModel, IClaimViewResolver viewResolver, AXAClaimAmountHistoryController claimAmountHistoryController, ISearchServiceHandler searchService, IClaimTreeviewResolver treeviewResolver, INameService nameService, IEventAggregator eventAggregator, IShellRulesHelper rulesHelper, IClaimsCodeLookupService claimscodelookupservice)
     : base(claimClientService, metadataClientService, claimModel, claimPayloadManager, claimsRetrievalManager, claimNameSearchHandler, appModel, viewResolver, claimAmountHistoryController, treeviewResolver, eventAggregator, rulesHelper, searchService, unityContainer, claimscodelookupservice)
 {
     this.appModel = appModel;
     this._gdiModel = Container.Resolve<AXAGenericDataItemModel>();
     this.claimModel = claimModel;
     this.claimModel.GenericDataItemModel = this._gdiModel;
     this._payloadManager = claimPayloadManager;
     this._nameSearchHandler = claimNameSearchHandler;
     this.claimModel.ReloadTotals += new EventHandler(this.Model_ReloadTotals);
     this.claimModel.ReloadClaimants += new EventHandler(this.ClaimModel_ReloadClaimants);
     this.claimModel.DuplicateClaimCheckClick += new EventHandler<XIAP.Frontend.Infrastructure.Events.CommandEventArgs<ClaimHeaderDto>>(this.ClaimModel_DuplicateClaimCheckClick);
     this.claimModel.CustomCoverageVerification += new EventHandler(this.ClaimModel_CustomCoverageVerification);
     this.claimModel.NameInvolvementModel.GetNameForNameInvolvement += new EventHandler(this.NameInvolvementModel_GetNameForNameInvolvement);
     this.searchService = searchService;
     this.claimModel.TargetHeaderStatusCodeChanged += new EventHandler(this.ClaimModel_TargetHeaderStatusCodeChanged);
     this._genericDataSetBuilder = new ClaimsDataBuilder(claimPayloadManager);
     this._gdsController = new AXAGenericDataSetController((ClaimControllerBase<ClaimModel>)this, claimModel, this._gdiModel, this.Container, metadataClientService, this._genericDataSetBuilder);
     this.SetNumberOfGenericDataItemNodesToBeLoaded();
     this._nameService = nameService;
     this.claimModel.ValidateClaim += new EventHandler(this.ClaimModel_ValidateClaim);
     this.claimAmountHistoryController = claimAmountHistoryController;
     this.claimAmountHistoryController.OnPaymentCancellation += new EventHandler(this.ClaimAmountHistoryController_OnPaymentCancellation);
     (this.claimModel.DocumentModel as AXADocumentModel).OnSaveClick += new EventHandler(this.AXAClaimController_OnSaveClick);
     this.retrievalManager = claimsRetrievalManager;
     (this.claimModel.DocumentModel as AXADocumentModel).RetrievalManager = claimsRetrievalManager;
     this.Model.HeaderPropertyChanged += new EventHandler<PropertyChangedEventArgs>(this.AXAClaimController_HeaderPropertyChanged);
     this.claimModel.OnINACTReviewClick += new EventHandler(this.ClaimModel_OnINACTReviewClick);
     this.claimModel.OnInactRecoveryReviewClick += new EventHandler(this.ClaimModel_OnInactRecoveryReviewClick);
 }
 public static DatabaseMessage Add(ApplicationModel addThis)
 {
     return new DatabaseMessage()
     {
         Action = ActionType.Add,
         Application = addThis
     };
 }
 public static DatabaseMessage Remove(ApplicationModel updateThis)
 {
     return new DatabaseMessage()
     {
         Action = ActionType.Remove,
         Application = updateThis
     };
 }
 public AXAPolicyRiskController(IUnityContainer container, ApplicationModel applicationModel, IRiskService riskService, ISearchServiceHandler searchservicehandler, IUwNameSearchHandler uwNameSearchHandler, IMetadataClientService metadataService, AXARiskModel policyWizardModel, UwPayloadManager payloadManager, UwRetrievalManager retrievalManager, AppModel appModel, IUwViewResolver viewresolver, IEventAggregator eventAggregator, IShellRulesHelper rulesHelper, IConverter<Xiap.Metadata.Data.Enums.StaticValues.ClaimLinkLevel, PolicyAttachmentGroupingLevel> claimLinkLevelPolicyAttachmentLevelConverterParam)
     : base(applicationModel, riskService, searchservicehandler, uwNameSearchHandler, metadataService, policyWizardModel, payloadManager, retrievalManager, appModel, viewresolver, eventAggregator, rulesHelper, container, claimLinkLevelPolicyAttachmentLevelConverterParam)
 {
     this.riskModel = policyWizardModel;
     this.riskModel.OnUpdateFromGeniusClick += new EventHandler<CommandEventArgs<HeaderDto>>(this.RiskModel_OnUpdateFromGeniusClick);
     this.riskModel.OnPolicySummaryClick += new EventHandler<CommandEventArgs<HeaderDto>>(this.RiskModel_OnPolicySummaryClick);
     this._payloadManager = payloadManager;
 }
 public AXAUnderwritingModule(ApplicationModel application, IUnityContainer container, IRegionManager regionManager, IEventAggregator eventAggregator, NavigationManager navigationManager)
     : base(container, eventAggregator,navigationManager)
 {
     this._application = application;
     this._container = container;
     this._regionManager = regionManager;
     this._eventAggregator = eventAggregator;
     this._navigationManager = navigationManager;
 }
 void IWorkflowInstanceService.Save(ApplicationModel.WorkflowInstance workflowInstance)
 {
     if (workflowInstance.Id == 0)
     {
         this.workflowInstanceRepository.Insert(workflowInstance);
     }
     else
     {
         this.workflowInstanceRepository.Update(workflowInstance);
     }
     unitOfWork.Commit();
 }
 public  ApplicationModel TestModel(string code, string testresult = null) {
     var ctx = BSharpCompiler.Compile(code);
     var model = new ApplicationModel().Setup(ctx);
     if (!model.IsValid) {
         foreach (var error in model.Errors) {
             Console.WriteLine(error.ToLogString());
         }
     }
     Assert.True(model.IsValid);
     var strmodel = model.ToString();
     Console.WriteLine(strmodel);
     if (!string.IsNullOrWhiteSpace(testresult)) {
         Assert.AreEqual(testresult.Trim().LfOnly(), strmodel.Trim().LfOnly());
     }
     return model;
 }
 public ClaimSearchController(ApplicationModel applicationModel, IUnityContainer container, IClaimClientService claimService, AppModel appModel, ISearchServiceHandler searchService, SearchResultsModel searchFilterModel, IMetadataClientService metadataService, IEventAggregator eventAggregator, ClaimSearchModel searchModel)
     : base(eventAggregator, searchFilterModel, container)
 {
     this.ClaimSearchModel = searchModel;
     this._applicationModel = applicationModel;
     this._claimsService = claimService;
     this._metadataService = metadataService;
     this._claimContainer = container;
     this._eventAggregator = eventAggregator;
     this._searchManager = new SearchManager();
     // Close the search tab.
     this.ClaimSearchModel.OnCloseClick += new EventHandler(this._claimSearchModel_OnCloseClick);
     // Display the preview of the selected claim.
     this.ClaimSearchModel.SelectedRowChanged += new EventHandler<SelectedRowChangedEventArgs>(this._claimSearchModel_SelectedRowChanged);
     // Grid paging.
     this.ClaimSearchModel.NeedData += new EventHandler<SearchDataRequestEventArgs>(this._claimSearchModel_NeedData);
     this.ClaimSearchModel.RefreshView += new EventHandler(this._claimSearchModel_RefreshView);
 }
    /// <summary>
    /// Awake this instance.
    /// Implementa o conceito do Singleton para o GameObject, SEMPRE UTILIZAR A VARIAVEL INSTANCE para acessar o objeto por fora da classe por exemplo: ApplicationModel.Instance
    /// </summary>
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);

            myAudioManager = GetComponentInChildren<AudioManager>();

            myConfigurationManager = new ConfigurationManager();
            myConfigurationManager.InitializeConfiguration();

            LoadProjectileTable();

            CreatePoolTable(SpellTable, 25);
            CreatePoolTable(GranadeTable, 20);
        }
        /*else
        {
            Destroy(gameObject);
        }*/
    }
 public Application Create(ApplicationModel model)
 {
     return new Application(model, permissionManager.GetDefaultPermissions());
 }
示例#12
0
        public void Apply(ApplicationModel application)
        {
            foreach (var controller in application.Controllers)
            {
                var controllerName = controller.ControllerName;
                if (controllerName == "Base" || controllerName == "WebBase" ||
                    controllerName == "AdminBase" || controllerName == "Error" || controllerName == "UEditor")
                {
                    continue;
                }
                var isAdminController = controller.ControllerType.BaseType.Equals(typeof(Web.Controllers.Admin.AdminBaseController));
                #region ControllerRoutes
                var matchedSelectors = controller.Selectors.Where(x => x.AttributeRouteModel != null).ToList();
                if (matchedSelectors.Any())
                {
                    foreach (var selectorModel in matchedSelectors)
                    {
                        if (isAdminController)
                        {
                            selectorModel.AttributeRouteModel = AttributeRouteModel.CombineAttributeRouteModel(_adminPrefix, selectorModel.AttributeRouteModel);
                        }
                        else if (_languagePrefix != null)
                        {
                            selectorModel.AttributeRouteModel = AttributeRouteModel.CombineAttributeRouteModel(_languagePrefix, selectorModel.AttributeRouteModel);
                        }
                    }
                }
                var unmatchedSelectors = controller.Selectors.Where(x => x.AttributeRouteModel == null).ToList();
                if (unmatchedSelectors.Any())
                {
                    foreach (var selectorModel in unmatchedSelectors)
                    {
                        if (isAdminController)
                        {
                            selectorModel.AttributeRouteModel = _adminPrefix;
                        }
                        else if (_languagePrefix != null)
                        {
                            selectorModel.AttributeRouteModel = _languagePrefix;
                        }
                    }
                }
                #endregion

                #region ActionRoutes
                foreach (var action in controller.Actions)
                {
                    var selectors = action.Selectors.Where(x => x.AttributeRouteModel == null).ToList();
                    if (selectors.Any())
                    {
                        foreach (var selector in selectors)
                        {
                            if (!isAdminController && action.ActionName.ToLower() == "index")
                            {
                                continue;
                            }
                            if (controllerName != "Home")
                            {
                                string url;
                                if (action.ActionName.ToLower() == "index")
                                {
                                    url = controllerName;
                                }
                                else
                                {
                                    url = $"{controllerName}/{action.ActionName}";
                                }
                                selector.AttributeRouteModel = new AttributeRouteModel(new RouteAttribute(url));
                            }
                            else
                            {
                                selector.AttributeRouteModel = new AttributeRouteModel(new RouteAttribute(action.ActionName));
                            }
                        }
                    }
                }
                #endregion
            }
        }
示例#13
0
 public void Apply(ApplicationModel application)
 {
     ApplyForControllers(application);
 }
 public UpdateDetailsResultConsumer(ApplicationModel applicationModel)
 {
     this.applicationModel = applicationModel;
 }
示例#15
0
        ApplicationModel ApplicationFromXml(XElement xml)
        {
            ApplicationModel application = new ApplicationModel()
            {
                Title = xml.GetValue("Title"),
                FilePath = xml.GetValue("FilePath"),
                RunArguments = xml.GetValue("RunArguments"),
                Tab = xml.GetValue("Tab"),
                ImagePath = xml.GetValue("ImagePath"),
                IsSteamApp = xml.GetValue<bool>("IsSteamApp", false),
                SteamAppNumber = xml.GetValue<int>("SteamAppNumber", 0),
                Installed = xml.GetValue<bool>("Installed", false),
                Installer = xml.GetValue("Installer"),
                InstallArguments = xml.GetValue("InstallArguments"),
                Uninstaller = xml.GetValue("Uninstaller"),
                UninstallArguments = xml.GetValue("UninstallArguments")
            };

            return application;
        }
示例#16
0
        void Update(ApplicationModel updateThis)
        {
            Log.DebugFormat("Update {0}", updateThis.Title);

            var application = GetApplication(updateThis);
            application.ReplaceWith(ApplicationToXml(updateThis));
        }
示例#17
0
 XElement GetApplication(ApplicationModel application)
 {
     return
         (from applicationXml in _database.Element("Applications").Elements("Application")
          where applicationXml.Element("Title").Value == application.Title ||
                applicationXml.Element("Title").Value == application.OldTitle
          select applicationXml).Single();
 }
示例#18
0
 public AddToQueue(IServiceBus bus, ApplicationModel applicationModel)
 {
     this.bus = bus;
     this.applicationModel = applicationModel;
 }
示例#19
0
        public async Task <HttpResponseMessage> Save(EnquiryModel data)
        {
            try
            {
                #region For Add data into Application table
                List <ApplicationModel> applicationModelList = new List <ApplicationModel>();
                ApplicationModel        applicationModel     = new ApplicationModel()
                {
                    //Enquiry_ID = enquiry.Enquiry_ID,
                    ApplicaitonNo = data.ApplicaitonNo,
                    IsSubmitted   = false,
                    Sessionyear   = data.Sessionyear,
                    SchoolID      = data.SchoolID,
                    GroupID       = data.GroupID,
                    CreatedDate   = DateTime.Today
                };
                applicationModelList.Add(applicationModel);
                #endregion

                #region For Add data into CandidateDetail table
                List <CandidateDetailModel> candidateDetailList  = new List <CandidateDetailModel>();
                CandidateDetailModel        candidateDetailModel = new CandidateDetailModel()
                {
                    // Enquiry_ID = data.Enquiry_ID,
                    AdmissionClass_id = data.AdmissionClass_id,
                    FirstName         = data.FirstName,
                    MiddleName        = data.MiddleName,
                    Lastname          = data.Lastname,
                    DOB                 = data.DOB,
                    Email               = data.Email,
                    StudentType_ID      = data.StudentType_ID,
                    ContactMobileNo     = data.ContactMobileNo,
                    hasSibiling         = data.hasSibiling,
                    SiblingAdmNumber_ID = data.SiblingAdmNumber_ID,
                    Address1            = data.Address1,
                    Address2            = data.Address2,
                    City_ID             = data.City_ID,
                    State_ID            = data.State_ID,
                    Country_ID          = data.Country_ID,
                    FatheFirstName      = data.FatheFirstName,
                    FatherMiddleName    = data.FatherMiddleName,
                    FatherLasttName     = data.FatherLasttName,
                    FatherPhoneNumber   = data.FatherPhoneNumber,
                    MotherPhoneNumber   = data.MotherPhoneNumber,
                    MotherFirstName     = data.MotherFirstName,
                    MotherMiddleName    = data.MotherMiddleName,
                    MotherLasttName     = data.MotherLasttName,
                    Sessionyear         = data.Sessionyear,
                    SchoolID            = data.SchoolID,
                    GroupID             = data.GroupID,
                    SubjectId           = data.SubjectId,
                    CreatedDate         = DateTime.Today
                };
                candidateDetailList.Add(candidateDetailModel);
                #endregion

                List <RegistrationModel> RegistrationModelList = new List <RegistrationModel>();
                RegistrationModel        registrationModel     = new RegistrationModel
                {
                    Sessionyear = data.Sessionyear,
                    SchoolID    = data.SchoolID,
                    GroupID     = data.GroupID,
                    CreatedDate = DateTime.Today
                };
                RegistrationModelList.Add(registrationModel);
                EnquiryModel enquiry = new EnquiryModel
                {
                    Applications     = applicationModelList,
                    CandidateDetails = candidateDetailList,
                    Registrations    = RegistrationModelList,
                    CreatedDate      = DateTime.Today,
                    Enquiry_ID       = 0,
                    MarketSource_ID  = data.MarketSource_ID,
                    EnquiryType_ID   = data.EnquiryType_ID,
                    EnquiryNo        = data.EnquiryNo,
                    ISDeleted        = false
                };
                await _enquiry.SaveAsync(enquiry);

                _schoolConfig.UpdateNextNumber(data.NavigationId);
            }
            catch (Exception ex)
            {
                Common.MyLogger.Error(ex.Message + ex.StackTrace + ex.InnerException.ToString());
                return(Request.CreateResponse(HttpStatusCode.BadRequest, "Error"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, "Data Saved"));
        }
示例#20
0
 public FullRemoteApplication(ApplicationModel applicationModel, ISeacRuntimeClient seacRuntimeClient) : base(applicationModel, seacRuntimeClient)
 {
 }
示例#21
0
 static ApplicationModel FindApplication(IEnumerable <ApplicationModel> applications, ApplicationModel application) =>
 applications.FirstOrDefault(m => m.DisplayName == application.DisplayName);
示例#22
0
 public virtual void ValidateModelsInApplication(ApplicationModel <ApplicationSPI> appModel, ApplicationValidationResultMutable appValidation)
 {
     // Do nothing by default
 }
示例#23
0
 public void Apply(ApplicationModel application)
 {
     //throw new NotImplementedException();
 }
 public AXAClaimPopupSearchController(ApplicationModel applicationModel, IUnityContainer container, IClaimClientService claimService, AppModel appModel, ISearchServiceHandler searchService, ClaimSearchModel searchFilterModel, IMetadataClientService metadataService)
     : base(applicationModel, claimService, appModel, searchService, searchFilterModel, metadataService,container)
 {
     this.claimSearchModel = searchFilterModel;
     this.appModel = appModel;
 }
        /// <summary>
        /// Adds permissions to an application function. However, before this is done, checks are run to ensure that the permissions is defined for the application by being present
        /// within at least one of the application functions (created by the micro-service).
        /// </summary>
        /// <param name="application"></param>
        /// <param name="defaultFunction"></param>
        /// <param name="defaultApplication"></param>
        /// <param name="functionModelToAdd"></param>
        private void AddPermissionsToFunctionsEnsuringTheyExistsAndAreAssigedToTheApplication(ApplicationModel application, SecurityContractDefaultConfigurationFunction defaultFunction,
                                                                                              SecurityContractDefaultConfigurationApplication defaultApplication, FunctionModel functionModelToAdd, Guid updatedById)
        {
            foreach (var permissionToAddToFunction in defaultFunction.Permissions)
            {
                bool permissionIsApplicationPermission = false;
                // Ensure the permission actually exists in at least one of the application functions. Only add the permission to the function if it does.
                if (application.ApplicationFunctions == null || application.ApplicationFunctions.Count == 0)
                {
                    logger.Warn($"Application '{defaultApplication.Name}' does not have any associated application functions!");
                    break;
                }

                foreach (var applicationFunction in application.ApplicationFunctions)
                {
                    var permission = applicationFunction.ApplicationFunctionPermissions.Find(afp => afp.Permission.Name == permissionToAddToFunction);
                    if (permission != null)
                    {
                        logger.Debug($"Assigning permission '{permissionToAddToFunction}' to function: '{functionModelToAdd.Name}'.");
                        permission.ChangedBy = updatedById;
                        permissionIsApplicationPermission = true;
                        functionModelToAdd.FunctionPermissions.Add(new FunctionPermissionModel
                        {
                            Function   = functionModelToAdd,
                            Permission = permission.Permission,
                            ChangedBy  = updatedById
                        });
                    }
                }

                if (!permissionIsApplicationPermission)
                {
                    logger.Warn($"Permission '{permissionToAddToFunction}' is not an existing application permission. Not adding it!");
                }
            }

            // Persist the application function, but only if there is at least a single permission associated with it.
            if (functionModelToAdd.FunctionPermissions.Count > 0)
            {
                logger.Debug($"Assigning function '{functionModelToAdd.Name}' to application '{application.Name}'");
                application.Functions.Add(functionModelToAdd);
            }
        }
示例#26
0
        XElement ApplicationToXml(ApplicationModel application)
        {
            XElement xml = new XElement("Application",
                    new XElement("Title", application.Title),
                    new XElement("FilePath", application.FilePath),
                    new XElement("RunArguments", application.RunArguments),
                    new XElement("Tab", application.Tab),
                    new XElement("ImagePath", application.ImagePath),
                    new XElement("IsSteamApp", application.IsSteamApp),
                    new XElement("SteamAppNumber", application.SteamAppNumber),
                    new XElement("Installed", application.Installed),
                    new XElement("Installer", application.Installer),
                    new XElement("InstallArguments", application.InstallArguments),
                    new XElement("Uninstaller", application.Uninstaller),
                    new XElement("UninstallArguments", application.UninstallArguments));

            return xml;
        }
 static public bool SaveData(ApplicationModel appModel)
 {
     return(ApplicationData.SaveData(appModel));
 }
示例#28
0
        void Remove(ApplicationModel removeThis)
        {
            Log.DebugFormat("Remove {0}", removeThis.Title);

            var application = GetApplication(removeThis);
            application.Remove();
        }
        private static StripeCustomerCreateOptions InitializeCreateSubscriptionOptions(ApplicationModel.Billing.CustomerPayment payment)
        {
            var myCustomer = new StripeCustomerCreateOptions();
            // set these properties if it makes you happy
            myCustomer.Email = payment.Email;
            myCustomer.Description = payment.Description;

            // set these properties if using a card
            myCustomer.CardNumber = payment.CardNumber; //how is this coming in?
            myCustomer.CardExpirationYear = payment.CardExpirationYear;
            myCustomer.CardExpirationMonth = payment.CardExpirationMonth;
            myCustomer.CardAddressCountry = payment.CardAddressCountry;                // optional
            myCustomer.CardAddressLine1 = payment.CardAddressLine1;    // optional
            myCustomer.CardAddressLine2 = payment.CardAddressLine2;              // optional
            myCustomer.CardAddressCity = payment.CardAddressCity;        // optional
            myCustomer.CardAddressState = payment.CardAddressState;                  // optional
            myCustomer.CardAddressZip = payment.CardAddressZip;                 // optional
            myCustomer.CardName = payment.CardName;               // optional
            myCustomer.CardCvc = payment.CardCvc;                         // optional

            // set this property if using a token
            myCustomer.PlanId = payment.PlanId;                          // only if you have a plan
            myCustomer.CouponId = (payment.CouponId != null && payment.CouponId != String.Empty) ? payment.CouponId : null;

            return myCustomer;
        }
示例#30
0
        void Add(ApplicationModel addThis)
        {
            Log.DebugFormat("Add {0}", addThis.Title);

            _database.Element("Applications").Add(ApplicationToXml(addThis));
        }
        private static StripeCustomerUpdateOptions InitializeUpdateCustomerOptions(ApplicationModel.Billing.CustomerPayment payment)
        {
            var myCustomer = new StripeCustomerUpdateOptions();

            // set these properties if using a card
            myCustomer.CardNumber = payment.CardNumber; //how is this coming in?
            myCustomer.CardExpirationYear = payment.CardExpirationYear;
            myCustomer.CardExpirationMonth = payment.CardExpirationMonth;
            myCustomer.CardAddressCountry = payment.CardAddressCountry;                // optional
            myCustomer.CardAddressLine1 = payment.CardAddressLine1;    // optional
            myCustomer.CardAddressLine2 = payment.CardAddressLine2;              // optional
            myCustomer.CardAddressCity = payment.CardAddressCity;        // optional
            myCustomer.CardAddressState = payment.CardAddressState;                  // optional
            myCustomer.CardAddressZip = payment.CardAddressZip;                 // optional
            myCustomer.CardName = payment.CardName;               // optional
            myCustomer.CardCvc = payment.CardCvc;                         // optional
            return myCustomer;
        }
 public AXAClaimReopenCloseController(ApplicationModel applicationModel, IClaimClientService claimClientService, IMetadataClientService metadataService, AXAClaimReopenCloseModel model, IUnityContainer container, AppModel appModel)
     : base(applicationModel, claimClientService, metadataService, model, appModel, container)
 {
 }
示例#33
0
 public void Apply(ApplicationModel application)
 {
 }
        private static StripeCustomerUpdateSubscriptionOptions InitializeUpdateSubscriptionOptions(ApplicationModel.Billing.CustomerPayment payment, Organization organization)
        {
            var myCustomer = new StripeCustomerUpdateSubscriptionOptions();

            // set these properties if using a card
            myCustomer.CardNumber = payment.CardNumber; //how is this coming in?
            myCustomer.CardExpirationYear = payment.CardExpirationYear;
            myCustomer.CardExpirationMonth = payment.CardExpirationMonth;
            myCustomer.CardAddressCountry = payment.CardAddressCountry;                // optional
            myCustomer.CardAddressLine1 = payment.CardAddressLine1;    // optional
            myCustomer.CardAddressLine2 = payment.CardAddressLine2;              // optional
            myCustomer.CardAddressCity = payment.CardAddressCity;        // optional
            myCustomer.CardAddressState = payment.CardAddressState;                  // optional
            myCustomer.CardAddressZip = payment.CardAddressZip;                 // optional
            myCustomer.CardName = payment.CardName;               // optional
            myCustomer.CardCvc = payment.CardCvc;                         // optional

            // set this property if using a token
            myCustomer.PlanId = payment.PlanId;                          // only if you have a plan
            myCustomer.CouponId =  (payment.CouponId != null && payment.CouponId != String.Empty) ? payment.CouponId : null;

            myCustomer.Prorate = true;
            if (organization.Subscription.HasTrialed)
            {
                // when the customers trial ends (overrides the plan if applicable)

                // Calculate what day of the week is 36 days from this instant.
                //System.DateTime today = DateTime.Now.ToUniversalTime();
                //Add 3 hours to let Stripe update / account for timezone
                //System.TimeSpan duration = new System.TimeSpan(0, 2, 0, 0);
                //Set time in future
                //System.DateTime threeMinutesFromNow = today.Add(duration);
                //myCustomer.TrialEnd = threeMinutesFromNow;
                myCustomer.TrialEnd = null;
            }
            return myCustomer;
        }
 static public bool UpdateData(ApplicationModel appModel)
 {
     return(ApplicationData.UpdateData(appModel));
 }
        CustomerPayment ISubscriptionService.SaveCustomer(string id, ApplicationModel.Billing.CustomerPayment payment)
        {
            //Save Subscription Need to check first active vs new here
            var organization = this.organizationRepository.Find(payment.OrganizationId, null, null);
            var customerService = new StripeCustomerService();
            if (id != null && id != "null")
            {
                var myCustomer = InitializeUpdateCustomerOptions(payment);
                StripeCustomer stripeCustomer = customerService.Update(id, myCustomer);
            }
            else
            {
                var myCustomer = InitializeCreateSubscriptionOptions(payment);
                StripeCustomer stripeCustomer = customerService.Create(myCustomer);
                id = stripeCustomer.StripeSubscription.CustomerId;
                payment.CustomerId = id;
            }

            organization.Subscription.Status = SubscriptionStatus.ACTIVE;
            organization.Subscription.CustomerBillingId = id;
            if (!String.IsNullOrEmpty(payment.CardNumber))
            {
                organization.Subscription.ExpirationDate = payment.CardExpirationMonth + "/" + payment.CardExpirationYear;
                organization.Subscription.Last4Digits = payment.CardNumber.Substring(payment.CardNumber.Length - 4, 4);
            }
            organization.Subscription.HasTrialed = true;

            var svc = (ISubscriptionService)this;
            svc.SaveSubscription(organization);
            return payment;
        }
示例#37
0
 public void Apply(ApplicationModel application)
 {
     _convention.Value.Apply(application);
 }
示例#38
0
 public AddToQueue(IServiceBus bus, ApplicationModel applicationModel)
 {
     this.bus = bus;
     this.applicationModel = applicationModel;
 }
        /// <summary>
        /// Detects functions that are currently assigned to an application, but do not appear within the security contract definition and removes them.
        /// </summary>
        /// <param name="application"></param>
        /// <param name="securityContractDefaultConfigurationFunctions"></param>
        /// <returns></returns>
        private async Task <ApplicationModel> DetectFunctionsRemovedFromSecurityContractDefaultsAndRemoveFromApplication(ApplicationModel application, List <SecurityContractDefaultConfigurationFunction> securityContractDefaultConfigurationFunctions)
        {
            if (application.Functions.Count > 0)
            {
                logger.Debug($"Application Functions Count: {application.Functions.Count}");
                for (int i = application.Functions.Count - 1; i >= 0; i--)
                {
                    logger.Debug($"Checking whether function: '{application.Functions[i].Name}' should be removed from application '{application.Name}'.");
                    if (!securityContractDefaultConfigurationFunctions.Exists(f => f.Name == application.Functions[i].Name))
                    {
                        logger.Debug($"Function: '{application.Functions[i].Name}' is being removed from '{application.Name}' as it is no longer defined withn the defaults YAML!");
                        // Note: This only removes the function permissions association. The permission will still exist. We cannot remove the permission here, as it may be assigned to other functions.
                        await functionRepository.DeleteAsync(application.Functions[i]);
                    }
                }
            }

            return(application);
        }
 public AXAPolicySearchController(ApplicationModel applicationModel, IUnityContainer container, IRiskService riskService, AppModel appModel, ISearchServiceHandler searchService, AXAPolicySearchModel searchFilterModel, IIDSearches idSearch)
     : base(applicationModel, riskService, appModel, searchService, searchFilterModel, container, idSearch)
 {
     this._model = searchFilterModel;
     this.SetUnderwritingStage();
 }
示例#41
0
 public AXAPersonController(IUnityContainer container, IdPayloadManager idManager, ApplicationModel applicationModel, IInsuranceDirectoryServiceHandler insuranceDirectoryService, PersonModel personModel, IdRetrievalManager retrievalManager, AppModel appModel, IInsuranceDirectoryViewResolver viewresolver, IShellRulesHelper rulesHelper, IMetadataClientService metadataService)
     : base(idManager, applicationModel, insuranceDirectoryService, personModel, retrievalManager, appModel, viewresolver, rulesHelper, container, metadataService, null)
 {
 }
 public static void SelectItem(ApplicationModel.ListBoxNodeBase listBox, string pattern)
 {
     var item = listBox.Items.FirstOrDefault(x => x.Text.Equals(pattern));
     listBox.Select(item);
 }
示例#43
0
 /// <summary>Вызывается для применения соглашения к <see cref="T:Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModel" /></summary>
 /// <param name="application">Модель приложения <see cref="T:Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModel" /></param>
 public void Apply([NotNull] ApplicationModel application) => application.ApiExplorer.IsVisible = true;