public static VehicleInfoBL getDataId(Int32 iId) { SummitDS.VehicleInfoDataTable thisTable = getAdapter().GetDataById(iId); if (thisTable != null && thisTable.Rows.Count > 0) { return(BuildFromRow(thisTable.Rows[0])); } return(null); }
public static List <VehicleInfoBL> getDataByUserId(Int32 iUserId) { SummitDS.VehicleInfoDataTable thisTable = getAdapter().GetDataByUserId(iUserId); if (thisTable != null && thisTable.Rows.Count > 0) { return(BuildFromTable(thisTable)); } return(null); }
protected override void SaveToRow() { SummitDS.VehicleInfoDataTable _thisTable = new SummitDS.VehicleInfoDataTable(); if (_rowToSave == null) { _rowToSave = _thisTable.NewVehicleInfoRow(); } SummitDS.VehicleInfoRow _dataRow = _rowToSave as SummitDS.VehicleInfoRow; if (_dataRow != null) { if (IsExisting()) { if (_dataRow.user_id != m_iUserId) { _dataRow.user_id = Convert.ToInt32(m_iUserId); } if (String.IsNullOrEmpty(m_strModel)) { if (!_dataRow.IsmodelNull()) { _dataRow.SetmodelNull(); } } else if (_dataRow.IsmodelNull() ? true : _dataRow.model != m_strModel) { _dataRow.model = m_strModel; } if (String.IsNullOrEmpty(m_strMake)) { if (!_dataRow.IsmakeNull()) { _dataRow.SetmakeNull(); } } else if (_dataRow.IsmakeNull() ? true : _dataRow.make != m_strMake) { _dataRow.make = m_strMake; } if (String.IsNullOrEmpty(m_strYear)) { if (!_dataRow.IsyearNull()) { _dataRow.SetyearNull(); } } else if (_dataRow.IsyearNull() ? true : _dataRow.year != m_strYear) { _dataRow.year = m_strYear; } if (String.IsNullOrEmpty(m_strOtherInfo)) { if (!_dataRow.Isother_infoNull()) { _dataRow.Setother_infoNull(); } } else if (_dataRow.Isother_infoNull() ? true : _dataRow.other_info != m_strOtherInfo) { _dataRow.other_info = m_strOtherInfo; } if (bIsUsing.HasValue) { _dataRow.is_using = bIsUsing.Value; } else { _dataRow.Setis_usingNull(); } if (String.IsNullOrEmpty(m_strStyle)) { if (!_dataRow.IsstyleNull()) { _dataRow.SetstyleNull(); } } else if (_dataRow.IsstyleNull() ? true : _dataRow.style != m_strStyle) { _dataRow.style = m_strStyle; } if (String.IsNullOrEmpty(m_strColor)) { if (!_dataRow.IscolorNull()) { _dataRow.SetcolorNull(); } } else if (_dataRow.IscolorNull() ? true : _dataRow.color != m_strColor) { _dataRow.color = m_strColor; } if (String.IsNullOrEmpty(m_strPaintCode)) { if (!_dataRow.Ispaint_codeNull()) { _dataRow.Setpaint_codeNull(); } } else if (_dataRow.Ispaint_codeNull() ? true : _dataRow.paint_code != m_strPaintCode) { _dataRow.paint_code = m_strPaintCode; } if (String.IsNullOrEmpty(m_strVIN)) { if (!_dataRow.IsvinNull()) { _dataRow.SetvinNull(); } } else if (_dataRow.IsvinNull() ? true : _dataRow.vin != m_strVIN) { _dataRow.vin = m_strVIN; } if (String.IsNullOrEmpty(m_strLicense)) { if (!_dataRow.IslicenseNull()) { _dataRow.SetlicenseNull(); } } else if (_dataRow.IslicenseNull() ? true : _dataRow.license != m_strLicense) { _dataRow.license = m_strLicense; } if (String.IsNullOrEmpty(m_strEstimateFileIdentifier)) { if (!_dataRow.Isestimate_file_identifierNull()) { _dataRow.Setestimate_file_identifierNull(); } } else if (_dataRow.Isestimate_file_identifierNull() ? true : _dataRow.estimate_file_identifier != m_strEstimateFileIdentifier) { _dataRow.estimate_file_identifier = m_strEstimateFileIdentifier; } if (String.IsNullOrEmpty(m_strEstimatorName)) { if (!_dataRow.Isestimator_nameNull()) { _dataRow.Setestimator_nameNull(); } } else if (_dataRow.Isestimator_nameNull() ? true : _dataRow.estimator_name != m_strEstimatorName) { _dataRow.estimator_name = m_strEstimatorName; } if (dtProductionDate.HasValue) { _dataRow.production_date = dtProductionDate.Value; } else { _dataRow.Setproduction_dateNull(); } } else { if (iUserId.HasValue) { _dataRow.user_id = iUserId.Value; } else { _dataRow.Setuser_idNull(); } if (String.IsNullOrEmpty(strModel)) { _dataRow.SetmodelNull(); } else { _dataRow.model = strModel; } if (String.IsNullOrEmpty(strMake)) { _dataRow.SetmakeNull(); } else { _dataRow.make = strMake; } if (String.IsNullOrEmpty(strYear)) { _dataRow.SetyearNull(); } else { _dataRow.year = strYear; } if (String.IsNullOrEmpty(strOtherInfo)) { _dataRow.Setother_infoNull(); } else { _dataRow.other_info = strOtherInfo; } if (bIsUsing.HasValue) { _dataRow.is_using = bIsUsing.Value; } else { _dataRow.Setis_usingNull(); } if (String.IsNullOrEmpty(strStyle)) { _dataRow.SetstyleNull(); } else { _dataRow.style = strStyle; } if (String.IsNullOrEmpty(strColor)) { _dataRow.SetcolorNull(); } else { _dataRow.color = strColor; } if (String.IsNullOrEmpty(strPaintCode)) { _dataRow.Setpaint_codeNull(); } else { _dataRow.paint_code = strPaintCode; } if (String.IsNullOrEmpty(strVIN)) { _dataRow.SetvinNull(); } else { _dataRow.vin = strVIN; } if (String.IsNullOrEmpty(strLicense)) { _dataRow.SetlicenseNull(); } else { _dataRow.license = strLicense; } if (dtProductionDate.HasValue) { _dataRow.production_date = dtProductionDate.Value; } else { _dataRow.Setproduction_dateNull(); } if (String.IsNullOrEmpty(m_strEstimateFileIdentifier)) { if (!_dataRow.Isestimate_file_identifierNull()) { _dataRow.Setestimate_file_identifierNull(); } } else if (_dataRow.Isestimate_file_identifierNull() ? true : _dataRow.estimate_file_identifier != m_strEstimateFileIdentifier) { _dataRow.estimate_file_identifier = m_strEstimateFileIdentifier; } if (String.IsNullOrEmpty(m_strEstimatorName)) { if (!_dataRow.Isestimator_nameNull()) { _dataRow.Setestimator_nameNull(); } } else if (_dataRow.Isestimator_nameNull() ? true : _dataRow.estimator_name != m_strEstimatorName) { _dataRow.estimator_name = m_strEstimatorName; } _thisTable.AddVehicleInfoRow(_dataRow); } } }