Beispiel #1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            this.Font = menuStrip1.Font;
            //fg.DoubleBuffer = true;
            meuDataBase();
            if (System.Threading.Thread.CurrentThread.CurrentUICulture.Name == "en-US")
            {
                帮助文档ToolStripMenuItem.Visible = false;
            }
            #region Config System
            ExeConfigurationFileMap file = new ExeConfigurationFileMap();
            file.ExeConfigFilename = "DataBase.config";
            GlobalCofigData.Config = ConfigurationManager.OpenMappedExeConfiguration(file, ConfigurationUserLevel.None);
            if (GlobalCofigData.Config.Sections["PrintConfigSection"] == null)
            {
                PrintConfigSection customSection = new PrintConfigSection();
                GlobalCofigData.Config.Sections.Add("PrintConfigSection", customSection);
                customSection.SectionInformation.ForceSave = true;
                GlobalCofigData.Config.Save(ConfigurationSaveMode.Full);
            }
            GlobalCofigData.PrintConfig = GlobalCofigData.Config.Sections["PrintConfigSection"] as PrintConfigSection;

            if (GlobalCofigData.Config.Sections["SystemConfigSection"] == null)
            {
                SystemConfigSection customSection = new SystemConfigSection();
                GlobalCofigData.Config.Sections.Add("SystemConfigSection", customSection);
                customSection.SectionInformation.ForceSave = true;
                GlobalCofigData.Config.Save(ConfigurationSaveMode.Full);
            }
            GlobalCofigData.SystemConfig          = GlobalCofigData.Config.Sections["SystemConfigSection"] as SystemConfigSection;
            GlobalCofigData.SystemConfig.PassWord = (string)Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Sundy\SDAF", @"PassWord", "");
            if (GlobalCofigData.SystemConfig.PassWord == null)
            {
                GlobalCofigData.SystemConfig.PassWord = "";
            }
            #endregion

            //印尼专用版
            try
            {
                string pathStr = Application.StartupPath + @"\DeletedData.sdaf";
                if (File.Exists(pathStr))
                {
                    using (StreamReader sr = new StreamReader(pathStr))
                    {
                        for (int i = 0; i < 10; i++)
                        {
                            string autoNo = sr.ReadLine();
                            if (autoNo == null)
                            {
                                break;
                            }
                            else
                            {
                                string DirectoryPath = GlobalCofigData.SystemConfig.PictureSavePath + @"\" + autoNo.Substring(0, 8) + @"\" + autoNo;
                                if (System.IO.Directory.Exists(DirectoryPath))
                                {
                                    System.IO.Directory.Delete(DirectoryPath, true);
                                }
                            }
                        }
                        sr.Close();
                    }
                    File.Delete(pathStr);
                }
            }
            catch (Exception aa)
            {
            }

            AutoBackUp();

            splitHorizontal2.Panel2Collapsed = true;
            splitVertical.Panel1Collapsed    = true;

            picTestDate1.Value          = DateTime.Now;
            picTestDate2.Value          = DateTime.Now;
            cmbResultType.SelectedIndex = 0;
            cmbTestDate.SelectedIndex   = 0;
            cmbAutoNo.SelectedIndex     = 0;
            cmbTestType.SelectedIndex   = 0;
            DataOperate.InitDataOprate(fg);
            cmbTester.DataSource         = DataOperate.dataSet11.Tables["UserTable"];
            this.cmbTester.DisplayMember = "用户名称";

            frmPrint = new FormPreview();
            DataOperate.MyTable.RowChanged += new DataRowChangeEventHandler(MyTable_RowChanged);

            splitHorizontal2.SplitterDistance = 376;
        }
Beispiel #2
0
 private void FormFriction_Load(object sender, EventArgs e)
 {
     DataOperate.InitDataOprate(c1FlexGrid1);
 }