Example #1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="car"></param>
        /// <returns></returns>
        public bool Update(DAO.PartsExtend model)
        {
            DAO.PartsExtend c = db.PartsExtend.Where(m => m.ID == model.ID).FirstOrDefault();

            /**
             * c.Enable = model.Enable;
             * c.MenuBindURL = model.MenuBindURL;
             * c.MenuLevel = model.MenuLevel;
             * c.MenuName = model.MenuName;
             * c.MenuOrderby =model.MenuOrderby;
             * c.MenuParent = model.MenuParent;
             * c.MenuState = model.MenuState;
             * **/
            db.Entry(c).State = System.Data.EntityState.Modified;
            int result = db.SaveChanges();

            if (result > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// 增加一条记录
        /// </summary>
        /// <param name="car">汽车实体</param>
        /// <returns></returns>
        public DAO.PartsExtend Add(DAO.PartsExtend model)
        {
            DAO.PartsExtend m = db.PartsExtend.Add(model);
            int             i = db.SaveChanges();

            if (i > 0)
            {
                return(m);
            }
            else
            {
                return(null);
            }
        }