public void SetDataBindings(CompanyData companyData, CustomerData customerData, CustomerDataTableList customerDataTable) { CompanyDataList tmpCompanyData = new CompanyDataList(); CustomerDataList tmpCustomerData = new CustomerDataList(); tmpCompanyData.AddData(companyData); tmpCustomerData.AddData(customerData); this.CompanyDataBindingSource.DataSource = tmpCompanyData.GetCompanyData(); this.CustomerDataBindingSource.DataSource = tmpCustomerData.GetCustomerData(); this.CustomerDataTableBindingSource.DataSource = customerDataTable.GetCustomerDataTable(); reportViewer1.LocalReport.EnableExternalImages = true; reportViewer1.LocalReport.DisplayName = customerData.VehNo.ToString(); Refresh1(); }
public void GenerateData(bool isFail) { int numEntries, i; int minRPM, maxRPM, temp; double kmp, hsuPer; range minRPMRange = new range(); range maxRPMRange = new range(); range hsuRange = new range(); range tempRange = new range(); dataTableList = new CustomerDataTableList(); if (isFail == false) { hsuRange.min = 50; hsuRange.max = 65; } else { hsuRange.min = 65; hsuRange.max = 70; } numEntries = random.Next(4, 6); CalMinRPMRange(ref minRPMRange); CalMaxRPMRange(minRPMRange, ref maxRPMRange); CalMaxTempGenerator(ref tempRange); avgKval = 0; avgHsuPer = 0; for (i = 0; i < numEntries; i++) { minRPM = random.Next(minRPMRange.min, minRPMRange.max); maxRPM = random.Next(maxRPMRange.min, maxRPMRange.max); hsuPer = CalHSUPerGenerator(hsuRange); temp = random.Next(tempRange.min, tempRange.max); kmp = CalKMPGenerator(); avgKval += kmp; avgHsuPer += hsuPer; dataTableList.AddData(new CustomerDataTable(i + 1, minRPM, maxRPM, temp, kmp, hsuPer)); } avgKval /= numEntries; avgHsuPer /= numEntries; }
public bool Print(ref CustomerData data, ref CustomerDataTableList dataTable) { if (!Validate()) return false; return CreateData(ref data, ref dataTable); }
private bool CreateData(ref CustomerData data, ref CustomerDataTableList dataTable) { CustomerDataTable tmpTable = new CustomerDataTable(); String imagePath; bool ret = CheckValue(); if (!ret) return ret; imagePath = Helper.SaveImageCapture(captureImageBox.Image.Bitmap, txt_vehNo.Text); data.AddCustomerData(txt_vehNo.Text, cmb_category.Text, cmb_vehMake.Text, cmb_vehModel.Text, txt_fuelTupe.Text, txt_validUpto.Text, txt_regYear.Text, txt_result.Text, imagePath); dataTable = generator.GetDataTableList(); #if XMLDone for (int i = 0; i < grd_dataTable.RowCount-1; i++) { tmpSrno = Convert.ToInt32(grd_dataTable.Rows[i].Cells["srno"].Value.ToString()); tmpRmpMin = Convert.ToInt32(grd_dataTable.Rows[i].Cells["rpmMin"].Value.ToString()); tmpRpmMax = Convert.ToInt32(grd_dataTable.Rows[i].Cells["rpmMax"].Value.ToString()); tmpOilTemp = Convert.ToInt32(grd_dataTable.Rows[i].Cells["oilTemp"].Value.ToString()); tmpKval = Convert.ToDouble(grd_dataTable.Rows[i].Cells["kVal"].Value.ToString()); tmpHsuper = Convert.ToDouble(grd_dataTable.Rows[i].Cells["hsuPer"].Value.ToString()); tmpTable.AddCustomerDataTable(tmpSrno, tmpRmpMin, tmpRpmMax, tmpOilTemp, tmpKval, tmpHsuper); dataTable.AddData(tmpTable); } #endif return true; }