Exemplo n.º 1
0
 public static void UpadteModelUD10(QCS_FILE model, int value, string DBS)
 {
     using (OraDBContext dbContext = new OraDBContext(DBS))  //传入db
     {
         QCS_FILE editmodel = dbContext.QCS_FILE.Where(u => u.QCS01 == model.QCS01 && u.QCS02 == model.QCS02 && u.QCS05 == model.QCS05).FirstOrDefault();
         if (editmodel == null)
         {
             //空
         }
         editmodel.QCSUD10 = value;
         //提交修改
         dbContext.SaveChanges();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool AddModel(QCS_FILE model)
        {
            bool returnFlag = false;

            using (OraDBContext dbContext = new OraDBContext())
            {
                //增加
                dbContext.QCS_FILE.Add(model);

                dbContext.SaveChanges();

                returnFlag = true;
            }
            return(returnFlag);
        }