public DataTable GetFuelTypes() { db = new DBAccess(); DataTable dt = new DataTable(); string sql = "Select * from FuelTypes "; dt = db.ExecuteDataTable(sql); if (dt.Rows.Count <= 0) { return null; } else { return dt; } }
public bool VerifyUser(LoginDTO loginDTO) { db = new DBAccess(); string sql = @"Select * from Users where username='******' and password = '******'"; DataTable dtUsers = new DataTable(); dtUsers = db.ExecuteDataTable(sql); if (dtUsers.Rows.Count == 1) { return true; } else { return false; } }
public DataTable GetFuelTypes() { db = new DBAccess(); DataTable dt = new DataTable(); string sql = "Select * from FuelTypes "; dt = db.ExecuteDataTable(sql); if (dt.Rows.Count <= 0) { return(null); } else { return(dt); } }
public bool VerifyUser(LoginDTO loginDTO) { db = new DBAccess(); string sql = @"Select * from Users where username='******' and password = '******'"; DataTable dtUsers = new DataTable(); dtUsers = db.ExecuteDataTable(sql); if (dtUsers.Rows.Count == 1) { return(true); } else { return(false); } }
public FuelTypeDTO GetFuelType(int fuelTypeID) { db = new DBAccess(); DataTable dt = new DataTable(); string sql = "Select * from FuelTypes where FuelTypeID=" + fuelTypeID; dt = db.ExecuteDataTable(sql); if (dt.Rows.Count <= 0) { return null; } else { FuelTypeDTO fuelTypeDTO = new FuelTypeDTO(); fuelTypeDTO.FuelTypeID = int.Parse(dt.Rows[0]["FuelTypeID"].ToString()); fuelTypeDTO.FuleTypeName = dt.Rows[0]["FuelTypeName"].ToString(); return fuelTypeDTO; } }
public FuelTypeDTO GetFuelType(int fuelTypeID) { db = new DBAccess(); DataTable dt = new DataTable(); string sql = "Select * from FuelTypes where FuelTypeID=" + fuelTypeID; dt = db.ExecuteDataTable(sql); if (dt.Rows.Count <= 0) { return(null); } else { FuelTypeDTO fuelTypeDTO = new FuelTypeDTO(); fuelTypeDTO.FuelTypeID = int.Parse(dt.Rows[0]["FuelTypeID"].ToString()); fuelTypeDTO.FuleTypeName = dt.Rows[0]["FuelTypeName"].ToString(); return(fuelTypeDTO); } }