Ejemplo n.º 1
0
        private void mnuSaveMappings_Click(object sender, EventArgs e)
        {
            if (saveFileName == "")
            {
                saveDLG.Title = "Select the Location and File for Mappings";
                DialogResult theAns = saveDLG.ShowDialog();

                if (theAns == DialogResult.OK)
                {
                    FileInfo theFile = new FileInfo(saveDLG.FileName);

                    try
                    {
                        if (theFile.Exists) { theFile.Delete(); }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("The File cannot be deleted... it is in use!", "Error Deleting File", MessageBoxButtons.OK);
                        return;
                    }
                    // Create the Access Database
                    if (MiscProcs.CreateAccessDatabase(saveDLG.FileName))
                    {
                        // create the class object for mappings manipulation
                        theInst = new msAccProcs(saveDLG.FileName);

                        if (theInst.isConnected)
                        {
                            // store the file name for future use
                            saveFileName = saveDLG.FileName;

                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void mnuInstructions_Click(object sender, EventArgs e)
        {
            FileInfo fInfo;
            DialogResult resDlg;

            try
            {
                instDLG.Title = "Select the Mappings Database";
                instDLG.Filter = "Mappings Files (*.mdb)|*.mdb";
                resDlg = instDLG.ShowDialog();

                if (resDlg == DialogResult.OK)
                {
                    fInfo = new FileInfo(instDLG.FileName);
                    theInst = new msAccProcs(fInfo.FullName);

                    //instWorkspaceLabel.Text = MiscProcs.TrimText(fInfo.FullName, instWorkspaceLabel.Font, instWorkspaceLabel.Size);

                }
            }
            catch (Exception ex) { }

            GC.Collect();
        }