Ejemplo n.º 1
0
        public TemplateFile(FormBuilderUtility formBuilder)
        {
            string template = "";

            template = formBuilder.Render();

            this.TemplateFileContentRaw           = template;
            this.TemplateFileContentRepeatRaw     = ProviderBase.Data.Utility.GetTemplateFileElementSingle(this.TemplateFileContentRaw, "repeat");
            this.TemplateFileContentRaw           = ProviderBase.Data.Utility.ReplaceTemplateFileElementSingle(this.TemplateFileContentRaw, "repeat", "REPEAT");
            this.TemplateFileContentRepeatItemRaw = ProviderBase.Data.Utility.GetTemplateFileElement(this.TemplateFileContentRepeatRaw, "repeatitem");
            this.TemplateFileContentRepeatRaw     = ProviderBase.Data.Utility.ReplaceTemplateFileElement(this.TemplateFileContentRepeatRaw, "repeatitem", "REPEATITEM");
        }
Ejemplo n.º 2
0
        public void FormBuilderGet()
        {
            string formBuilderGUID = ProviderBase.Framework.Utility.GetFormValue <string>("FormBuilder_GUID", "");

            if (string.IsNullOrEmpty(formBuilderGUID) == false)
            {
                FormBuilderUtility formBuilderUtility = null;

                formBuilderUtility = new FormBuilderUtility(this.Website, formBuilderGUID);

                this.AjaxResult.Data.Add(formBuilderUtility.Render());
                this.AjaxResult.Message = "Get form builder success";
                this.AjaxResult.Status  = AjaxResultStatus.Success;
            }
            else
            {
                this.AjaxResult.Message = "No form builder GUID supplied";
                this.AjaxResult.Status  = AjaxResultStatus.Failed;
            }
        }
Ejemplo n.º 3
0
        public void GetRecruitmentSummary()
        {
            string formBuilderGUID = ProviderBase.Framework.Utility.GetFormValue <string>("FormBuilder_GUID", "");
            string templateFinal   = "";

            if (string.IsNullOrEmpty(formBuilderGUID) == false)
            {
                FormBuilderUtility    formBuilderUtility = null;
                List <CharacterClass> characterClassList = null;

                formBuilderUtility = new FormBuilderUtility(this.Website, formBuilderGUID);

                characterClassList = ProviderBase.Data.Providers.DataProvider.SelectAll <CharacterClass>(new CharacterClass(), this.Website.WebsiteConnection.ConnectionString);

                templateFinal = formBuilderUtility.Render(characterClassList, this.User);

                this.AjaxResult.Data.Add(templateFinal);
                this.AjaxResult.Message = "Get Recruitment Summary success";
                this.AjaxResult.Status  = AjaxResultStatus.Success;
            }
        }
Ejemplo n.º 4
0
        public void GetBlizzardCharacterProfile()
        {
            string characterName   = ProviderBase.Framework.Utility.GetFormValue <string>("CharacterName", "");
            string realmName       = ProviderBase.Framework.Utility.GetFormValue <string>("RealmName", "");
            string formBuilderGUID = ProviderBase.Framework.Utility.GetFormValue <string>("FormBuilder_GUID", "");
            string templateFinal   = "";

            if (string.IsNullOrEmpty(formBuilderGUID) == false)
            {
                FormBuilderUtility formBuilderUtility = null;

                formBuilderUtility = new FormBuilderUtility(this.Website, formBuilderGUID);

                if (string.IsNullOrEmpty(characterName) == false)
                {
                    if (string.IsNullOrEmpty(realmName) == false)
                    {
                        ExternalCharacter        characterBlizzardAPI = null;
                        ExternalCharacterProfile characterProfile     = null;

                        characterBlizzardAPI = new ExternalCharacter(this.Website);

                        characterProfile = characterBlizzardAPI.GetCharacterProfile(characterName, realmName, CharacterAction.Items, CharacterAction.Stats, CharacterAction.Talents, CharacterAction.Guild, CharacterAction.Progression);

                        if (characterProfile != null)
                        {
                            if (characterProfile.Talents?.Count > 0)
                            {
                                characterProfile.Talents = characterProfile.Talents.Where(x => x.Selected == true).ToList <ExternalCharacterTalent>();

                                foreach (ExternalCharacterTalent talentList in characterProfile.Talents)
                                {
                                    talentList.Talents = talentList.Talents.OrderBy(x => x.Tier).ToList <ExternalCharacterTalentSpell>();
                                }
                            }

                            if (characterProfile?.Progression != null)
                            {
                                ExternalCharacterRaid externalCharacterRaid = null;

                                externalCharacterRaid = characterProfile.Progression.Raids.Last <ExternalCharacterRaid>();

                                characterProfile.Progression.Raids = new List <ExternalCharacterRaid>()
                                {
                                    externalCharacterRaid
                                };
                            }

                            templateFinal = formBuilderUtility.Render(characterProfile, this.User);

                            this.AjaxResult.Data.Add(templateFinal);
                            this.AjaxResult.Message = "Get forum group success";
                            this.AjaxResult.Status  = AjaxResultStatus.Success;
                        }
                        else
                        {
                            this.AjaxResult.Message = "Character not found";
                            this.AjaxResult.Status  = AjaxResultStatus.Failed;
                        }
                    }
                    else
                    {
                        this.AjaxResult.Message = "No realm name supplied";
                        this.AjaxResult.Status  = AjaxResultStatus.Failed;
                    }
                }
                else
                {
                    this.AjaxResult.Message = "No character name supplied";
                    this.AjaxResult.Status  = AjaxResultStatus.Failed;
                }
            }
        }