本文整理汇总了C#中DB.SelectRow方法的典型用法代码示例。如果您正苦于以下问题:C# DB.SelectRow方法的具体用法?C# DB.SelectRow怎么用?C# DB.SelectRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB
的用法示例。
在下文中一共展示了DB.SelectRow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get_Outcome
private void Get_Outcome()
{
try
{
DB db2 = new DB("outcome");
db2.SelectedColumns.Add("*");
db2.AddCondition("out_id", Outcome_Id);
DataRow DR = db2.SelectRow();
Date_TB.Value = DateTime.Parse(DR["out_date"].ToString());
Type_CB.SelectedValue = DR["out_ott_id"];
Value_TB.Text = DR["out_value"].ToString();
Description_TB.Text = DR["out_description"].ToString();
Point_ID = DR["out_pon_id"];
}
catch
{
}
}
示例2: Get_Attendence_Info
private void Get_Attendence_Info()
{
try
{
DB db2 = new DB("Attendence");
db2.SelectedColumns.Add("*");
db2.AddCondition("Att_id", Attendence_Id);
DataRow DR = db2.SelectRow();
Employees_CB.SelectedValue = DR["att_emp_id"];
Date_DTP.Value = DateTime.Parse(DR["att_date"].ToString());
Attend_DTP.Value = new DateTime(TimeSpan.Parse(DR["att_attend"].ToString()).Ticks);
Leave_DTP.Value = DR["att_leave"].ToString() != "" ? new DateTime(TimeSpan.Parse(DR["att_leave"].ToString()).Ticks) : Leave_DTP.Value;
}
catch
{
}
}
示例3: Check_Login
private void Check_Login()
{
try
{
//select the user information giving the username
DB db = new DB("users");
db.AddCondition("user_name", User_name_TB.Text.Trim());
DataRow User = db.SelectRow("select * from users");
//check if user is exist
if(User != null)
{
//check if password hashcode match
if(Password_TB.Password.GetHashCode().ToString() == User["user_pass"].ToString())
{
//set global variables
App.User_Id = User["User_Id"];
App.Group_ID = User["user_grp_id"];
//start application
Window m = new Window();
//check privileges
switch(int.Parse(User["user_grp_id"].ToString()))
{
case 1:
m = new Managent();
break;
case 2:
m = new Cashier_Window();
break;
case 3:
m = new Managent();
break;
}
//hide Login window and show the selected window
this.Hide();
m.ShowDialog();
//close application on windwos close
Application.Current.Shutdown();
}
else
{
Message.Show("كلمة المرور غير صحيحة", MessageBoxButton.OK, 10);
}
}
else
{
Message.Show("إسم المستخدم غير صحيح", MessageBoxButton.OK, 10);
}
}
catch
{
}
}
示例4: Get_User
private void Get_User()
{
try
{
DB db2 = new DB("users");
db2.SelectedColumns.Add("*");
db2.AddCondition("user_id", User_Id);
DataRow DR = db2.SelectRow();
Name_TB.Text = DR["user_name"].ToString();
Groups_CB.SelectedValue = DR["user_grp_id"];
}
catch
{
}
}
示例5: Get_Payment
private void Get_Payment()
{
try
{
DB db2 = new DB("payments");
db2.SelectedColumns.Add("*");
db2.AddCondition("pay_id", Payment_Id);
DataRow DR = db2.SelectRow();
Date_DTP.Value = DateTime.Parse(DR["pay_date"].ToString());
Person_CB.SelectedValue = DR["pay_per_id"];
Value_TB.Text = DR["pay_value"].ToString();
//No_TB.Text = DR["trs_No"].ToString();
}
catch
{
}
}
示例6: Get_Bank
private void Get_Bank()
{
try
{
DB db2 = new DB("bank");
db2.SelectedColumns.Add("*");
db2.AddCondition("bnk_id", Bank_Id);
DataRow DR = db2.SelectRow();
Date_TB.Value = DateTime.Parse(DR["bnk_date"].ToString());
Type_CB.Text = Enum.GetName(typeof(Bank_Types), int.Parse(DR["bnk_trn_id"].ToString()));
Value_TB.Text = DR["bnk_value"].ToString();
Description_TB.Text = DR["bnk_description"].ToString();
}
catch
{
}
}
示例7: Hyperlink_Click
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
try
{
//Change Password
//select the user information giving the username
DB db = new DB("users");
db.AddCondition("user_name", User_name_TB.Text.Trim());
DataRow User = db.SelectRow("select * from users");
//check if user is exist
if(User != null)
{
//check if password hashcode match
if(Password_TB.Password.GetHashCode().ToString() == User["user_pass"].ToString())
{
//set global variables
App.User_Id = User["User_Id"];
//open change password window
User u = new User(Edit_Mode.Change_Password, User["User_Id"]);
this.Hide();
u.ShowDialog();
//show Login window
this.ShowDialog();
}
else
{
Message.Show("كلمة المرور غير صحيحة", MessageBoxButton.OK, 10);
}
}
else
{
Message.Show("إسم المستخدم غير صحيح", MessageBoxButton.OK, 10);
}
}
catch
{
}
}