Esempio n. 1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sid"></param>
        public static void UpdateModel(Base_RunGridView_Condition model, int sid)
        {
            using (DBContext dbContext = new DBContext())
            {
                var editmodel = dbContext.Base_RunGridView_Condition.Where(u => u.id == sid).FirstOrDefault();
                if (editmodel == null)
                {
                    return;//空
                }
                editmodel.Base_RunGridView_Id = model.Base_RunGridView_Id;
                editmodel.inputtcii           = model.inputtcii;
                editmodel.datetype            = model.datetype;
                editmodel.iOperator           = model.iOperator;
                editmodel.type       = model.type;
                editmodel.editFormat = model.editFormat;
                editmodel.field      = model.field;
                editmodel.fieldName  = model.fieldName;
                editmodel.Remark     = model.Remark;
                editmodel.formName   = model.formName;


                //提交修改
                dbContext.SaveChanges();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool AddModel(Base_RunGridView_Condition model)
        {
            bool returnFlag = false;

            using (DBContext dbContext = new DBContext())
            {
                //增加
                dbContext.Base_RunGridView_Condition.Add(model);
                dbContext.SaveChanges();
                returnFlag = true;
            }
            return(returnFlag);
        }