示例#1
0
 public static bool Show(User user, Models.Dissertation dissertation)
 {
     if (dissertation != null)
     {
         if (user == null)
         {
             if (!dissertation.Defensed || dissertation.Administrative_Use)
                 return false;
         }
         else
         {
             if ((user is Applicant) && (user.Id != dissertation.Id))
                 if (!dissertation.Defensed || dissertation.Administrative_Use)
                     return false;
         }
         return true;
     }
     return false;
 }
示例#2
0
 // Добавляет метод по заданию информации об авторизованном пользователе
 public static void SetUser(this HttpSessionStateBase session, User user)
 {
     session["User"] = user;
 }
示例#3
0
 public static bool Edit(User user) { return ((user is Administrator) || ((user is Member) && (((user as Member).Position == MemberPosition.Chairman) || ((user as Member).Position == MemberPosition.Secretary)))); }
示例#4
0
 public static bool Create(User user) { return ((user is Administrator) || ((user is Member) && ((user as Member).Position == MemberPosition.Secretary))); }
示例#5
0
 public static bool Control(User user, Models.Dissertation dissertation) { return ((user is Applicant) && (dissertation != null) && ((user as Applicant).Id == dissertation.Id)); }
示例#6
0
 public static bool Control(User user) { return ((user is Administrator) || ((user is Member) && ((user as Member).Position == MemberPosition.Chairman))); }
示例#7
0
 public static bool ChangeChairman(User user) { return (user is Administrator); }
示例#8
0
 public static bool Edit(User user, Models.Dissertation dissertation) { return ((user is Applicant) && (user.Id == dissertation.Applicant.Id)); }
示例#9
0
 public static bool ShowAdditionalInfo(User user) { return ((user is Member) || (user is Administrator)); }
示例#10
0
 public static bool ShowAdditionalInfo(User user, User showedUser)
 {
     if ((user == null) || (showedUser == null)) return false;
     return ((user.Id == showedUser.Id) || (user is Member) || (user is Administrator));
 }
示例#11
0
 public static bool Remove(User user, User removedUser)
 {
     if ((user == null) || (removedUser == null)) return false;
     return ((user is Administrator) || (user.Id == removedUser.Id) || ((user is Member) && ((user as Member).Position == MemberPosition.Chairman) && !(removedUser is Administrator)));
 }
示例#12
0
 public static bool Remove(User user) { return (user is Administrator); }
示例#13
0
 public static bool Edit(User user, User editedUser)
 {
     if ((user == null) || (editedUser == null)) return false;
     return ((user.Id == editedUser.Id) || (user is Administrator) || (((user is Member) && ((user as Member).Position == MemberPosition.Chairman) && !(editedUser is Administrator))));
 }
示例#14
0
 public static bool RegisterAdministrator(User user) { return (user is Administrator); }
示例#15
0
 public static bool RegisterApplicant(User user) { return ((user == null)  || ((user is Member) && ((user as Member).Position == MemberPosition.Secretary))); }