Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     foreach (ACCSynapseModule amod in Acc_Modules)
     {
         SynapseModule pmod = SynapseModule.LoadByID(amod.ID);
         if (amod.TECHNICALNAME == pmod.TECHNICALNAME)
         {
             pmod.DEVSOURCE      = amod.DEVSOURCE;
             pmod.PRODSOURCE     = amod.PRODSOURCE;
             pmod.MODULECATEGORY = amod.MODULECATEGORY;
             pmod.PATH           = amod.PATH;
             pmod.save();
         }
     }
     LoadModules();
 }
Пример #2
0
        private void syncToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ACCSynapseModule mod = null;

            if (olv_Acc_Modules.SelectedObject != null)
            {
                mod = (ACCSynapseModule)olv_Acc_Modules.SelectedObject;
            }
            if (mod != null)
            {
                ACCSynapseModule amod = (ACCSynapseModule)olv_Acc_Modules.SelectedObject;
                SynapseModule    pmod = SynapseModule.LoadByID(amod.ID);
                if (pmod != null)
                {
                    pmod.MODULECATEGORY = amod.MODULECATEGORY;
                    pmod.PATH           = amod.PATH;
                    pmod.VERSION        = amod.VERSION;
                    pmod.VERSIONDATE    = amod.VERSIONDATE;
                    pmod.TECHNICALNAME  = amod.TECHNICALNAME;
                    pmod.DEVSOURCE      = amod.DEVSOURCE;
                    pmod.PRODSOURCE     = amod.PRODSOURCE;
                    pmod.IS_ACTIVE      = amod.IS_ACTIVE;
                    pmod.save();
                }

                if (mod.DEVSOURCE != mod.PRODSOURCE)
                {
                    GenInstaller.Installer.DoInstall(new System.IO.DirectoryInfo(mod.DEVSOURCE), new System.IO.DirectoryInfo(mod.PRODSOURCE), GenInstaller.InstallOptions.Normal);
                    try
                    {
                        GenInstaller.Installer.ChangeTextInFiles("XS006726", "sql-gen-prd.electrabel.be", new System.IO.DirectoryInfo(mod.PRODSOURCE).GetFiles("*.config", System.IO.SearchOption.TopDirectoryOnly));
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            LoadModules();
        }
Пример #3
0
        private void tsbSave_Click(object sender, EventArgs e)
        {
            if (checkFields())
            {
                SynapseCore.Database.DBFunction.StartTransaction();
                try
                {
                    _module.ID             = _moduleID;
                    _module.PATH           = txPath.Text;
                    _module.TECHNICALNAME  = txTechnicalName.Text;
                    _module.VERSION        = txVersion.Text;
                    _module.VERSIONDATE    = txVersionDate.Text;
                    _module.MODULECATEGORY = txCategory.Text;
                    _module.DEVSOURCE      = txDevSources.Text;
                    _module.PRODSOURCE     = txProdSources.Text;
                    _module.IS_ACTIVE      = ckActive.Checked;
                    _module.IS_REQUESTABLE = ckRequestable.Checked;

                    if (bagName.LblBag.Labels[0].LABELID == 0)
                    {
                        lblid = SynapseLabel.GetNextID();
                        for (Int32 x = 0; x < bagName.LblBag.Labels.Count; x++)
                        {
                            bagName.LblBag.Labels[x].LABELID = lblid;
                        }
                        bagName.Save();
                    }
                    else
                    {
                        lblid = bagName.LblBag.Labels[0].LABELID;
                        bagName.Save();
                    }
                    _module.LABELID = lblid;

                    if (bagDescription.LblBag.Labels[0].LABELID == 0)
                    {
                        lblid = SynapseLabel.GetNextID();
                        for (Int32 x = 0; x < bagDescription.LblBag.Labels.Count; x++)
                        {
                            bagDescription.LblBag.Labels[x].LABELID = lblid;
                        }
                        bagDescription.Save();
                    }
                    else
                    {
                        lblid = bagDescription.LblBag.Labels[0].LABELID;
                        bagDescription.Save();
                    }
                    _module.DESCLABELID = lblid;
                    _module.save();

                    SynapseCore.Database.DBFunction.CommitTransaction();

                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
                catch (Exception ex)
                {
                    SynapseCore.Database.DBFunction.RollbackTransaction();
                    MessageBox.Show("Data not saved in Database:" + ex.Message, "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }