コード例 #1
0
ファイル: frmMain.cs プロジェクト: SchleimKeim/Cugar
        private void Form1_Load(object sender, EventArgs e)
        {
            /* If its the first start show frmSettings */
            if (Cugar.Properties.Settings.Default.first_start == true)
            {
                frmSettings m_SubForm_Settings = new frmSettings();
                m_SubForm_Settings.ShowDialog();
            }

            if (m_DS.Tables.Count == 0)
            {
                #region prepare cCao Object and cSugar Object
                try
                {
                    m_objCao = new cCao(m_DS);
                }
                catch (Exception asdf)
                {
                    MessageBox.Show(asdf.ToString());
                    Application.Exit();
                }

                try
                {
                    m_objSugar = new cSugar(m_DS);
                    #region obsolete
                    //searchme
                    //m_objSugar = new cSugar(m_DS, m_BS_SugarSearchContacts);
                    //m_objSugar = new cSugar(m_DS);
                    //m_objSugar.LoadPrivateCustomers();
                    //m_dvSugar = m_DS.Tables[m_const_strSugarTablePrivate].DefaultView;
                    //dgvSugar.DataSource = m_dvSugar;
                    #endregion
                }
                catch (Exception asdf)
                {
                    MessageBox.Show("Ein Fehler ist aufgetreten!\n Bitte überprüfen Sie die Einstellungen!");
                    MessageBox.Show(asdf.ToString());
                    Application.Exit();
                }
                #endregion

                /* Versandarten ausfüllen */
                if (m_objCao.testConnection == true)
                {
                    LoadCaoVersandArten();
                    cboCaoVersand.SelectedIndex = 0;
                }

                /* zahlunggsarten ausfüllen */

                if (m_objCao.testConnection == true)
                {
                    LoadCaoZahlungsarten();
                    cboCaoZahlart.SelectedIndex = 0;
                }

            }
            // Prepare cbos
            cboAnrede.SelectedIndex = 0;
            cboFAnrede.SelectedIndex = 0;
            cboFSugarType.SelectedIndex = 0;
            cboFCaoBriefanrede.SelectedIndex = 0;
            cboFSugarType.SelectedIndex = 0;
            cboCaoBriefanrede.SelectedIndex = 0;
            cboFSugarIndustry.SelectedIndex = 0;
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: SchleimKeim/Cugar
 /// <summary>
 /// Creates a new frmSearch
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void connectionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     frmSettings m_SubForm_Settings = new frmSettings();
     m_SubForm_Settings.ShowDialog();
 }