Beispiel #1
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool AddModel(Base_RunGridView model)
        {
            bool returnFlag = false;

            using (DBContext dbContext = new DBContext())
            {
                //增加
                dbContext.Base_RunGridView.Add(model);
                dbContext.SaveChanges();
                returnFlag = true;
            }
            return(returnFlag);
        }
Beispiel #2
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sid"></param>
        public static void UpdateModel(Base_RunGridView model, int sid)
        {
            using (DBContext dbContext = new DBContext())
            {
                var editmodel = dbContext.Base_RunGridView.Where(u => u.BaseRunGridViewID == sid).FirstOrDefault();
                if (editmodel == null)
                {
                    return;//空
                }
                editmodel.DBType       = model.DBType;
                editmodel.GridViewName = model.GridViewName;
                editmodel.keyWord      = model.keyWord;
                editmodel.strCondition = model.strCondition;
                editmodel.strSelect    = model.strSelect;
                editmodel.Type         = model.Type;
                editmodel.ViewOrder    = model.ViewOrder;
                editmodel.SqlType      = model.SqlType;

                //提交修改
                dbContext.SaveChanges();
            }
        }