Esempio n. 1
0
        public bool SCupdate(Int64 id, string grade)
        {
            bool b = false;
            //查找出修改前的数据
            tb_sc uu = DB.tb_sc.Where(a => a.id == id).FirstOrDefault();

            if (uu != null)
            {
                try
                {
                    uu.grade = grade;
                    DB.SubmitChanges();
                    b = true;
                }
                catch { }
            }
            return(b);
        }
Esempio n. 2
0
 public bool Del(Int64 id)
 {
     try
     {
         tb_sc stusc = DB.tb_sc.FirstOrDefault(a => a.id == id);
         if (stusc == null)
         {
             return(false);
         }
         else
         {
             DB.tb_sc.DeleteOnSubmit(stusc);
             DB.SubmitChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }