void Load_Pile_Data() { string fname = Pile_Design.Get_Report_File(1); fname = Path.Combine(Path.GetDirectoryName(fname), "PILE_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; do { dgv_columns[c, i].Value = mli.StringList[c]; }while (++c < dgv_columns.ColumnCount); //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 - 1] != "") { Set_Grid_Color(i, true, !mli.StringList[c - 1].Contains("NOT")); } } catch (Exception exc) { } } } }
//Hashtable Beam_Data = new Hashtable(); public void Save_Data() { string fname = Pile_Design.Get_Report_File(1); fname = Path.Combine(Path.GetDirectoryName(fname), "PILE_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(PileFoundation.Get_Banner()); foreach (var item in list_rows) { r = item; f = Pile_Design.Get_Report_File(r + 1); if (File.Exists(f)) { list.Add(string.Format("-------------------------------------------")); list.Add(string.Format("PILE_DESIGN {0} : {1}", item + 1, "")); list.Add(string.Format("-------------------------------------------")); list.AddRange(File.ReadAllLines(f)); } else { if (MessageBox.Show(this, string.Format("Design is not done for the selected Pile Foundation {0}.\n\nDo you want to continue ?", dgv[2, r].Value), "ASTRA", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } //MessageBox.Show(this, "Design not done for this Pile Foundation(s)."); } } if (list.Count > 0) { File.WriteAllLines(Pile_Design.Report_File, list.ToArray()); f = Pile_Design.Report_File; if (File.Exists(f)) { frmASTRAReport.OpenReport(f, this); } else { MessageBox.Show(this, "Design not done for this Pile Foundation(s)."); } } }