private static Role UserWithPrivilegeViewEdit(User user) { DataBaseAccess.ViewMessageAndUsers(DataBaseAccess.AccessDB()); DataBaseAccess.InsertMessage(DataBaseAccess.AccessDB()); return(Role.UserWithPrivilegeViewEdit); }
//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); }
//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; } }
//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()); }