private void store(OleDbConnection cn, FrameSection obj) { ConcreteSectionProps cprops = obj.ConcreteProperties; string concC = (cprops != null && cprops is ConcreteColumnSectionProps) ? "Yes" : "No"; string concB = (cprops != null && cprops is ConcreteBeamSectionProps) ? "Yes" : "No"; string sql = "INSERT INTO [Frame Section Properties 01 - General] " + "(SectionName, Material, Shape, t3, t2, tf, tw, t2b, tfb, Area, TorsConst, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22, ConcCol, ConcBeam, Color, TotalWt, TotalMass, FromFile, AMod, A2Mod, A3Mod, JMod, I2Mod, I3Mod, MMod, WMod) " + "VALUES (\"" + obj.Name + "\", \"" + obj.Material.Name + "\", \"" + secShape(obj.Shape) + "\", " + obj.T3 + ", " + obj.T2 + ", " + obj.Tf + ", " + obj.Tw + ", " + obj.T2b + ", " + obj.Tfb + ", " + obj.Area + ", " + obj.TorsConst + ", " + obj.I33 + ", " + obj.I22 + ", " + obj.As2 + ", " + obj.As3 + ", " + obj.S33 + ", " + obj.S22 + ", " + obj.Z33 + ", " + obj.Z22 + ", " + obj.R33 + ", " + obj.R22 + ", \"" + concC + "\", \"" + concB + "\", \"Yellow\", 0, 0, \"No\", 1, 1, 1, 1, 1, 1, 1, 1);"; new OleDbCommand(sql, cn).ExecuteNonQuery(); }
private void UpdatePage4() { if (currentSection == null) // || !(currentSection is Rectangular || currentSection is Circle)) { wizardControl.SelectTab(0); } else { ConcreteSectionProps concProps = currentSection.ConcreteProperties; if (concProps != null) { if (concProps is ConcreteBeamSectionProps) { sqareColumnGroupBox.Visible = false; beamGroupBox.Visible = true; ConcreteBeamSectionProps props = (ConcreteBeamSectionProps)concProps; coverTopTextBox.Text = string.Format("{0}", props.ConcreteCoverTop); coverBottomTextBox.Text = string.Format("{0}", props.ConcreteCoverBottom); coTopLeftTextBox.Text = string.Format("{0}", props.RoTopLeft); coTopRightTextBox.Text = string.Format("{0}", props.RoTopRight); coBottomLeftTextBox.Text = string.Format("{0}", props.RoBottomLeft); coBottomRightTextBox.Text = string.Format("{0}", props.RoBottomRight); } else if (concProps is ConcreteColumnSectionProps) { columnRadioButton.Checked = true; sqareColumnGroupBox.Visible = true; beamGroupBox.Visible = false; ConcreteColumnSectionProps props = (ConcreteColumnSectionProps)concProps; sqColCoverToRebarTextBox.Text = string.Format("{0}", props.CoverToRebarCenter); sqColRebars22TextBox.Text = string.Format("{0}", props.NumberOfBars2Dir); sqColRebars33TextBox.Text = string.Format("{0}", props.NumberOfBars3Dir); sqColReinforcementsTextBox.Text = string.Format("{0}", props.SpacingC); sqColRebarSizeComboBox.SelectedItem = props.BarSize; //sqColReinforcementsTextBox.Text = string.Format("{0:F}", props.); } else // Not concrete column nor beam { wizardControl.SelectTab(0); } } else // Not concrete { wizardControl.SelectTab(0); } } }
private void store(OleDbConnection cn, ConcreteSectionProps obj, FrameSection section, List <Section> exported) { if (obj != null && !exported.Contains(section)) { if (obj is ConcreteBeamSectionProps) { store(cn, (ConcreteBeamSectionProps)obj, section); } else if (obj is ConcreteColumnSectionProps) { store(cn, (ConcreteColumnSectionProps)obj, section); } exported.Add(section); } }
private void nextButton2_Click(object sender, EventArgs e) { if (currentSection == null) { currentMaterial = MaterialManager.Instance.Materials[materialComboBox.SelectedItem.ToString()]; string secName = nameTextBox.Text; ConcreteSectionProps cProps = (currentMaterial.DesignProperties is ConcreteDesignProps) ? concreteSectionProps[0] : null; if (shapeNames["R"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new Rectangular(secName, currentMaterial, cProps, 0.2f, 0.4f); } else if (shapeNames["RN"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new Circle(secName, currentMaterial, cProps, 0.4f); } //else if (shapeNames["2L"].Equals(shapeComboBox.SelectedItem.ToString())) // currentSection = new DoubleAngle(secName, "2L", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f); else if (shapeNames["C"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new Channel(secName, "C", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f); } else if (shapeNames["I"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new IWideFlange(secName, "C", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f); } else if (shapeNames["B"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new BoxTube(secName, "B", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f); } else if (shapeNames["P"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new Pipe(secName, "P", currentMaterial, cProps, 0.2f, 0.02f); } else if (shapeNames["L"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new Angle(secName, "L", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f); } else if (shapeNames["T"].Equals(shapeComboBox.SelectedItem.ToString())) { currentSection = new Tee(secName, "T", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f); } else { currentSection = new General(secName, "G", currentMaterial, cProps, 0.2f, 0.2f, 0, 0, 0, 0, 0, 0.0043f, 9.65e-8f, 0.0000657f, 0.0000033f, 0.002f, 0.002f, 0.00043f, 0.000052f, 0.00049f, 0.000081f, 0.1241f, 0.0278f); } } UpdateModel(1); if (currentSection.GetType().Name.Equals("General")) { wizardControl.SelectTab(4); } else { wizardControl.SelectTab(2); } //if (currentSection is Rectangular || currentSection is Circle) // wizardControl.SelectTab(2); //else // wizardControl.SelectTab(0); DialogResult = DialogResult.None; }
private void UpdateModel(int page) { float value; switch (page) { case 1: currentSection.Name = nameTextBox.Text; if (currentMaterial != null) { currentSection.Material = currentMaterial; } if (!(currentSection.Material.DesignProperties is ConcreteDesignProps)) { currentSection.ConcreteProperties = null; } break; case 2: if (currentSection is Rectangular) { if (float.TryParse(t3TextBox.Text, out value)) { ((Rectangular)currentSection).T3 = value; } if (float.TryParse(t2TextBox.Text, out value)) { ((Rectangular)currentSection).T2 = value; } } else if (currentSection is Circle) { if (float.TryParse(t3TextBox.Text, out value)) { ((Circle)currentSection).D = value; } } else if (currentSection is Pipe) { if (float.TryParse(t3TextBox.Text, out value)) { currentSection.T3 = value; } if (float.TryParse(t2TextBox.Text, out value)) { currentSection.Tw = value; } } else { if (float.TryParse(t3TextBox.Text, out value)) { currentSection.T3 = value; } if (float.TryParse(t2TextBox.Text, out value)) { currentSection.T2 = value; } if (float.TryParse(tfTextBox.Text, out value)) { currentSection.Tf = value; } if (float.TryParse(twTextBox.Text, out value)) { currentSection.Tw = value; } if (float.TryParse(disTextBox.Text, out value)) { currentSection.Dis = value; } } break; case 3: ConcreteSectionProps concProps = currentSection.ConcreteProperties; if (concProps != null) { if (concProps is ConcreteBeamSectionProps) { ConcreteBeamSectionProps props = (ConcreteBeamSectionProps)concProps; // TODO: Add an image to explain if (float.TryParse(coverTopTextBox.Text, out value)) { props.ConcreteCoverTop = value; props.ConcreteCoverBottom = value; } //if (float.TryParse(coverBottomTextBox.Text, out value)) // props.ConcreteCoverBottom = value; if (float.TryParse(coTopLeftTextBox.Text, out value)) { props.RoTopLeft = value; } if (float.TryParse(coTopRightTextBox.Text, out value)) { props.RoTopRight = value; } if (float.TryParse(coBottomLeftTextBox.Text, out value)) { props.RoBottomLeft = value; } if (float.TryParse(coBottomRightTextBox.Text, out value)) { props.RoBottomRight = value; } currentSection.ConcreteProperties = props; } else if (concProps is ConcreteColumnSectionProps) { ConcreteColumnSectionProps props = (ConcreteColumnSectionProps)concProps; int ival; if (int.TryParse(sqColRebars22TextBox.Text, out ival)) { props.NumberOfBars2Dir = ival; } if (int.TryParse(sqColRebars33TextBox.Text, out ival)) { props.NumberOfBars3Dir = ival; } if (float.TryParse(sqColCoverToRebarTextBox.Text, out value)) { props.CoverToRebarCenter = value; } if (float.TryParse(sqColReinforcementsTextBox.Text, out value)) { props.SpacingC = value; } props.BarSize = sqColRebarSizeComboBox.SelectedItem.ToString(); currentSection.ConcreteProperties = props; } } break; case 4: if (currentSection is General) { UpdateGeneralSection(); } break; } }