Ejemplo n.º 1
0
 private void EnsureDescriptors()
 {
     if (_descriptors == null)
     {
         _descriptors            = new AnalysisDictionary <string, PropertyDescriptorValue>();
         _descriptorDependencies = new DependentData();
     }
 }
Ejemplo n.º 2
0
        private void AddDependent(DependentData newDependent, int employeeId)
        {
            try
            {
                _sql.LoadData <EmployeeData, dynamic>("dbo.spDependent_Insert", new { newDependent.FirstName, newDependent.LastName, DependentType = newDependent.DependentType, EmployeeId = employeeId, IsActive = newDependent.IsActive }, "EmployeeBenefits");
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        private void UpdateDependent(DependentData updatedDependent)
        {
            try
            {
                _sql.LoadData <EmployeeData, dynamic>("dbo.spDependent_Update", new { updatedDependent.FirstName, updatedDependent.LastName, DependentType = updatedDependent.DependentType, DependentId = updatedDependent.DependentId, IsActive = updatedDependent.IsActive }, "EmployeeBenefits");
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 4
0
        public async Task FetchData()
        {
            if (_loaded)
            {
                return;
            }
            //Find for first
            var data = await new AnimeSearchQuery(Utils.CleanAnimeTitle(DependentTitle)).GetRequestResponse();

            data = WebUtility.HtmlDecode(data);
            data = data.Replace("&mdash", "").Replace("&rsquo", "").Replace("&", "");

            var parsedData = XDocument.Parse(data);
            var elements   = parsedData.Element("anime").Elements("entry");

            DependentData = elements.First(element => Convert.ToInt32(element.Element("id").Value) == DependentId);

            //Find for second
            data = await new AnimeSearchQuery(Utils.CleanAnimeTitle(RecommendationTitle)).GetRequestResponse();
            data = WebUtility.HtmlDecode(data);
            data = data.Replace("&mdash", "").Replace("&rsquo", "").Replace("&", "");

            parsedData         = XDocument.Parse(data);
            elements           = parsedData.Element("anime").Elements("entry");
            RecommendationData =
                elements.First(element => Convert.ToInt32(element.Element("id").Value) == RecommendationId);

            //If for some reason we fail
            if (DependentData == null || RecommendationData == null)
            {
                throw new ArgumentNullException(); // I'm to lazy to create my own so this will suffice
            }
            //Set data - Dependant

            DependentGlobalScore = float.Parse(DependentData.Element("score").Value);
            DependentType        = DependentData.Element("type").Value;
            DependentStatus      = DependentData.Element("status").Value;
            DependentSynopsis    =
                Regex.Replace(DependentData.Element("synopsis").Value, @"<[^>]+>|&nbsp;", "")
                .Trim()
                .Replace("[i]", "")
                .Replace("[/i]", "");
            DependentStartDate = DependentData.Element("start_date").Value;
            DependentEndDate   = DependentData.Element("end_date").Value;
            DependentImgUrl    = DependentData.Element("image").Value;
            DependentEpisodes  = DependentData.Element("episodes").Value;

            //Set data - Recom
            RecommendationGlobalScore = float.Parse(RecommendationData.Element("score").Value);
            RecommendationType        = RecommendationData.Element("type").Value;
            RecommendationStatus      = RecommendationData.Element("status").Value;
            RecommendationSynopsis    =
                Regex.Replace(RecommendationData.Element("synopsis").Value, @"<[^>]+>|&nbsp;", "")
                .Trim()
                .Replace("[i]", "")
                .Replace("[/i]", "");
            RecommendationStartDate = RecommendationData.Element("start_date").Value;
            RecommendationEndDate   = RecommendationData.Element("end_date").Value;
            RecommendationImgUrl    = RecommendationData.Element("image").Value;
            RecommendationEpisodes  = RecommendationData.Element("episodes").Value;

            //Okay we got this data
            _loaded = true;
        }