Example #1
0
        public ActionResult DeleteUserLink(DTO_menubyuser data)
        {
            if (!ModelState.IsValid)
            {
                return((ActionResult)this.View("Detailsview", (object)data));
            }

            ViewBag.Message = "Delete User Link";
            if (data.TopicUserID <= 0)
            {
                return((ActionResult)this.View("Detailsview", (object)data));
            }
            SDR_QFS_Datau sdrQfsDataU = this._context.SDR_QFS_DataU.Find(data.TopicUserID);

            _context.SDR_QFS_DataU.Remove(sdrQfsDataU);
            _context.SaveChanges();
            return(RedirectToAction("Detailsview", (object)new { SearchParam = sdrQfsDataU.UserName, CurrentPage = 1, currentFilter = sdrQfsDataU.UserName }));
        }
Example #2
0
        public ActionResult AddUserLinkAjax(DTO_menubyuser DTO_Link)
        {
            SDR_QFS_Datau sdrQfsDataU = new SDR_QFS_Datau();

            if (!string.IsNullOrEmpty(DTO_Link.Username))
            {
                sdrQfsDataU.UserName = DTO_Link.Username;
                sdrQfsDataU.TopicID  = DTO_Link.TopicId;
                sdrQfsDataU.Data     = DTO_Link.Description;
                this._context.SDR_QFS_DataU.Add(sdrQfsDataU);
                try
                {
                    this._context.SaveChanges();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            return((ActionResult)this.RedirectToAction("Detailsview", (object)new { SearchParam = "", CurrentPage = 1, currentFilter = DTO_Link.Username }));
        }
Example #3
0
        public ActionResult EditUserLink(DTO_menubyuser data)
        {
            SDR_QFS_Datau sdrQfsDataU2 = this._context.SDR_QFS_DataU.Find(data.TopicUserID);

            if (!string.IsNullOrEmpty(data.Username))
            {
                sdrQfsDataU2.UserName    = data.Username;
                sdrQfsDataU2.SortOrder   = (decimal)data.SortOrder;
                sdrQfsDataU2.TopicUserID = data.TopicUserID;
                sdrQfsDataU2.Data        = data.DataU;
                sdrQfsDataU2.TopicID     = data.TopicId;
                try
                {
                    this._context.SaveChanges();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            return(RedirectToAction("Detailsview", new { SearchParam = data.Username, CurrentPage = 1, currentFilter = data.Username }));
        }