public static User UserLogin(string username, string userpasswd) { User user = new User("N/A", "N/A"); System.Data.DataTable table = SqliteHelper.QueryTable("UserInfo", "*", "UserName='******'"); if (table.Rows.Count != 0) { //比对密码 if (table.Rows[0]["Password"].ToString() == userpasswd) { user.UserName = table.Rows[0]["UserName"].ToString(); return(user); } else//密码错误 { return(user); } //判断超时 //取值 } else { return(user); } return(user); }
public static int DeleteRecord(Train train) { int i = 0; if (SqliteHelper.QueryTable("TrainRecord", "*", "UserName='******'").Rows.Count == 1) { i = SqliteHelper.ExecuteNonQuery("delete from UserInfo where UserName='******'"); } return(i); }
/// <summary> /// 删除 /// </summary> /// <param name="user"></param> /// <returns></returns> public static int DeleteUser(User user) { int i = 0; if (SqliteHelper.QueryTable("UserInfo", "*", "UserName='******'").Rows.Count == 1) { i = SqliteHelper.ExecuteNonQuery("delete from UserInfo where UserName='******'"); } return(i); }