Ejemplo n.º 1
0
        public ActionResult EditShareLink(int LId)
        {
            string url = String.Format("api/Link/GetLinkDetail?LID={0}", LId);
            GetLinkDetailReturnDTO result = _apiAdaptor.Get<GetLinkDetailReturnDTO>(url);

            EditShareLinkRequestDTO dto = new EditShareLinkRequestDTO()
            {
                LID = result.LID,
                Category = result.Category,
                Title = result.Title,
                Description = result.Description,
                ImgUrl = result.ImgUrl,
                LinkUrl = result.LinkUrl
            };
            return View(dto);
        }
Ejemplo n.º 2
0
        public ActionResult EditShareLink(EditShareLinkRequestDTO dto)
        {
            string url = "api/Link/EditShareLink";
            enErrorCode result = _apiAdaptor.Post<EditShareLinkRequestDTO, enErrorCode>(url, dto);

            return RedirectToAction("BackEndIndex", "ShareLink");
        }
Ejemplo n.º 3
0
        public enErrorCode EditShareLink(EditShareLinkRequestDTO dto)
        {
            enErrorCode enCode = enErrorCode.EXCEPTION;
            try
            {
                ShareLink sl = _dbContext.Set<ShareLink>().Find(dto.LID);
                sl.Category = dto.Category.ToString();
                sl.Title = (String.IsNullOrEmpty(dto.Title)) ? String.Empty : dto.Title;
                sl.Description = (String.IsNullOrEmpty(dto.Description)) ? String.Empty : dto.Description;
                sl.ImgUrl = (String.IsNullOrEmpty(dto.ImgUrl)) ? String.Empty : dto.ImgUrl;
                sl.LinkUrl = (String.IsNullOrEmpty(dto.LinkUrl)) ? String.Empty : dto.LinkUrl;
                int result = _dbContext.SaveChanges();

                if (result == 1)
                {
                    enCode = enErrorCode.SUCCESS;
                }
            }
            catch (Exception ex)
            {

                throw;
            }
            return enCode;
        }