Пример #1
0
 private void ddlModelName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlModelName.SelectedIndex != -1)
     {
         VehicleInfoBL bl   = new VehicleInfoBL();
         ComboboxItem  item = (ComboboxItem)ddlModelName.SelectedItem;
         if (item != null)
         {
             var vehicleinfo = bl.GetVehicleInfo(Convert.ToInt32(item.Value));
             txtShowRoomPrice.Text  = vehicleinfo.ExShowRoomPrice.ToString();
             txtLTRTOtherExp.Text   = vehicleinfo.LT_RT_OtherExp.ToString();
             txtInsurancePrice.Text = vehicleinfo.InsurancePrice.ToString();
             txtMarginPrice.Text    = vehicleinfo.MarginPrice.ToString();
             txt50Margin.Text       = vehicleinfo.Margin50.ToString();
             txt70Margin.Text       = vehicleinfo.Margin70.ToString();
             txtWarranty.Text       = vehicleinfo.WarrantyPrice.ToString();
             txtOnRoadPrice.Text    = vehicleinfo.OnRoadPrice.ToString();
         }
     }
 }
Пример #2
0
        private void PopulateVehicletype(int VehicleInfoID)
        {
            VehicleInfoBL obj         = new VehicleInfoBL();
            var           vehicleInfo = obj.GetVehicleInfo(VehicleInfoID);
            var           vehicleType = obj.GetVehicleTypes().Where(vt => vt.VehicleTypeID == vehicleInfo.VehicleTypeID).FirstOrDefault();
            ComboboxItem  selitem     = new ComboboxItem();

            selitem.Text           = vehicleType.Description;
            selitem.Value          = vehicleType.VehicleTypeID;
            ddlVehicleType.Text    = selitem.Text;
            txtModelCode.Text      = vehicleInfo.ModelCode;
            txtModelName.Text      = vehicleInfo.ModelName;
            txtShowRoomPrice.Text  = vehicleInfo.ExShowRoomPrice.ToString();
            txtLTRTOtherExp.Text   = vehicleInfo.LT_RT_OtherExp.ToString();
            txtInsurancePrice.Text = vehicleInfo.InsurancePrice.ToString();
            txtOnRoadPrice.Text    = vehicleInfo.OnRoadPrice.ToString();
            txtMarginPrice.Text    = vehicleInfo.MarginPrice.ToString();
            txt50Margin.Text       = vehicleInfo.Margin50.ToString();
            txt70Margin.Text       = vehicleInfo.Margin70.ToString();
            txtWarranty.Text       = vehicleInfo.WarrantyPrice.ToString();
        }