Beispiel #1
0
        private static void InsertUserRole(UserRole role, Database db, DbTransaction trans)
        {
            DbCommand dbCommand = db.GetStoredProcCommand("Usp_InsertSysUserRole");

            try
            {
                if (trans == null)
                    db.ExecuteNonQuery(dbCommand);
                else
                    db.ExecuteNonQuery(dbCommand, trans);
            }
            catch (System.Data.SqlClient.SqlException sex)      // 只捕获SqlException,其余抛出继续传播
            {
                DBHelper.ParseSqlException(sex, false);
            }
        }
Beispiel #2
0
 public static void DeleteUserRole(UserRole role, TranscationHelper trans)
 {
     DeleteUserRole(role, trans.DataBase, trans.Transaction);
 }
Beispiel #3
0
 public static void DeleteUserRole(UserRole role)
 {
     DeleteUserRole(role, DBHelper.GetDatabase(), null);
 }
Beispiel #4
0
 public static void InsertUserRole(UserRole role, TranscationHelper trans)
 {
     InsertUserRole(role, trans.DataBase, trans.Transaction);
 }
Beispiel #5
0
 public static void InsertUserRole(UserRole role)
 {
     InsertUserRole(role, DBHelper.GetDatabase(), null);
 }