Exemplo n.º 1
0
        public IHttpActionResult GetInsight(Guid id)
        {
            Insight     insight     = db.Insights.Find(id);
            InsightData insightdata = new InsightData();

            if (insight == null)
            {
                return(NotFound());
            }
            User user = db.Users.Find(insight.UserId);

            //var role = _userManager.GetRoles(user.Id.ToString()).FirstOrDefault();// to get the users role

            insightdata.Id         = insight.Id;
            insightdata.insight    = insight.insight;
            insightdata.RowVersion = insight.RowVersion;
            insightdata.TimeStamp  = insight.TimeStamp;
            insightdata.Url        = insight.Url;
            insightdata.User       = user;
            insightdata.Reactions  = db.Reactions.Where(m => m.UserId.Equals(insight.UserId)).Count();

            insightdata.Status = "Member";// role;



            return(Ok(insightdata));
        }
Exemplo n.º 2
0
 public void SetObject(InsightData data)
 {
     GetComponent <CanvasGroup>().alpha = 1;
     description.text = data.description;
     title.text       = data.firstClue.clueName + " + " + data.secondClue.clueName;
     //icon.sprite = data.image;
 }
Exemplo n.º 3
0
        public List <InsightData> GetInsights()
        {
            List <Insight>     insights     = db.Insights.ToList();
            List <InsightData> insightDatas = new List <InsightData>();

            foreach (Insight i in insights)
            {
                InsightData d = new InsightData();
                // var role = _userManager.GetRoles(i.UserId.ToString()).FirstOrDefault();// to get the users role

                d.Id         = i.Id;
                d.insight    = i.insight;
                d.RowVersion = i.RowVersion;
                d.TimeStamp  = i.TimeStamp;
                d.Url        = i.Url;
                d.User       = db.Users.Find(i.UserId);
                d.Status     = "Member";// role;
                d.Reactions  = db.Reactions.Where(m => m.UserId.Equals(i.UserId)).Count();
                insightDatas.Add(d);
            }
            return(insightDatas);
        }
Exemplo n.º 4
0
    public void SetObject(ClueData clue, bool full = true)
    {
        CaseData openedCase = InvestigationManager.GetCase();

        GetComponent <CanvasGroup>().alpha = 1;
        string fullDescription = clue.clueDescription;
        Files  files           = Files.Load();

        if (full)
        {
            int clueIndex = openedCase.GetClueIndexFromData(clue);
            fullDescription += "\n\nTESTEMUNHOS:";
            foreach (Testimony t in files.GetCaseStatus().testimonys)
            {
                if (t.clue == clueIndex)
                {
                    TestimonyData td = openedCase.GetTestimonyData(t);
                    fullDescription += "\n" + "* " + td.witness.witnessName + ": " + td.description;
                }
            }
            fullDescription += "\n\nINSIGHTS:";
            foreach (int i in files.GetCaseStatus().insights)
            {
                InsightData id = openedCase.GetInsightData(i);
                if ((openedCase.GetClueIndexFromData(id.firstClue) == clueIndex) ||
                    (openedCase.GetClueIndexFromData(id.secondClue) == clueIndex))
                {
                    fullDescription += "\n* [" + id.firstClue.clueName + ":" + id.secondClue.clueName + "]"
                                       + id.description;
                }
            }
        }
        description.text = fullDescription;
        title.text       = clue.clueName;
        icon.sprite      = clue.img;
    }
Exemplo n.º 5
0
 public void SetInfo(InsightData data)
 {
     title.text = data.firstClue.clueName + "+" + data.secondClue.clueName;
     obj        = data;
     type       = DataType.INSIGHT;
 }
Exemplo n.º 6
0
 public int GetInsightIndexFromData(InsightData data)
 {
     return(insights.IndexOf(data));
 }
Exemplo n.º 7
0
 public void SetInfo(string question, InsightData data)
 {
     this.question.text = question;
     this.answer.text   = data.name;
 }