コード例 #1
0
        private void LoadDataForEdit(string autoId)
        {
            VehicleDbHelper db    = new VehicleDbHelper(this);
            ICursor         cData = db.getAutoById(int.Parse(autoId));

            if (cData.MoveToFirst())
            {
                txtYear.Text        = cData.GetString(cData.GetColumnIndex("Year"));
                txtMake.Text        = cData.GetString(cData.GetColumnIndex("Make"));
                txtModel.Text       = cData.GetString(cData.GetColumnIndex("Model"));
                txtColor.Text       = cData.GetString(cData.GetColumnIndex("Color"));
                txtDescription.Text = cData.GetString(cData.GetColumnIndex("Description"));

                sbPaint.Progress      = cData.GetInt(cData.GetColumnIndex("PercentagePaint"));
                sbBody.Progress       = cData.GetInt(cData.GetColumnIndex("PercentageBody"));
                sbGlass.Progress      = cData.GetInt(cData.GetColumnIndex("PercentageGlass"));
                sbTrim.Progress       = cData.GetInt(cData.GetColumnIndex("PercentageTrim"));
                sbUpholstery.Progress = cData.GetInt(cData.GetColumnIndex("PercentageUpholstery"));
                sbMechanical.Progress = cData.GetInt(cData.GetColumnIndex("PercentageMechanical"));
                sbElectrical.Progress = cData.GetInt(cData.GetColumnIndex("PercentageElectrical"));
                sbFrame.Progress      = cData.GetInt(cData.GetColumnIndex("PercentageFrame"));
                sbTires.Progress      = cData.GetInt(cData.GetColumnIndex("PercentageTires"));
                sbOverall.Progress    = cData.GetInt(cData.GetColumnIndex("PercentageOverall"));
            }
        }