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)); }
internal void Clear() { for (int i = 0; i < length; i++) { highlights[i] = new highlight(); } }
// 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>(); }
public override void Awake() { base.Awake(); //InteractiveItem = gameObject.GetComponentInChildren<VRInteractiveItem>(); controller = GameObject.Find("GameController").GetComponent <GameController>(); colorShifter = gameObject.GetComponent <ColorShifter>(); highlighter = gameObject.GetComponentInChildren <highlight>(); }
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)); }