Exemplo n.º 1
0
 public BaseObject UpdateLinkCategory(LinkCategoryEntity category)
 {
     using (LinkLogic logic = new LinkLogic())
     {
         return(logic.UpdateLinkCategory(category));
     }
 }
Exemplo n.º 2
0
        public BaseObject InsertLinkCategory(LinkCategoryEntity link)
        {
            BaseObject obj = new BaseObject();

            try
            {
                var category = new LinkCategory()
                {
                    Name        = link.Name,
                    SortOrder   = link.SortOrder,
                    DateCreated = DateTime.Now,
                    UpdateUser  = link.UpdateUser
                };

                _db.LinkCategories.Add(category);
                _db.SaveChanges();

                obj.Tag = 1;
            }
            catch (Exception)
            {
                obj.Tag = -1;
            }

            return(obj);
        }
Exemplo n.º 3
0
 public BaseObject InsertLinkCategory(LinkCategoryEntity link)
 {
     using (LinkLogic logic = new LinkLogic())
     {
         return(logic.InsertLinkCategory(link));
     }
 }
Exemplo n.º 4
0
        public BaseObject UpdateLinkCategory(LinkCategoryEntity category)
        {
            BaseObject obj = new BaseObject();

            var c = _db.LinkCategories.Find(category.ID);

            if (c == null)
            {
                obj.Tag = -1;

                return(obj);
            }
            c.Name        = category.Name;
            c.SortOrder   = category.SortOrder;
            c.DateCreated = DateTime.Now;
            c.UpdateUser  = category.UpdateUser;

            _db.SaveChanges();
            obj.Tag = 1;

            return(obj);
        }
Exemplo n.º 5
0
        public ActionResult EditLinkCategoryJson(LinkCategoryEntity param)
        {
            var list = new Helpers.SystemHelper().UpdateLinkCategory(param);

            return(Json(list));
        }