Exemplo n.º 1
0
 public IEnumerable <Concept> GetModified()
 {
     return(Concepts
            .Where(concept => concept.Deleted)
            .Select(x => x.CreateConcept())
            .ToList());
 }
Exemplo n.º 2
0
        public IActionResult LikeConcept(int ConceptsId)
        {
            ViewBag.errors = new List <string>();
            if (!loggedIn())
            {
                return(RedirectToAction("Index", "User"));
            }
            System.Console.WriteLine("****************************Inside Like Concept");
            int?UsersId   = HttpContext.Session.GetInt32("UserId");
            var userlikes = _context.Likes.Include(a => a.Users).Include(a => a.Concepts).Where(a => a.UsersId == UsersId && a.ConceptsId == ConceptsId).ToList();

            if (userlikes.Count > 0)
            {
                ViewBag.errors.Add("Can't like a post more than once");
                ViewBag.name     = HttpContext.Session.GetString("name");
                ViewBag.Concepts = GetConcepts();
                int?Id = HttpContext.Session.GetInt32("UserId");
                ViewBag.UsersId = (int)Id;
                return(View("Show"));
            }
            else
            {
                Concepts concept = _context.Concepts.SingleOrDefault(a => a.ConceptsId == ConceptsId);
                Likes    likes   = new Likes {
                    UsersId    = (int)UsersId,
                    ConceptsId = ConceptsId,
                    CreatedAt  = DateTime.Now,
                    UpdatedAt  = DateTime.Now,
                };
                _context.Likes.Add(likes);
                concept.LikeCount += 1;
                _context.SaveChanges();
                return(RedirectToAction("Show"));
            }
        }
Exemplo n.º 3
0
 public IEnumerable <ConceptId> GetDeleted()
 {
     return(Concepts
            .Where(concept => concept.Deleted)
            .Select(x => x.GetId())
            .ToList());
 }
        /// <summary>Creates a new object that is a copy of the current instance.</summary>
        /// <returns>A new object that is a copy of this instance.</returns>
        public object Clone()
        {
            List <FhirConcept> concepts = null;

            if (Concepts != null)
            {
                concepts = Concepts.Select(c => (FhirConcept)c.Clone()).ToList();
            }

            List <FhirValueSetFilter> filters = null;

            if (Filters != null)
            {
                filters = Filters.Select(f => (FhirValueSetFilter)f.Clone()).ToList();
            }

            List <string> linked = null;

            if (LinkedValueSets != null)
            {
                linked = LinkedValueSets.Select(s => (string)s.Clone()).ToList();
            }

            return(new FhirValueSetComposition(
                       System,
                       Version,
                       concepts,
                       filters,
                       linked));
        }
        public ExchangeRequirements_TfNSW_Drainage(List <IfcPropertySetTemplate> propertyTemplates) : base()
        {
            PropertyTemplates.AddRange(propertyTemplates);

            IfcClassification classification = new IfcClassification(new DatabaseIfc(ModelView.Ifc4NotAssigned), "Uniclass2015");

            //Indicitive/candidate sender, receiver, activity, process...
            ApplicableProcess.Add(new IfcClassificationReference(classification)
            {
                Identification = "PM_40_30", Name = "Design information"
            });
            Senders.Add(new IfcClassificationReference(classification)
            {
                Identification = "Ro_50_20_28", Name = "Drainage engineer (D)"
            });
            Receivers.Add(new IfcClassificationReference(classification)
            {
                Identification = "Ro_10_30", Name = "Asset management roles"
            });
            Activities.Add(new IfcClassificationReference(classification)
            {
                Identification = "Ac_05_40", Name = "Design stage activities"
            });
            Activities.Add(new IfcClassificationReference(classification)
            {
                Identification = "Ac_05_60", Name = "Handover and close-out stage activities"
            });

            //Exchange Requirements
            Concepts.Add(new Concept_TfNSW_AllDistributionElements());             // No building element proxies, all elements distribution element
            Concepts.Add(new Concept_TfNSW_StormWaterPipeSingleSweep());           // Future might force pipe axis definition with attributes
            // Validate all Systems are drainage
            // Validate Distribution System is assigned to all elements
            // To be advanced further
        }
Exemplo n.º 6
0
        PayrollConcept ConceptFor(PayrollTag code)
        {
            var            emptyValues = new Dictionary <string, object>();
            PayrollConcept concept     = Concepts.ConceptFor(code.ConceptCode(), code.ConceptName(), emptyValues);

            return(concept);
        }
Exemplo n.º 7
0
        public IActionResult ToLikes(int ConceptsId)
        {
            if (!loggedIn())
            {
                return(RedirectToAction("Index", "User"));
            }
            ViewBag.errors = new List <string>();
            System.Console.WriteLine("****************************likes Concept");
            int?         UsersId = HttpContext.Session.GetInt32("UserId");
            Concepts     concept = _context.Concepts.Include(a => a.Users).SingleOrDefault(a => a.ConceptsId == ConceptsId);
            List <Likes> likes   = _context.Likes
                                   .Include(a => a.Users)
                                   .Where(a => a.ConceptsId == ConceptsId)

                                   .ToList();

            var likers = likes.GroupBy(p => new { p.UsersId, p.ConceptsId })
                         .Select(g => g.First())
                         .ToList();


            ViewBag.Likes   = likers;
            ViewBag.Concept = concept;
            return(View("Likes"));
        }
        public KeyValuePair <int?, string> GetUnitConcept(IDataRecord reader, string conceptName)
        {
            var sourceValue = string.Empty;

            var concept = Concepts.FirstOrDefault(c => c.Name == conceptName);

            if (concept != null)
            {
                var concepts = base.GetConcepts(concept, reader, null).Where(c => c.ConceptId != 0).ToList();
                sourceValue = reader.GetString(concept.Fields[0].Key);

                if (concepts.Count > 0)
                {
                    foreach (var uc in concepts)
                    {
                        if (!string.IsNullOrEmpty(sourceValue) && !string.IsNullOrEmpty(uc.VocabularySourceValue) &&
                            sourceValue.Equals(uc.VocabularySourceValue, StringComparison.Ordinal))
                        {
                            return(new KeyValuePair <int?, string>(uc.ConceptId, sourceValue));
                        }
                    }

                    return(new KeyValuePair <int?, string>(concepts[0].ConceptId, concepts[0].SourceValue));
                }
            }

            return(new KeyValuePair <int?, string>(null, sourceValue));
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[Constants.NameSessionUser] == null)
            {
                Utilities.logout(Page.Session, Page.Response);
            }
            else
            {
                _user = (Users)Session[Constants.NameSessionUser];
            }

            if (!IsPostBack)
            {
                dwconcepto.DataSource = Concepts.getconceptoGratuito();
                dwconcepto.DataBind();
                txtDateStart.Text = DateTime.Today.ToString("dd/MM/yyyy");
                txtDateEnd.Text   = DateTime.Today.ToString("dd/MM/yyyy");

                ConsultaGratuito();

                //if (_user._usv_employee == true && _user._usv_area == "%%")
                //    formForEmployee();
                //else if (_user._usv_employee == true && _user._usv_area != "%%")
                //    formForCustomer();
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Vencimiento de sesion
            if (Session[Constants.NameSessionUser] == null)
            {
                Utilities.logout(Page.Session, Page.Response);
            }
            else
            {
                _user = (Users)Session[Constants.NameSessionUser];
            }

            if (!IsPostBack)
            {
                dwBanks.DataSource = Banks.getAllBanks();
                dwBanks.DataBind();

                dwDepositType.DataSource = Concepts.getConceptsByType();
                dwDepositType.DataBind();

                // calendar.StartDate = DateTime.Now.AddDays(-4);
                // calendar.EndDate = DateTime.Now;
                calendar.SelectedDate = DateTime.Now;

                if ((_user._usu_tip_id == "01" || _user._usu_tip_id == "03"))
                {
                    this.formForCustomer();
                }
                else
                {
                    this.formForEmployee();
                }
            }
        }
Exemplo n.º 11
0
 internal void LinkEntityValueToConcept(EntityValue entityValue, IList <string> conceptIds)
 {
     foreach (var conceptId in conceptIds)
     {
         if (Concepts.ContainsKey(conceptId))
         {
             var concept = Concepts[conceptId];
             entityValue.AddConcept(concept);
             concept.AddEntityValueReference(entityValue);
         }
         else
         {
             LogMessage(entityValue.LineNumber, MessageType.Info, "Entity value " + entityValue.Entity.Name + " > \"" + entityValue.Name + "\" => (warning) concept reference : " + conceptId + " (a conflicting concept with the same canonical value but a different id may have been defined before)");
         }
     }
     if (Concepts.ContainsKey(entityValue.CanonicalValue))
     {
         var concept = Concepts[entityValue.CanonicalValue];
         if (entityValue.Concepts == null || !entityValue.Concepts.Contains(concept))
         {
             entityValue.AddConcept(concept);
             concept.AddEntityValueReference(entityValue);
         }
     }
 }
Exemplo n.º 12
0
        public IActionResult CreateConcept(string Content)
        {
            if (!loggedIn())
            {
                return(RedirectToAction("Index", "User"));
            }


            ViewBag.errors = new List <string>();
            if (Content.Length <= 0)
            {
                ViewBag.errors.Add("Content Can't be empty");
            }
            int?Id = HttpContext.Session.GetInt32("UserId");

            Concepts concept = new Concepts {
                UsersId   = (int)Id,
                Content   = Content,
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now,
            };

            _context.Concepts.Add(concept);
            _context.SaveChanges();
            return(RedirectToAction("Show"));
        }
        public void ShouldReturnAnInstanceOfConcepts()
        {
            setRequireVariables();
            Concepts concepts = client.Concepts(text: text);

            Assert.IsInstanceOfType(concepts, typeof(Concepts));
        }
Exemplo n.º 14
0
    		public static string JsonifyConceptDefinitions(Concepts collection) {
    			var relationStrings = new List<string>();
    			var conceptStrings = new List<string>();
    			var concepts = collection.GetConcepts();
    			foreach (var mode in concepts.Keys) {
    				foreach (var c in concepts[mode]) {
    					var subgroupString = "";
    					if (collection.Type() == ConceptType.PROPERTY && !string.IsNullOrEmpty(c.SubgroupName)) {
    						subgroupString = string.Format(", \"subgroup\": \"{0}\"", c.SubgroupName);
    					}

    					var conceptString = string.Format("{{\"name\":\"{0}\", \"modality\": \"{1}\"{2}}}",
    						c.Name,
    						c.Mode.ToString(),
    						subgroupString);


    					conceptStrings.Add(conceptString);
    				}

    				foreach (var r in collection.GetRelations()) {
    					relationStrings.Add(string.Format("\"{0}{4}{1}{5}{2}{4}{3}\"",
    						r.Origin.Mode.ToString(),
    						collection.GetIndex(r.Origin),
    						r.Destination.Mode.ToString(),
    						collection.GetIndex(r.Destination),
    						ConceptIdSep,
    						JsonRelationConnector));
    					if (r.Bidirectional) {
    						relationStrings.Add(string.Format("\"{0}{4}{1}{5}{2}{4}{3}\"",
    							r.Destination.Mode.ToString(),
    							collection.GetIndex(r.Destination),
    							r.Origin.Mode.ToString(),
    							collection.GetIndex(r.Origin),
    							ConceptIdSep,
    							JsonRelationConnector));
    					}
    				}
    			}

    			var jsonString = string.Format("\"{0}\":[{1}], \"{0}{3}\": [{2}]",
    				collection.Type(),
    				string.Join(", ", conceptStrings.ToArray()),
    				string.Join(", ", relationStrings.ToArray()),
    				JsonRelationSuffix
    			);
    			if (collection.Type() == ConceptType.PROPERTY) {
    				var subgroupStrings = new List<string>();
    				subgroupStrings.AddRange(collection.Subgroups.Select(g =>
    					string.Format("{{\"name\":\"{0}\", \"type\": \"{1}\"}}",
    						g.Name,
    						g.Type.ToString())));
    				jsonString += ", " + string.Format("\"{0}{1}\":[{2}]",
    					              collection.Type(),
    					              JsonSubgroupSuffix,
    					              string.Join(", ", subgroupStrings.ToArray()));
    			}

    			return jsonString;
    		}
        public override IEnumerable <IEntity> GetConcepts(Concept concept, IDataRecord reader,
                                                          KeyMasterOffsetManager keyOffset)
        {
            var personId = reader.GetLong(PersonId);

            var startDate     = reader.GetDateTime(StartDate);
            var endDate       = reader.GetDateTime(EndDate);
            int?typeConceptId = 0;

            if (Concepts != null)
            {
                var periodConceptId = Concepts.FirstOrDefault(c => c.Name == "PeriodConceptId");
                if (periodConceptId != null && concept.Fields != null && concept.Fields.Length > 0)
                {
                    typeConceptId = concept.GetTypeId(concept.Fields[0], reader) ?? 0;
                }
            }

            if (personId.HasValue)
            {
                yield return new ObservationPeriod()
                       {
                           PersonId      = personId.Value,
                           StartDate     = startDate,
                           EndDate       = endDate,
                           TypeConceptId = typeConceptId
                       }
            }
            ;
        }
    }
Exemplo n.º 16
0
        private PayrollConcept NewTermConcept(CodeNameRefer termRefer, IDictionary <string, object> termValues)
        {
            PayrollTag     termTag     = Tags.TagFromModels(termRefer);
            PayrollConcept baseConcept = Concepts.ConceptFromModels(termTag);
            PayrollConcept termConcept = baseConcept.CloneWithValue(termTag.Code, termValues);

            return(termConcept);
        }
Exemplo n.º 17
0
 public override bool IsSameType(Concepts.Ring1.UnitOfMeasure otherUnit)
 {
     if (otherUnit == null)
     {
         return false;
     }
     return otherUnit is MetricLengthUnit;
 }
Exemplo n.º 18
0
        public Bookmark(AnalysisResults analysisResults) : this()
        {
            Title = analysisResults.Metadata.Title;
            Url   = analysisResults.RetrievedUrl;

            // NOTE: categories, concepts and keywords are assumed to be in order from the natural language processor
            Categories.AddRange(analysisResults.Categories.Select(c => c.Label));
            Concepts.AddRange(analysisResults.Concepts.Select(c => c.Text).ToList());
            Keywords.AddRange(analysisResults.Keywords.Select(k => k.Text).ToList());
        }
Exemplo n.º 19
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            return(obj is AnnotatedTest test && test.EquivalanceClass.Equals(EquivalanceClass) && test.IndividualTest.Equals(IndividualTest) &&
                   test.Concepts.OrderBy(o => o).SequenceEqual(Concepts.OrderBy(o => o)));
        }
Exemplo n.º 20
0
        protected void cargarLider()
        {
            // Mostrar Panel de Seleccion de Coordinador
            pnlDwCustomers.Visible = true;
            /// Realizar la consulta de lideres
            dwCustomers.Focus();
            dwCustomers.DataSource = Area.getAllclientes();
            dwCustomers.DataBind();


            dwconcepto.DataSource = Concepts.getconcepto();
            dwconcepto.DataBind();
        }
Exemplo n.º 21
0
        public void AddConcept(Concept concept)
        {
            var concepts = new Concepts()
            {
                Id   = Guid.NewGuid(),
                Name = concept.ToString(),
            };

            foreach (var subcategory in concept.Subcategories)
            {
                concepts.AddSubcategory(subcategory.Id);
            }
            context.Concepts.Add(concepts);
        }
Exemplo n.º 22
0
 public void Search()
 {
     if (!string.IsNullOrWhiteSpace(SearchText))
     {
         MakeAllCategories(visible: false);
         foreach (var item in Concepts.Where(x => x.Name.Equals(SearchText)))
         {
             item.Visible = true;
         }
     }
     else
     {
         MakeAllCategories(visible: true);
     }
 }
Exemplo n.º 23
0
 public static void InsertConcept(Concepts concept)
 {
     using (SuuxEntities ent = new SuuxEntities())
     {
         ent.Concepts.Add(concept);
         if (concept.common)
         {
             InsertOrDeleteConceptCommon(concept, concept.common, ent);
         }
         else
         {
             ent.SaveChanges();
         }
     }
 }
Exemplo n.º 24
0
 private static void InsertOrDeleteConceptCommon(Concepts concept, bool common, SuuxEntities ent)
 {
     using (ent)
     {
         if (common)
         {
             ent.Employees.ToList().ForEach(e => e.Concepts.Add(concept));
         }
         else
         {
             ent.Employees.ToList().ForEach(e => e.Concepts.Remove(concept));
         }
         ent.SaveChanges();
     }
 }
Exemplo n.º 25
0
        public JObject Serialize()
        {
            var outputConfig = new JObject(
                new JProperty("concepts_mutually_exclusive", AreConceptsMutuallyExclusive),
                new JProperty("closed_environment", IsEnvironmentClosed));

            if (Language != null)
            {
                outputConfig["language"] = Language;
            }
            return(new JObject(
                       new JProperty("data", new JObject(
                                         new JProperty("concepts", Concepts.Select(c => c.Serialize())))),
                       new JProperty("output_config", outputConfig)));
        }
Exemplo n.º 26
0
 public List <ExtendedTreeNode> Find(object obj)
 {
     if (obj is IConcept)
     {
         return(Concepts.Find(obj as IConcept, this));
     }
     else if (obj is IStatement)
     {
         return(Statements.Find(obj as IStatement, this));
     }
     else
     {
         throw new NotSupportedException();
     }
 }
        public bool IsValid() //TODO: inherit this from interface
        {
            var isValid = true;

            if (string.IsNullOrEmpty(Title) &&
                string.IsNullOrEmpty(Url) &&
                Categories.IsNullOrEmpty() &&
                Concepts.IsNullOrEmpty() &&
                Keywords.IsNullOrEmpty() &&
                Tags.IsNullOrEmpty())
            {
                isValid = false;
            }

            return(isValid);
        }
Exemplo n.º 28
0
 public static void UpdateConcept(Concepts concept, bool common)
 {
     using (SuuxEntities ent = new SuuxEntities())
     {
         ent.Concepts.Attach(concept);
         ent.Entry(concept).State = EntityState.Modified;
         if (common != concept.common)
         {
             InsertOrDeleteConceptCommon(concept, concept.common, ent);
         }
         else
         {
             ent.SaveChanges();
         }
     }
 }
Exemplo n.º 29
0
        public async Task <ActionResult> CreateConcept(Concepts concept)
        {
            Context.concepts.Add(concept);
            await Context.SaveChangesAsync();

            var item = await Context.concepts
                       .AsNoTracking()
                       .SingleOrDefaultAsync(cntp => cntp.name == concept.name && cntp.languageId == concept.languageId);

            if (item == null)
            {
                return(NotFound(concept));
            }

            return(Ok(item));
        }
Exemplo n.º 30
0
        // evaluate and return result from Results by key of tag
        public IDictionary <TagRefer, PayrollResult> Evaluate(TagRefer payTag)
        {
            uint periodBase = PayrollPeriod.NOW;

            PayrollTag[] pendingUniqCodes = Concepts.CollectPendingCodesFor(Terms);

            var calculationSteps = CreateCalculationSteps(Terms, periodBase, pendingUniqCodes);

            var sortedCalculation = calculationSteps.OrderBy(x => (x.Value));

            this.Results = sortedCalculation.Aggregate(new Dictionary <TagRefer, PayrollResult>(),
                                                       (agr, x) => (agr.Union(new Dictionary <TagRefer, PayrollResult>()
            {
                { x.Key, x.Value.Evaluate(Period, Tags, agr) }
            }).ToDictionary(key => key.Key, value => value.Value)));
            return(GetResult(payTag));
        }
Exemplo n.º 31
0
        public async Task <IActionResult> UpdateConcept(Concepts concept)
        {
            var item = await Context.concepts.SingleOrDefaultAsync(cntp => cntp.id == concept.id);

            if (item == null)
            {
                return(NotFound(item));
            }

            item.name       = concept.name;
            item.category   = concept.category;
            item.method     = concept.method;
            item.languageId = concept.languageId;

            await Context.SaveChangesAsync();

            return(Ok());
        }
Exemplo n.º 32
0
 public MyChirps(Concepts.ChirperId chirper)
 {
     _chirps = new HashSet<ChirpId>();
     Chirper = chirper;
 }