Beispiel #1
0
    void OutputBOM()
    {
        try
        {
            IDXPWorkSpace CurrentWorkspace = DXP.GlobalVars.DXPWorkSpace;
            IDXPProject   CurrentProject;
            CurrentProject = CurrentWorkspace.DM_FocusedProject();
            string BasePath = CurrentProject.DM_GetOutputPath();

            if (!Directory.Exists(BasePath))
            {
                Directory.CreateDirectory(BasePath);
            }

            StreamWriter swOutput = new StreamWriter(BasePath + "\\Partnumber Variant Report " + DateTime.Today.ToString("MM-dd-yyyy") + ".csv");
            swOutput.WriteLine("PE Flt Partnumber, PE Eng Partnumber, Base Partnumber, Base LibRef, RefDes, UniqueID, Var Flt Partnumber, Var Flt LibRef, Var Eng Partnumber, Var Eng LibRef");
            foreach (CompData item in PartnumberCompList.Values)
            {
                swOutput.WriteLine(item.ToString());
            }
            swOutput.Close();

            System.Diagnostics.Process.Start(BasePath + "\\Partnumber Variant Report " + DateTime.Today.ToString("MM-dd-yyyy") + ".csv");

            swOutput = new StreamWriter(BasePath + "\\Refdes Variant Report.csv");
            swOutput.WriteLine("PE Flt Partnumber, PE Eng Partnumber, Base Partnumber, Base LibRef, RefDes, UniqueID, Var Flt Partnumber, Var Flt LibRef, Var Eng Partnumber, Var Eng LibRef");
            foreach (CompData item in RefCompList.Values)
            {
                swOutput.WriteLine(item.ToString());
            }
            swOutput.Close();
            System.Diagnostics.Process.Start(BasePath + "\\Refdes Variant Report.csv");
            swOutput.Dispose();
        }
        catch (Exception ex)
        {
            ErrorMail.LogError("Error in " + System.Reflection.MethodBase.GetCurrentMethod().Name + ".", ex);
            return;
        }
    }
Beispiel #2
0
    private void btnBrowse_Click(object sender, EventArgs e)
    {
        try
        {
            IDXPWorkSpace CurrentWorkspace = DXP.GlobalVars.DXPWorkSpace;
            IDXPProject   CurrentProject;
            CurrentProject = CurrentWorkspace.DM_FocusedProject();

            openFileDialog.InitialDirectory = CurrentProject.DM_GetOutputPath(); //Start file browser in project outputs.
            if (openFileDialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            txtPath.Text = openFileDialog.FileName;
        }
        catch (Exception ex)
        {
            ErrorMail.LogError("Error in " + System.Reflection.MethodBase.GetCurrentMethod().Name + ".", ex);
            return;
        }
    }