当前位置: 首页>>代码示例>>C#>>正文


C# DBConnection.LoadClientVehicles方法代码示例

本文整理汇总了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";
                }

            }
        }
开发者ID:Davidsobey,项目名称:Tweek-Performance,代码行数:22,代码来源:NewMod.aspx.cs

示例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");
        }
开发者ID:Davidsobey,项目名称:Tweek-Performance,代码行数:57,代码来源:ProjectUnregisteredClient.aspx.cs


注:本文中的DBConnection.LoadClientVehicles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。