Exemplo n.º 1
0
        private void ShowBackEndForm()
        {
            if (_WorkSpace.Contains(CodeGeneratorCommon.GeneratorsType.BackEnd))
            {
                return;
            }



            try
            {
                ofrmDACGenerator                       = new frm_DACGenerator();
                ofrmDACGenerator.Closing              += new CancelEventHandler(ofrmDACGenerator_Closing);
                ofrmDACGenerator.LastAccessStorage     = _LastAccessStorage;
                ofrmDACGenerator.TemplateSettingObject = _TemplateSettingObject;

                ofrmDACGenerator.MdiParent = this;
                _WorkSpace.Add(ofrmDACGenerator, CodeGeneratorCommon.GeneratorsType.BackEnd);

                ShowFrm(ofrmDACGenerator);
            }
            catch (Exception ex)
            {
                MessageView ofrmMessageView = new MessageView();
                ofrmMessageView.MdiParent = this;
                ofrmMessageView.Message   = ex.Message;
                ofrmMessageView.Show();
            }
        }
Exemplo n.º 2
0
 void _LoadFromDAtaBaseWorker_StartWorkEvent(String pMessage, String pOtherMsg)
 {
     if (this.InvokeRequired)
     {
         X        oDelegate = new X(_LoadFromDAtaBaseWorker_StartWorkEvent);
         object[] args;
         args = new object[2] {
             pMessage, pMessage
         };
         this.Invoke(oDelegate, args);
     }
     else
     {
         if (pOtherMsg.Length == 0)
         {
             _MessageViewWait = new MessageViewWait();
             _MessageViewWait.OptionalMessage = pMessage;
             _MessageViewWait.ShowDialog();
         }
         else
         {
             MessageView.Show(pMessage + Environment.NewLine + pOtherMsg);
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Deserializa un objeto Metadata desde un archivo XML.
        /// </summary>
        /// <param name="pszFullPath">Ruta al archivo XML con el objeto Metadata serializado.</param>
        private void LoadMetaDataFromXml(string pszFullPath)
        {
            XmlSerializer oSerializer = new System.Xml.Serialization.XmlSerializer(typeof(Fwk.DataBase.Metadata));

            Stream oFileStream = null;

            try
            {
                oFileStream = File.OpenRead(pszFullPath);

                _Metadata = (Fwk.DataBase.Metadata)oSerializer.Deserialize(oFileStream);

                this.ConnectionOk = true;

                IsLoadedMetaDataFromXML = true;

                this.RefreshMetadata();
            }
            catch (Exception ex)
            {
                MessageView.Show(ex);
            }
            finally
            {
                if (oFileStream != null)
                {
                    oFileStream.Close();
                }
                oFileStream = null;
                oSerializer = null;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Inicia LoadFromDAtaBaseWorker para que trabaje ebn un hilo diferente
        /// </summary>
        protected bool RefreshMetadata()
        {
            if (_Metadata.CnnString == null)
            {
                MessageView.Show("Debe establecer una conexión a la bace dedatos.-");
                return(false);
            }
            //Si la metadata se abre desde un archivo, no ejecuto este método.
            if (LoadMetaDataFromXML)
            {
                if (!IsLoadedMetaDataFromXML)
                {
                    this.LoadMetaDataFromXml();
                }
                return(true);
            }


            try
            {
                if (!_Metadata.TestConnection())
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageView.Show(ex);
                return(false);
            }


            LoadFromDatabaseWorker _LoadFromDatabaseWorker = new LoadFromDatabaseWorker();

            _LoadFromDatabaseWorker.StartWorkEvent   += new StartWorkHandler(_LoadFromDAtaBaseWorker_StartWorkEvent);
            _LoadFromDatabaseWorker.FinishtWorkEvent += new FinishWorkHandler(_LoadFromDatabaseWorker_FinishtWorkEvent);
            _LoadFromDatabaseWorker.FailtWorkEvent   += new FailWorkHandler(_LoadFromDatabaseWorker_FailtWorkEvent);

            _LoadFromDatabaseWorker.SelectedObject = _SelectedObject;
            _LoadFromDatabaseWorker.Metadata       = _Metadata;

            _LoadFromDatabaseWorker.Start();

            _LoadFromDatabaseWorker.StartWorkEvent   -= new StartWorkHandler(_LoadFromDAtaBaseWorker_StartWorkEvent);
            _LoadFromDatabaseWorker.FinishtWorkEvent -= new FinishWorkHandler(_LoadFromDatabaseWorker_FinishtWorkEvent);
            return(true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Carga el archivo LastAccess.xml
        /// </summary>
        protected void InitializeLastAccessSource()
        {
            try
            {
                _Metadata = new Fwk.DataBase.Metadata();
            }
            catch (Exception ex)
            {
                //Common.WriteEntryEventLog("Error en InitializeLastAccessSource. Puede que no este bien formado el archivo LastAcces.xml", ex,1000, System.Diagnostics.EventLogEntryType.Error);


                StringBuilder message = new StringBuilder("Error en InitializeLastAccessSource. ");
                message.Append(Environment.NewLine);

                message.Append(Environment.NewLine);

                message.Append("AllMessageException: " + Environment.NewLine + Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex));



                MessageView.Show(message.ToString());
            }
        }
Exemplo n.º 6
0
        private void ShowBackEndForm()
        {
            if(_WorkSpace.Contains(CodeGeneratorCommon.GeneratorsType.BackEnd)) return;
            
            

            try
            {
                ofrmDACGenerator = new frm_DACGenerator();
                ofrmDACGenerator.Closing += new CancelEventHandler(ofrmDACGenerator_Closing);
                ofrmDACGenerator.LastAccessStorage = _LastAccessStorage;
                ofrmDACGenerator.TemplateSettingObject = _TemplateSettingObject;

                ofrmDACGenerator.MdiParent = this;
                _WorkSpace.Add(ofrmDACGenerator, CodeGeneratorCommon.GeneratorsType.BackEnd);
                
                ShowFrm(ofrmDACGenerator);
            }
            catch (Exception ex)
            {
                MessageView ofrmMessageView = new MessageView();
                ofrmMessageView.MdiParent = this;
                ofrmMessageView.Message = ex.Message;
                ofrmMessageView.Show();
            }
        }