Example #1
0
        public IActionResult Createhighlight(int id)
        {
            SucceedInfomation succeedinfomation = new SucceedInfomation();
            // find postocntent first if found then Add it to the highlight table
            postcontent postcontentValue = _Context.postcontents.FirstOrDefault(x => x.postid == id);

            if (postcontentValue == null)
            {
                succeedinfomation.Issucceed = false;
                return(Ok(succeedinfomation));
            }
            var checkhg = _Context.highlights.FirstOrDefault(x => x.postcontentid == postcontentValue.postcontentid);

            if (checkhg != null)
            {
                succeedinfomation.Issucceed     = false;
                succeedinfomation.SucceedDetail = "duplicated content";
                return(Ok(succeedinfomation));
            }
            var Newhighlight = new highlight();

            Newhighlight.postcontentid = postcontentValue.postcontentid;
            _Context.highlights.Add(Newhighlight);
            _Context.SaveChanges();

            succeedinfomation.Issucceed = true;
            return(Ok(succeedinfomation));
        }
Example #2
0
 internal void Clear()
 {
     for (int i = 0; i < length; i++)
     {
         highlights[i] = new highlight();
     }
 }
Example #3
0
 // Use this for initialization
 public override void Awake()
 {
     base.Awake();
     controller   = GameObject.Find("GameController").GetComponent <GameController>();
     lines        = new List <NodeLine>();
     colorShifter = gameObject.GetComponent <ColorShifter>();
     highlighter  = gameObject.GetComponentInChildren <highlight>();
 }
Example #4
0
    public override void Awake()
    {
        base.Awake();
        //InteractiveItem = gameObject.GetComponentInChildren<VRInteractiveItem>();

        controller   = GameObject.Find("GameController").GetComponent <GameController>();
        colorShifter = gameObject.GetComponent <ColorShifter>();
        highlighter  = gameObject.GetComponentInChildren <highlight>();
    }
Example #5
0
        public IActionResult deleteHighlight(int id)
        {
            SucceedInfomation succeedinfomation = new SucceedInfomation();
            // find postocntent first if found then Add it to the highlight table
            postcontent postcontentValue = _Context.postcontents.FirstOrDefault(x => x.postid == id);


            var highlightValue = _Context.highlights.FirstOrDefault(x => x.postcontentid == postcontentValue.postcontentid);

            if (highlightValue == null)
            {
                succeedinfomation.Issucceed = false;
                return(Ok(succeedinfomation));
            }
            var Newhighlight = new highlight();

            _Context.highlights.Remove(highlightValue);
            _Context.SaveChanges();
            succeedinfomation.Issucceed = true;
            return(Ok(succeedinfomation));
        }
Example #6
0
 internal void Clear()
 {
     for (int i = 0; i < length; i++)
     {
         highlights[i] = new highlight();
     }
 }