private void Button_build(object sender, RoutedEventArgs e) { IsNumber Isnumber = new IsNumber(); if (name.Text.Length != 0 && buildCost.Text.Length != 0 && recoveryN.Text.Length != 0 && operatingCost.Text.Length != 0 && oilCost.Text.Length != 0 && electricityCost.Text.Length != 0) { if (Isnumber.isNumber(buildCost.Text.Trim()) == false || Isnumber.isNumber(recoveryN.Text.Trim()) == false || Isnumber.isNumber(operatingCost.Text.Trim()) == false || Isnumber.isNumber(oilCost.Text.Trim()) == false || Isnumber.isNumber(electricityCost.Text.Trim()) == false) { MessageBox.Show("输入格式有误"); } else { OtherDAL dal = new OtherDAL(); dal.delOtherData(id); Other other = new Other(id, name.Text, buildCost.Text, recoveryN.Text, operatingCost.Text, oilCost.Text, electricityCost.Text); dal.addOtherData(other); MessageBox.Show("修改成功"); Close(); return; } } else { MessageBox.Show("请确保没有空白项"); } }
private void Button_Click(object sender, RoutedEventArgs e) { Pipe pipe = new Pipe(proid, pipeid, start_spot.Text, end_spot.Text, pipe_name.Text, pipe_length.Text, pipe_outer_diameter.Text, wall_thickness.Text, pipe_depth.Text, transport_medium.Text, insulation_materials.Text, tank_type_a.Text, tank_type_b.Text, tank_capacity_a.Text, tank_capacity_b.Text, maximum_pressure.Text); IsNumber Isnumber = new IsNumber(); if (Isnumber.isNumber(pipe_length.Text.Trim()) == false || Isnumber.isNumber(pipe_outer_diameter.Text.Trim()) == false || Isnumber.isNumber(wall_thickness.Text.Trim()) == false || Isnumber.isNumber(pipe_depth.Text.Trim()) == false || Isnumber.isNumber(tank_capacity_a.Text.Trim()) == false || Isnumber.isNumber(tank_capacity_b.Text.Trim()) == false || Isnumber.isNumber(maximum_pressure.Text.Trim()) == false) { MessageBox.Show("输格式入有误"); } else { PipeDAL pipeDAL = new PipeDAL(); pipeDAL.addPipeData(pipe); MessageBox.Show("添加成功"); Close(); } }
private void Button_build(object sender, RoutedEventArgs e) { IsNumber Isnumber = new IsNumber(); Pump pump = new Pump(name.Text, id, head.Text, displacement.Text, power.Text, suctionPressure.Text, runTime.Text, inPressure.Text, outPressure.Text); if (Isnumber.isNumber(head.Text.Trim()) == false || Isnumber.isNumber(displacement.Text.Trim()) == false || Isnumber.isNumber(power.Text.Trim()) == false || Isnumber.isNumber(suctionPressure.Text.Trim()) == false || Isnumber.isNumber(runTime.Text.Trim()) == false || Isnumber.isNumber(inPressure.Text.Trim()) == false || Isnumber.isNumber(outPressure.Text.Trim()) == false) { MessageBox.Show("输入格式有误"); } else { PumpDAL pumpdal = new PumpDAL(); pumpdal.addPumpData(pump); MessageBox.Show("添加成功"); Close(); } }
private void Button_build(object sender, RoutedEventArgs e) { Oils oils = new Oils(id, name.Text, density.Text, viscosity.Text, masFlow.Text, outputByYear.Text, volume_concentration.Text); IsNumber Isnumber = new IsNumber(); if (Isnumber.isNumber(density.Text.Trim()) == false || Isnumber.isNumber(viscosity.Text.Trim()) == false || Isnumber.isNumber(masFlow.Text.Trim()) == false || Isnumber.isNumber(outputByYear.Text.Trim()) == false || Isnumber.isNumber(volume_concentration.Text.Trim()) == false) { MessageBox.Show("输入格式有误"); } else { OilsDAL oilsdal = new OilsDAL(); oilsdal.addOilsData(oils); MessageBox.Show("添加成功"); Close(); } }
private void Button_build(object sender, RoutedEventArgs e) { IsNumber Isnumber = new IsNumber(); Soil soil = new Soil(id, soilName.Text, soilTemp.Text, soilDiff.Text); if (Isnumber.isNumber(soilTemp.Text.Trim()) == false || Isnumber.isNumber(soilDiff.Text.Trim()) == false) { MessageBox.Show("输入格式有误"); } else { SoilDAL dal = new SoilDAL(); dal.addSoilData(soil); MessageBox.Show("添加成功"); Close(); } }