Exemple #1
0
        public IActionResult Update([FromBody] JObject body)
        {
            string linkId  = body.GetValue("linkId").ToString();
            string title   = body.GetValue("title").ToString();
            string linkURL = body.GetValue("linkURL").ToString();

            Link link = _linkRepo.GetLink(linkId);

            if (link != null)
            {
                link.Title   = title;
                link.LinkURL = linkURL;
                return(new JsonResult(_linkRepo.Update(link)));
            }

            return(null);
        }
Exemple #2
0
        private void DisplayData()
        {
            var repo = new LinkRepository();

            var link = repo.GetLink(Convert.ToInt32(Request["Id"]));

            if (link != null)
            {
                this.txtTitle.Value       = link.Title;
                this.txtUrl.Value         = link.Url;
                this.txtViewOrder.Value   = link.ViewOrder.ToString();
                this.txtDescription.Value = link.Description;
            }
            else
            {
                lblError.ForeColor = System.Drawing.Color.Red;
                lblError.Text      = "해당되는 데이터가 없습니다.";
            }
        }