예제 #1
0
파일: RoleDB.cs 프로젝트: tsubik/SFASystem
 private static Role GetRoleFromReader(IDataReader dataReader)
 {
     Role role = new Role();
     role.RoleID = DBHelper.GetGuid(dataReader, "RoleID");
     role.Name = DBHelper.GetString(dataReader, "Name");
     return role;
 }
예제 #2
0
파일: RoleDB.cs 프로젝트: tsubik/SFASystem
        public static void UpdateRole(Role role)
        {
            string sqlQuery = "UPDATE ROLE SET Name=@Name WHERE RoleID='" + role.RoleID + "'";

            DbCommand dbCommand = DBHelper.GetDBCommand(sqlQuery);
            DBHelper.AddInParameter(dbCommand, "Name", DbType.String, role.Name);
            DBHelper.ExecuteNonQuery(dbCommand);
        }
예제 #3
0
파일: RoleDB.cs 프로젝트: tsubik/SFASystem
        public static Role InsertRole(Role role)
        {
            string sqlQuery = "INSERT INTO ROLE(RoleID,Name) VALUES(@RoleID,@Name)";
            if (role.RoleID == Guid.Empty)
                role.RoleID = Guid.NewGuid();
            else
                return null;

            DbCommand dbCommand = DBHelper.GetDBCommand(sqlQuery);
            DBHelper.AddInParameter(dbCommand, "RoleID", DbType.Guid, role.RoleID);
            DBHelper.AddInParameter(dbCommand, "Name", DbType.String, role.Name);
            return role;
        }
예제 #4
0
 public static void UpdateRole(Role role)
 {
     RoleDB.UpdateRole(role);
 }
예제 #5
0
 public static Role InsertRole(Role role)
 {
     return RoleDB.InsertRole(role);
 }