本文整理汇总了C#中Student.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Student.Show方法的具体用法?C# Student.Show怎么用?C# Student.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student.Show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
People p = new Student("app", 10, "北京大学", "001", "01001");
p.Hi(); p.Show();
System.Console.WriteLine();
Student s = p as Student;
s.Hi(); s.Show();
System.Console.ReadKey();
}
示例2: LoginButton_Click
private void LoginButton_Click(object sender, RoutedEventArgs e)
{
var sInput = UsernameTextBox.Text;
var sPassword = PasswordTextBox.Password;
if (sInput == null || sInput.Equals(""))
{
_dialogService.CallMessageModal(this, "", SSS_Library.Properties.Resources.IncorrectLoginDetailsMessage);
UsernameTextBox.Clear();
PasswordTextBox.Clear();
UsernameTextBox.Focus();
}
else
{
if (sPassword.Equals("HereBeDragons") && (sInput.Equals("Admin") || sInput.Equals("admin") || sInput.Equals("Administrator") || sInput.Equals("administrator")))
{
MetroWindow adminShow = new Administrator.Administrator();
adminShow.Owner = this;
adminShow.Show();
this.Hide();
}
else if (!SSS_Library.DataServices.StringHandler.CheckIfStringANumber(sInput) || !sPassword.Equals("HereBeDragons") && (sInput.Equals("Admin") || sInput.Equals("admin") || sInput.Equals("Administrator") || sInput.Equals("administrator")))
{
_dialogService.CallMessageModal(this, "", SSS_Library.Properties.Resources.IncorrectLoginDetailsMessage);
PasswordTextBox.Clear();
UsernameTextBox.Clear();
UsernameTextBox.Focus();
}
else
{
_userId = Convert.ToInt32(sInput);
var userProfile = _userProfileTableAdapter.GetData().FindByuser_id(_userId);
if (userProfile == null)
{
_dialogService.CallMessageModal(this, "", SSS_Library.Properties.Resources.IncorrectLoginDetailsMessage);
UsernameTextBox.Clear();
PasswordTextBox.Clear();
UsernameTextBox.Focus();
}
else
{
if (userProfile.resetPassword)
{
CreatePassword(userProfile);
}
else
{
var doILogin = CheckPassword(userProfile, sPassword);
if (doILogin)
{
//coordinator role = 2
if (userProfile.user_roles_id == 2)
{
MetroWindow coordinatorShow = new Coordinator(_userId);
coordinatorShow.Owner = this;
coordinatorShow.Show();
this.Hide();
}
//student role = 4
else if (userProfile.user_roles_id == 4)
{
MetroWindow studentShow = new Student(_userId);
studentShow.Owner = this;
studentShow.Show();
this.Hide();
}
//tutor role = 3
else if (userProfile.user_roles_id == 3)
{
MetroWindow tutorShow = new Tutor(_userId);
tutorShow.Owner = this;
tutorShow.Show();
this.Hide();
}
}
}
}
}
}
}