本文整理汇总了C#中DBConnection.LoadClientVehicles方法的典型用法代码示例。如果您正苦于以下问题:C# DBConnection.LoadClientVehicles方法的具体用法?C# DBConnection.LoadClientVehicles怎么用?C# DBConnection.LoadClientVehicles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnection
的用法示例。
在下文中一共展示了DBConnection.LoadClientVehicles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VehicleDDL_SelectedIndexChanged
protected void VehicleDDL_SelectedIndexChanged(object sender, EventArgs e)
{
usernumber = Convert.ToInt32(Application["UserNumber"]);
DBConnection db = new DBConnection();
db.LoadClientVehicles(usernumber);
foreach (ClientVehicle cv in ClientVehicleBindingList.ClientVehicleList)
{
try
{
if (cv.ClientVehicleNumber == Convert.ToInt32(VehicleDDL.SelectedItem.Value))
{
clientVehicleNumber = cv.ClientVehicleNumber;
break;
}
}
catch(Exception)
{
Lbl.Text = "Please select a vehicle";
}
}
}
示例2: Unnamed_Click
protected void Unnamed_Click(object sender, EventArgs e)
{
//Still need to remove white space and capitalise reg number
string manufacturer = autoComplete.Text;
string model = ModelDDL.Text;
string year = YearDDL.Text;
string engineSize = EngineSizeDDL.Text;
//Fuel Type
string fuelType = FuelTypeDDL.Text;
if (fuelType == "Diesel")
fuelType = "D";
else if (fuelType == "Petrol")
fuelType = "P";
//Model Number
string modelNumber = string.Concat(manufacturer, model, year, fuelType, engineSize);
//Usernumber is retrieved from the initiating of the form
string regNumber = License.Text;
//Unregistered Client THEREFORE Usernumber = 1
ClientVehicle newCV = new ClientVehicle(modelNumber, manufacturer, model, Convert.ToInt32(year), Convert.ToChar(fuelType), Convert.ToInt32(engineSize), true, 0, 1, regNumber, "", "");
Label lblMasterStatus = (Label)Master.FindControl("message");
lblMasterStatus.Visible = true;
lblMasterStatus.Text = newCV.InsertNewClientVehicle(newCV);
DBConnection db = new DBConnection();
db.LoadClientVehicles(1);
int clientVehicleNum = 0;
foreach (ClientVehicle cv in ClientVehicleBindingList.ClientVehicleList)
{
if (cv.ModelNumber == modelNumber)
{
clientVehicleNum = cv.ClientVehicleNumber;
}
}
Application.Contents.Remove("ClientUN");
Application.Contents.Remove("ProjectRequest");
Application.Contents.Remove("ClientVehicleNum");
Application.Contents.Remove("FName");
Application.Contents.Remove("SName");
Application.Contents.Remove("ContactNum");
Application["ClientUN"] = "1";
Application["ProjectRequest"] = "0";
Application["ClientVehicleNum"] = clientVehicleNum;
Application["FName"] = txtName.Text;
Application["SName"] = txtSurname.Text;
Application["ContactNum"] = txtContactNumber.Text;
Response.Redirect("./ConfirmDate");
}