Ejemplo n.º 1
0
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int Delete <T>(T entity) where T : class
 {
     using (var db = new BFdbContext())
     {
         return(db.Delete <T>(entity));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除角色
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public string DelRole(string id)
 {
     try
     {
         using (BFdbContext db = new BFdbContext())
         {
             TBROLE role = db.TBROLE.Find(id);
             role.ID = id;
             return(db.Delete <TBROLE>(role).ToString());
         }
     }
     catch (Exception ex)
     {
         log.Error(ex);
         throw GetFault(ex);
     }
 }
Ejemplo n.º 3
0
        public string DelRule(string ruleid)
        {
            try
            {
                using (BFdbContext db = new BFdbContext())
                {
                    CMNRULE ent = new CMNRULE();
                    ent.ID = ruleid;

                    return(db.Delete <CMNRULE>(ent).ToString());
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                throw GetFault(ex);
            }
        }