private void btn_process_Click(object sender, System.EventArgs e) { POT_PTFE_VERSO_BEARING_DESIGN vtmp = null; Button btn = sender as Button; if (iApp.Check_Demo_Version()) { Save_FormRecord.Get_Demo_Data(this); } if (btn.Name == btn_VMABT_process.Name) { Set_VMABT_Input_Data(); vtmp = VMABT; } else if (btn.Name == btn_VMABL_process.Name) { Set_VMABL_Input_Data(); vtmp = VMABL; } else if (btn.Name == btn_VBAB_process.Name) { Set_VBAB_Input_Data(); vtmp = VBAB; } else if (btn.Name == btn_VFB_process.Name) { Set_VFB_Input_Data(); vtmp = VFB; } if (vtmp != null) { vtmp.Generate_Report(); iApp.Save_Form_Record(this, user_path); MessageBox.Show(this, "Report file created in " + vtmp.Report_File, "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); iApp.View_Result(vtmp.Report_File); } }
private void btn_open_save_design_Click(object sender, System.EventArgs e) { Button btn = sender as Button; if (iApp.Check_Demo_Version()) { Save_FormRecord.Get_Demo_Data(this); } POT_PTFE_VERSO_BEARING_DESIGN vtmp = null; if (btn.Name == btn_save_VMABT_des.Name) { Set_VMABT_Input_Data(); vtmp = VMABT; } else if (btn.Name == btn_save_VMABL_des.Name) { Set_VMABL_Input_Data(); vtmp = VMABL; } else if (btn.Name == btn_save_VBAB_des.Name) { Set_VBAB_Input_Data(); vtmp = VBAB; } else if (btn.Name == btn_save_VFB_des.Name) { Set_VFB_Input_Data(); vtmp = VFB; } if (vtmp != null) { vtmp.Generate_Report(); using (SaveFileDialog sfd = new SaveFileDialog()) { sfd.FileName = vtmp.BearingDesign.ToString(); sfd.Filter = "All Report Files(*.txt)|*.txt"; if (sfd.ShowDialog() != System.Windows.Forms.DialogResult.Cancel) { try { File.Copy(vtmp.Report_File, sfd.FileName, true); MessageBox.Show(this, "Report file created in " + sfd.FileName, "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); iApp.Save_Form_Record(this, Path.GetDirectoryName(sfd.FileName)); iApp.View_Result(sfd.FileName); } catch (Exception ex) { } } } } else if ((btn.Name == btn_open_VMABT_des.Name) || (btn.Name == btn_open_VBAB_des.Name) || (btn.Name == btn_open_VFB_des.Name) || (btn.Name == btn_open_VMABL_des.Name)) { using (OpenFileDialog ofd = new OpenFileDialog()) { ofd.Filter = "All Report Files(*.txt)|*.txt"; if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.Cancel) { try { iApp.Read_Form_Record(this, Path.GetDirectoryName(ofd.FileName)); MessageBox.Show(this, "Previous Design opened successfully. " + ofd.FileName, "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); //To do } catch (Exception ex) { } } } } }