コード例 #1
0
ファイル: User.cs プロジェクト: Nikifor0s/Messenger
        private static Role UserWithPrivilegeViewEdit(User user)
        {
            DataBaseAccess.ViewMessageAndUsers(DataBaseAccess.AccessDB());
            DataBaseAccess.InsertMessage(DataBaseAccess.AccessDB());

            return(Role.UserWithPrivilegeViewEdit);
        }
コード例 #2
0
ファイル: User.cs プロジェクト: Nikifor0s/Messenger
 //AdminPrivilege
 private static void AdminPrivileges(User user)
 {
     DataBaseAccess.AccessDB();
     DataBaseAccess.ViewMessageAndUsers(DataBaseAccess.AccessDB());
     DataBaseAccess.InsertMessage(DataBaseAccess.AccessDB());
     DataBaseAccess.UpadeMessage(DataBaseAccess.AccessDB());
     DataBaseAccess.DeleteMessage(DataBaseAccess.AccessDB());
     //User.CheckNameAndPassword(list, user);
 }
コード例 #3
0
        //details of the Entities
        public static void Info(User user)
        {
            user = LoginScreen.Login(DataBaseAccess.AccessDB(), user);

            StringBuilder sb = new StringBuilder();

            sb
            .AppendLine("1 to Login As Admin")
            .AppendLine("2 to Login As User with View Priviledges")
            .AppendLine("3 to Login As User with View, Edit Priviledges")
            .AppendLine("4 to Login As User with View, Edit and Delete Priviledges");
            Console.WriteLine(sb);


            var choose = Convert.ToInt32(Console.ReadLine());



            switch (choose)
            {
            case 1:
                user.Privilege = User.Role.Admin;
                break;

            case 2:
                user.Privilege = User.Role.UserWithPrivilegeView;
                break;

            case 3:
                user.Privilege = User.Role.UserWithPrivilegeViewEdit;
                break;

            default:
                user.Privilege = User.Role.UserWithPrivilegeViewEditDelete;
                break;
            }
        }
コード例 #4
0
ファイル: MessageInfo.cs プロジェクト: Nikifor0s/Messenger
 //Messeger Details od Message and User
 public static void Messenger(User user)
 {
     LoginScreen.Login(DataBaseAccess.AccessDB(), user);
     DataBaseAccess.ViewMessageAndUsers(DataBaseAccess.AccessDB());
     DataBaseAccess.InsertMessage(DataBaseAccess.AccessDB());
 }