private void Fill_All_Slab() { foreach (vdFigure fig in VDoc.ActiveLayOut.Entities) { if (fig is vdPolyline) { fig.Deleted = true; } } string ff = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text); foreach (var item in Directory.GetFiles(Path.GetDirectoryName(ff))) { ff = Path.GetFileNameWithoutExtension(item); if (ff.StartsWith("S")) { try { string beams = ff.Replace("S", ""); beams = beams.Replace("_", " ").Trim(); Fill_Slab(beams); } catch (Exception eex) { } } } }
void Load_Slab_Data() { Slab_Data = new Hashtable(); string fname = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text); fname = Path.Combine(Path.GetDirectoryName(fname), "SLAB_DATA.TXT"); if (File.Exists(fname)) { List <string> list = new List <string>(File.ReadAllLines(fname)); for (int i = 0; i < list.Count; i++) { MyStrings mli = new MyStrings(list[i], ','); object obj = Slab_Data[mli.StringList[0].Trim()]; if (obj != null) { Slab_Data.Remove(mli.StringList[0].Trim()); } Slab_Data.Add(mli.StringList[0].Trim(), list[i]); } } }
private void btn_delete_slab_Click(object sender, EventArgs e) { MyStrings mfls = new MyStrings(txt_beam_nos.Text, ','); foreach (var item in mfls.StringList) { string fn = Slab_des.Get_Report_File(item.Trim(), cmb_flr_lvl.Text); if (File.Exists(fn)) { if (MessageBox.Show("Do you want to Delete this Slab Design [" + item.Trim() + "] ?", "ASTRA", MessageBoxButtons.YesNo) == DialogResult.Yes) { File.Delete(fn); } } } Fill_All_Slab(); //string fn = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text); //if (File.Exists(fn)) //{ // if (MessageBox.Show("Do you want to Delete this Slab Design ?", "ASTRA", MessageBoxButtons.YesNo) == DialogResult.Yes) // { // File.Delete(fn); // Fill_All_Slab(); // } //} }
private void button1_Click(object sender, EventArgs e) { MyStrings mlist = new MyStrings(txt_beam_nos.Text, ','); List <string> list = new List <string>(); string fn = ""; //list.AddRange(SlabDesign.Get_Banner()); for (int i = 0; i < mlist.Count; i++) { list.Add(string.Format("")); list.Add(string.Format("----------------------------------------------------------------------------")); list.Add(string.Format("SLAB_DESIGN {0} : SLAB MEMBERS [{1}] , FLOOR LEVEL : {2}", (i + 1), mlist.StringList[i], cmb_flr_lvl.Text)); list.Add(string.Format("----------------------------------------------------------------------------")); list.Add(string.Format("")); list.Add(string.Format("")); fn = Slab_des.Get_Report_File(mlist.StringList[i].Trim(), cmb_flr_lvl.Text); if (File.Exists(fn)) { list.AddRange(File.ReadAllLines(fn)); } else { MessageBox.Show(this, "Design is not done for the selected Slab(s).", "ASTRA"); return; } } list.Add(string.Format("")); list.Add(string.Format("")); //fn = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text); fn = Slab_des.Report_File; File.WriteAllLines(fn, list.ToArray()); if (File.Exists(fn)) { frmASTRAReport.OpenReport(fn, this, mlist.Count > 1); } else { MessageBox.Show(this, "Design is not done for the selected Slab(s).", "ASTRA"); } }
public void Save_Data() { string fname = Slab_des.Get_Report_File(txt_beam_nos.Text, cmb_flr_lvl.Text); fname = Path.Combine(Path.GetDirectoryName(fname), "SLAB_DATA.TXT"); string kStr = ""; string def_loads = ""; int i = 0; for (i = 0; i < dgv_dls.RowCount - 1; i++) { def_loads += string.Format("{0}${1}$", dgv_dls[0, i].Value.ToString(), dgv_dls[1, i].Value.ToString()); } kStr = string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19}", txt_beam_nos.Text , txt_slab_D.Text , cmb_slab_fck.Text , txt_slab_gamma.Text , cmb_slab_fy.Text , txt_slab_wll.Text , txt_slab_DLF.Text , txt_slab_LLF.Text , txt_slab_c.Text , txt_slab_d1.Text , txt_slab_s1.Text , txt_slab_d2.Text , txt_slab_s2.Text , txt_slab_d3.Text , txt_slab_s3.Text , txt_slab_d4.Text , txt_slab_s4.Text , cmb_slab_type.Text , def_loads, Slab_des.IS_DESIGN_OK ? "OK" : "NOT OK" ); List <string> list = new List <string>(); string dta = (string)Slab_Data[txt_beam_nos.Text.Trim()]; //list.AddRange(File.ReadAllLines(fname)); if (dta == null) { Slab_Data.Add(txt_beam_nos.Text.Trim(), kStr.Trim()); } else { Slab_Data.Remove(txt_beam_nos.Text); Slab_Data.Add(txt_beam_nos.Text, kStr); } list.Clear(); foreach (DictionaryEntry de in Slab_Data) { list.Add(de.Value.ToString()); } File.WriteAllLines(fname, list.ToArray()); }