Example #1
0
 //-----------------------------------------------------------------
 public static void EditeSession(CSessionImport session)
 {
     using (CFormEditionSessionImport frm = new CFormEditionSessionImport())
     {
         frm.m_session = session;
         frm.ShowDialog();
     }
 }
Example #2
0
        private void m_lnkEditerSession_LinkClicked(object sender, EventArgs e)
        {
            CConfigMappagesSmartImport config = null;
            DataTable      tableSource        = null;
            CResultAErreur res = PrepareImport(ref config, ref tableSource);

            if (!res)
            {
                CFormAlerte.Afficher(res.Erreur);
                return;
            }
            m_sessionImport.ConfigMappage = config;
            m_sessionImport.TableSource   = tableSource;
            CFormEditionSessionImport.EditeSession(m_sessionImport);
        }
Example #3
0
        //--------------------------------------------------------------
        private void m_btnImporter_Click(object sender, EventArgs e)
        {
            CConfigMappagesSmartImport config = null;
            DataTable      table  = null;
            CResultAErreur result = PrepareImport(ref config, ref table);

            if (!result || table == null)
            {
                CFormAlerte.Afficher(result.Erreur);
                return;
            }
            if (!CFormOptionsImport.EditeOptions(m_optionsExecution))
            {
                return;
            }

            IIndicateurProgression indicateur = null;

            indicateur = CFormProgression.GetNewIndicateurAndPopup(I.T("Importing data|20245"));
            CResultAErreurType <CSessionImport> resSession;

            resSession = config.DoImportSurServeur(CSc2iWin32DataClient.ContexteCourant.IdSession,
                                                   table,
                                                   m_optionsExecution,
                                                   indicateur);
            CFormProgression.EndIndicateur(indicateur);
            if (m_optionsExecution.NomFichierSauvegarde != null &&
                m_optionsExecution.NomFichierSauvegarde.Length > 0)
            {
                result = CSerializerObjetInFile.SaveToFile(resSession.DataType, "IMPORT_SESSION", m_optionsExecution.NomFichierSauvegarde);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                }
            }
            SetSessionEnCours(resSession.DataType);
            CFormEditionSessionImport.EditeSession(m_sessionImport);
        }