本文整理汇总了C#中Driver.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Driver.Show方法的具体用法?C# Driver.Show怎么用?C# Driver.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Driver
的用法示例。
在下文中一共展示了Driver.Show方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Login_Click
private void Login_Click(object sender, RoutedEventArgs e)
{
NewConnection.connection();
int online = 3, zer=0;
scmd.Connection = Cn.con;
scmd.CommandText = "Update Login set Online='" + zer + "'where Online='" + online + "'"; // update last online person to 0
scmd.ExecuteNonQuery();
scmd.CommandText = "Update Login set Online='" + online + "'where Username='" + UserNameTxt.Text + "'"; // update person that logged on to 3
scmd.ExecuteNonQuery();
SqlDataAdapter dataA = new SqlDataAdapter("Select Count(*) From Login where Username= '" + UserNameTxt.Text + "' and Password ='" + PasswordTxt.Text + "'", Cn.con);
DataTable dt = new DataTable();
dataA.Fill(dt);
if (dt.Rows[0][0].ToString() == "1")
{
string adRank = "Select Rank,Id From Login where Username='" + UserNameTxt.Text + "'"; // take UserRank in one line with username from DB
SqlCommand cmd = new SqlCommand(adRank, Cn.con);
SqlDataReader rd = cmd.ExecuteReader();
if (rd.HasRows)
{
rd.Read();
var userRank = rd.GetInt32(0);
switch (userRank) // opens a UI for ranks
{
case 1:
AdminUI showAdminUI = new AdminUI();
showAdminUI.Show();
break;
case 2:
Storekeeper showStorekeeper = new Storekeeper();
showStorekeeper.Show();
break;
case 3:
Shop showShop = new Shop();
showShop.Show();
break;
case 4:
Driver showDriver = new Driver();
showDriver.Show();
break;
}
}
}
else
{
MessageBox.Show("Please check your User Name and Password");
}
}