void Load_Footing_Data() { string fname = Foot_Des.Get_Report_File(1); fname = Path.Combine(Path.GetDirectoryName(fname), "FOOTING_DATA.TXT"); if (File.Exists(fname)) { List <string> list = new List <string>(File.ReadAllLines(fname)); int c = 0; for (int i = 0; i < list.Count; i++) { MyStrings mli = new MyStrings(list[i], '$'); try { c = 4; dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; c++; //dgv_columns[c, i].Value = mli.StringList[c]; c++; //dgv_columns[c, i].Value = mli.StringList[c]; c++; dgv_columns[c, i].Value = mli.StringList[c]; if (mli.StringList[c] != "") { Set_Grid_Color(i, true, !mli.StringList[c].Contains("NOT")); } } catch (Exception exc) { } } } }
//Hashtable Beam_Data = new Hashtable(); public void Save_Data() { string fname = Foot_Des.Get_Report_File(1); fname = Path.Combine(Path.GetDirectoryName(fname), "FOOTING_DATA.TXT"); List <string> list = new List <string>(); string kStr = ""; int i = 0; for (i = 0; i < dgv_columns.RowCount; i++) { kStr = ""; for (int c = 0; c < dgv_columns.ColumnCount; c++) { kStr += string.Format("{0}$", dgv_columns[c, i].Value.ToString()); } list.Add(kStr); } File.WriteAllLines(fname, list.ToArray()); }
private void btn_oprn_report_Click(object sender, EventArgs e) { DataGridView dgv = dgv_columns; int r = -1; if (dgv.SelectedCells.Count == 0) { return; } List <int> list_rows = new List <int>(); int i = 0; bool fl = false; for (i = 0; i < dgv.RowCount; i++) { fl = (bool)dgv[1, i].Value; if (fl) { list_rows.Add(i); } } list_rows.Sort(); string f = ""; List <string> list = new List <string>(); list.AddRange(IsolatedFoundationDesign.Get_Banner()); foreach (var item in list_rows) { r = item; f = Foot_Des.Get_Report_File(r + 1); if (File.Exists(f)) { list.AddRange(File.ReadAllLines(f)); } else { MessageBox.Show(this, string.Format("Design is not done for the selected Isolated Footing {0}.", dgv[1, r].Value)); } } if (list.Count > 0) { f = Foot_Des.Report_File; File.WriteAllLines(f, list.ToArray()); if (File.Exists(f)) { frmASTRAReport.OpenReport(f, this); } else { MessageBox.Show(this, "Design is not done for the selected Column(s)."); } } }
public void RunThread() { List <string> list = new List <string>(); #region TechSOFT Banner list.Add(""); list.Add(""); list.Add("\t\t**********************************************"); list.Add("\t\t* ASTRA Pro Release 18.0 *"); list.Add("\t\t* TechSOFT Engineering Services *"); list.Add("\t\t* *"); list.Add("\t\t* DESIGN OF ISOLATED FOUNDATION *"); list.Add("\t\t* *"); list.Add("\t\t**********************************************"); list.Add("\t\t----------------------------------------------"); list.Add("\t\tTHIS RESULT CREATED ON " + System.DateTime.Now.ToString("dd.MM.yyyy AT HH:mm:ss") + " "); list.Add("\t\t----------------------------------------------"); list.Add(""); #endregion int c = 0; int step = 1; string ColumnNos = ""; Design_Summary = new List <string>(); //int c = 0; for (int i = 0; i < dgv_columns.RowCount; i++) { try { c = 1; ColumnData cd = new ColumnData(); cd.IsSelect = (bool)dgv_columns[c++, i].Value; if (cd.IsSelect) { Set_Grid_Color(i, false, Foot_Des.IS_DESIGN_OK); Foot_Des.ColumnNo = dgv_columns[c++, i].Value.ToString(); c++; //Foot_Des.Continuous_ColumnMembers = dgv_columns[c++, i].Value.ToString(); Foot_Des.C1 = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.C2 = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.l = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.b = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.P1 = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.P2 = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.ph = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.bar_dia = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.P = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); Foot_Des.Mx = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0); //Foot_Des.Mx = MyStrings.StringToDouble(dgv_columns[c, i].Value.ToString(), 0.0); list.AddRange(Foot_Des.Design_Program_Loop(i + 1).ToArray()); Design_Summary.Add(string.Format("------------------------------------------------")); //Design_Summary.Add(string.Format("FOUNDATION = {0}, ELEVATION = {1} M", Foot_Des.F)); Design_Summary.Add(string.Format("FOUNDATION = {0}", Foot_Des.ColumnNo)); //Design_Summary.Add(string.Format("CONTINUOUS MEMBERS = {0}", cd.Continuous_ColumnMembers)); Design_Summary.AddRange(Foot_Des.Design_Summary.ToArray()); Design_Summary.Add(string.Format("------------------------------------------------")); #region End of Report list.Add(""); #endregion End of Report dgv_columns[c, i].Value = Foot_Des.IS_DESIGN_OK ? " OK" : "NOT OK"; Set_Grid_Color(i, true, Foot_Des.IS_DESIGN_OK); Add_Foundation_BOQ(Foot_Des.BOQ); } } catch (Exception exx) { } } #region End of Report list.Add(""); list.Add("---------------------------------------------------------------------------"); list.Add("--------------------- END OF REPORT --------------------------"); list.Add("---------------------------------------------------------------------------"); #endregion End of Report File.WriteAllLines(Foot_Des.Report_File, list.ToArray()); string des_sum = Path.Combine(Path.GetDirectoryName(Foot_Des.Get_Report_File(1)), "FOUNDATION_DESIGN_SUMMARY.TXT"); File.WriteAllLines(des_sum, Design_Summary.ToArray()); }