Esempio n. 1
0
 public bool Execute(startup myStartup,object oData, NavigationButtons.Navigation xnav, ref string Err)
 {
     m_usrc_startup_step.check1.State = Check.check.eState.WAIT;
     Application.DoEvents();
     bool bRet = this.procedure(myStartup,oData, xnav, ref Err);
     if (bRet)
     {
         m_usrc_startup_step.check1.State = Check.check.eState.TRUE;
     }
     else
     {
         m_usrc_startup_step.check1.State = Check.check.eState.FALSE;
     }
     return bRet;
 }
 public Form_CheckInsertSampleData(startup xmyStartup, NavigationButtons.Navigation xnav)
 {
     InitializeComponent();
     nav = xnav;
     usrc_NavigationButtons1.Init(nav);
     lngRPM.s_DataBaseIsEmpty_InsertInitialData.Text(this.lbl_Message1);
     lngRPM.s_DataBaseIsEmpty_EnterData.Text(this.lbl_Message2);
     lngRPM.s_Write_predefined_data_into_a_new_database.Text(this.rdb_WritePredefinedDefaultDataInDataBase);
     lngRPM.s_Enter_your_data_manually.Text(this.rdb_Enter_data_into_a_new_database_table);
     this.rdb_Enter_data_into_a_new_database_table.Checked = false;
     this.rdb_WritePredefinedDefaultDataInDataBase.Checked = true;
     this.myStartup = xmyStartup;
     this.Text = "";
     if (myStartup.m_FormIconQuestion != null)
     {
         this.Icon = myStartup.m_FormIconQuestion;
     }
 }
Esempio n. 3
0
 public usrc_Startup(startup xstartup)
 {
     InitializeComponent();
     m_startup = xstartup;
     lngRPM.s_StartupProgram.Text(lbl_StartUp);
     Visible = true;
     Dock = DockStyle.Fill;
     m_startup.m_parent_form.Controls.Add(this);
     int iStep = 0;
     int iCountStep1 = m_startup.Step.Count();
     for (iStep = 0; iStep < iCountStep1;iStep++)
     {
         usrc_startup_step xusrc_startup_step = new usrc_startup_step(m_startup.Step[iStep]);
         xusrc_startup_step.Left = lbl_StartUp.Left;
         xusrc_startup_step.Top = lbl_StartUp.Bottom+ Y_DIST + iStep * (xusrc_startup_step.Height + Y_DIST);
         this.Controls.Add(xusrc_startup_step);
     }
 }
Esempio n. 4
0
 public bool Read_DBSettings_Version(startup myStartup, object oData, NavigationButtons.Navigation xnav, ref string Err)
 {
     bool bUpgradeDone = false;
     bool bCanceled = false;
     fs.enum_GetDBSettings eGetDBSettings_Result = fs.enum_GetDBSettings.No_TextValue;
     myStartup.eGetDBSettings_Result = Read_DBSettings_Version(myStartup, ref eGetDBSettings_Result, ref bUpgradeDone, ref myStartup.bInsertSampleData, ref bCanceled, ref Err);
     myStartup.eNextStep++;
     return true;
 }
Esempio n. 5
0
 public fs.enum_GetDBSettings Read_DBSettings_Version(startup myStartup,ref fs.enum_GetDBSettings eGetDBSettings_Result, ref bool bUpgradeDone,ref bool bInsertSampleData, ref bool bCanceled,ref string Err)
 {
     bool xReadOnly = false;
     bInsertSampleData = false;
     Restore_if_UpgradeBackupFileExists(ref m_Full_backup_filename);
     return fs.GetDBSettings(DBSync.DBSync.DB_for_Tangenta.Settings.Version.Name,
                            ref myStartup.CurrentDataBaseVersionTextValue,
                            ref xReadOnly,
                            ref Err);
 }
Esempio n. 6
0
 private bool CheckInsertSampleData(startup myStartup, NavigationButtons.Navigation xnav)
 {
     Form_CheckInsertSampleData frmdlg = new Form_CheckInsertSampleData(myStartup,xnav);
     xnav.ChildDialog = frmdlg;
     xnav.ShowDialog();
     return myStartup.bInsertSampleData;
 }
Esempio n. 7
0
 public bool GetWorkPeriod(startup myStartup,object oData, NavigationButtons.Navigation xnav, ref string Err)
 {
     if (GlobalData.GetWorkPeriod(f_Atom_WorkPeriod.sWorkPeriod, "Šiht",Properties.Settings.Default.ElectronicDevice_ID,null, DateTime.Now, null, ref Err))
     {
         myStartup.eNextStep++;
     return true;
     }
     else
     {
     LogFile.Error.Show("ERROR:usrc_Main:GlobalData.GetWorkPeriod:Err=" + Err);
         myStartup.eNextStep = Startup.startup_step.eStep.Cancel;
     return false;
     }
 }
Esempio n. 8
0
        internal bool InsertSampleData(startup myStartup, NavigationButtons.Navigation xnav, ref string Err)
        {
            do_CheckInsertSampleData:
            if (!xnav.LastStartupDialog_TYPE.Equals("Tangenta.Form_Select_DefaultCurrency"))
            {
                myStartup.bInsertSampleData = CheckInsertSampleData(myStartup, xnav);
                if (xnav.eExitResult == NavigationButtons.Navigation.eEvent.PREV)
                {
                    myStartup.eNextStep = startup_step.eStep.Check_DataBase; //go back
                    return true;
                }
                else if (xnav.eExitResult == NavigationButtons.Navigation.eEvent.EXIT)
                {
                    myStartup.bCanceled = true;
                    myStartup.eNextStep = startup_step.eStep.Cancel;
                    return false;
                }
            }

            if (myStartup.bInsertSampleData)
            {
                bool bCanceled = false;
                if (TangentaSampleDB.TangentaSampleDB.Init_Sample_DB(ref bCanceled, myStartup.sbd, xnav, Properties.Resources.Tangenta_Icon, ref Err))
                {
                    if (xnav.eExitResult == NavigationButtons.Navigation.eEvent.PREV)
                    {
                        if (xnav.LastStartupDialog_TYPE.Equals("Country_ISO_3166.Form_Select_Country_ISO_3166"))
                        {
                            goto do_CheckInsertSampleData;
                        }
                        myStartup.sbd.DeleteAll();
                        myStartup.eNextStep--; //go back
                        return true;
                    }
                    if (xnav.eExitResult == NavigationButtons.Navigation.eEvent.PREV)
                    {
                        bCanceled = true;
                        myStartup.bCanceled = bCanceled;
                    }
                    if (bCanceled)
                    {
                        myStartup.eNextStep = startup_step.eStep.Cancel;
                    }
                    else
                    {
                        myStartup.eNextStep = startup_step.eStep.GetOrganisationData;
                        return GlobalData.JOURNAL_type_definitions_Read();
                    }
                    return true;
                }
                else
                {
                    myStartup.bCanceled = bCanceled;
                    if (bCanceled)
                    {
                        myStartup.eNextStep = startup_step.eStep.Cancel;
                        return false;
                    }
                    else
                    {
                        LogFile.Error.Show(Err);
                        myStartup.eNextStep = startup_step.eStep.Cancel;
                        return false;
                    }
                }
            }
            else
            {
                if (fs.Init_Default_DB(ref Err))
                {
                    if (GlobalData.JOURNAL_type_definitions_Read())
                    {
                        myStartup.eNextStep++;
                        return true;
                    }
                    else
                    {
                        myStartup.eNextStep = startup_step.eStep.Cancel;
                        return false;
                    }
                }
                else
                {
                    LogFile.Error.Show(Err);
                    myStartup.eNextStep = startup_step.eStep.Cancel;
                    return false;
                }
            }
        }
Esempio n. 9
0
        internal bool SetShopsPricelists(startup myStartup, object oData, Navigation xnav, ref string Err)
        {
            if (m_usrc_InvoiceMan != null)
            {
                if (m_usrc_InvoiceMan.m_usrc_Invoice != null)
                {
                    if (m_usrc_InvoiceMan.m_usrc_Invoice.DBtcn != null)
                    {
                        m_usrc_InvoiceMan.m_usrc_Invoice.Set_eShopsMode(Properties.Settings.Default.eShopsInUse, xnav);
                        if (xnav.eExitResult== Navigation.eEvent.NEXT)
                        {
                            myStartup.eNextStep++;
                            return true;
                        }
                        else if (xnav.eExitResult == Navigation.eEvent.PREV)
                        {
                            myStartup.eNextStep--;
                            return true;
                        }
                        else if (xnav.eExitResult == Navigation.eEvent.EXIT)
                        {
                            myStartup.eNextStep = startup_step.eStep.Cancel;
                            return true;
                        }
                    }
                }
            }

            myStartup.eNextStep++;
            return true;
        }
Esempio n. 10
0
 internal bool Get_Printer(startup myStartup, object oData, Navigation xnav, ref string Err)
 {
     //Insert default templates for Proforma Invoice and for
     if (f_doc.InsertDefault())
     {
         myStartup.eNextStep++;
         return true;
     }
     else
     {
        myStartup.eNextStep = Startup.startup_step.eStep.Cancel;
         return false;
     }
 }
Esempio n. 11
0
        internal bool GetDBSettings_And_JOURNAL_DocInvoice_Type(startup myStartup, ref string Err)
        {
            bool bReadOnly = false;
            switch (fs.GetDBSettings(DBSync.DBSync.DB_for_Tangenta.Settings.AdminPassword.Name, ref Program.AdministratorLockedPassword, ref bReadOnly, ref Err))
            {
                case fs.enum_GetDBSettings.DBSettings_OK:
                    string MultiuserOperationWithLogin = null;
                    switch (fs.GetDBSettings(DBSync.DBSync.DB_for_Tangenta.Settings.AdminPassword.Name, ref MultiuserOperationWithLogin, ref bReadOnly, ref Err))
                    {
                        case fs.enum_GetDBSettings.DBSettings_OK:
                            Program.MultiuserOperationWithLogin = MultiuserOperationWithLogin.Equals("1");
                            string StockCheckAtStartup = null;
                            switch (fs.GetDBSettings(DBSync.DBSync.DB_for_Tangenta.Settings.AdminPassword.Name, ref StockCheckAtStartup, ref bReadOnly, ref Err))
                            {
                                case fs.enum_GetDBSettings.DBSettings_OK:
                                    Program.StockCheckAtStartup = StockCheckAtStartup.Equals("1");
                                    break;

                                case fs.enum_GetDBSettings.No_ReadOnly:
                                case fs.enum_GetDBSettings.No_TextValue:
                                case fs.enum_GetDBSettings.No_Data_Rows:
                                    if (!GetMissingDBSettings(DBSync.DBSync.DB_for_Tangenta.Settings.StockCheckAtStartup.Name))
                                    {
                                        myStartup.eNextStep = startup_step.eStep.Cancel;
                                        return false;
                                    }
                                    break;
                                case fs.enum_GetDBSettings.Error_Load_DBSettings:
                                    myStartup.eNextStep = startup_step.eStep.Cancel;
                                    return false;
                            }
                            break;

                        case fs.enum_GetDBSettings.No_ReadOnly:
                        case fs.enum_GetDBSettings.No_TextValue:
                        case fs.enum_GetDBSettings.No_Data_Rows:
                            if (!GetMissingDBSettings(DBSync.DBSync.DB_for_Tangenta.Settings.StockCheckAtStartup.Name))
                            {
                                myStartup.eNextStep = startup_step.eStep.Cancel;
                                return false;
                            }
                            break;
                        case fs.enum_GetDBSettings.Error_Load_DBSettings:
                            myStartup.eNextStep = startup_step.eStep.Cancel;
                            return false;
                    }
                    break;
                case fs.enum_GetDBSettings.No_ReadOnly:
                case fs.enum_GetDBSettings.No_TextValue:
                case fs.enum_GetDBSettings.No_Data_Rows:
                    if (!GetMissingDBSettings(DBSync.DBSync.DB_for_Tangenta.Settings.StockCheckAtStartup.Name))
                    {
                        myStartup.eNextStep = startup_step.eStep.Cancel;
                        return false;
                    }
                    break;
                case fs.enum_GetDBSettings.Error_Load_DBSettings:
                    myStartup.eNextStep = startup_step.eStep.Cancel;
                    return false;
            }
            myStartup.eNextStep++;
            return GlobalData.JOURNAL_type_definitions_Read();
        }
Esempio n. 12
0
        internal bool CheckDBVersion(startup myStartup, object oData,NavigationButtons.Navigation xnav, ref string Err)
        {
            bool bResult = false;
            switch (myStartup.eGetDBSettings_Result)
            {

                case fs.enum_GetDBSettings.DBSettings_OK:
                    bResult = CheckDataBaseVersion(myStartup, ref Err);
                    if (bResult)
                    {
                        if (Program.bFirstTimeInstallation)
                        {
                            bResult = InsertSampleData(myStartup, xnav, ref Err);
                            if (xnav.eExitResult == Navigation.eEvent.PREV)
                            {
                                goto do_Form_DBSettings;
                            }
                        }
                    }
                    return bResult;

                case fs.enum_GetDBSettings.No_Data_Rows:
                    //No CheckDataBaseVersion is needed because Database was allready created and its version has not been written to DBSettings table
             do_Form_DBSettings:

                    xnav.ChildDialog = new Form_DBSettings(xnav, Program.AdministratorLockedPassword, Program.MultiuserOperationWithLogin, Program.StockCheckAtStartup);
                    xnav.ShowDialog();
                    Program.AdministratorLockedPassword = ((Form_DBSettings)xnav.ChildDialog).AdministratorLockedPassword;
                    Program.MultiuserOperationWithLogin = ((Form_DBSettings)xnav.ChildDialog).MultiuserOperationWithLogin;
                    Program.StockCheckAtStartup = ((Form_DBSettings)xnav.ChildDialog).StockCheckAtStartup;
                    switch (xnav.eExitResult)
                    {
                        case Navigation.eEvent.NEXT:
                            bResult = InsertSampleData(myStartup, xnav, ref Err);
                            if (xnav.eExitResult == Navigation.eEvent.PREV)
                            {
                                if (xnav.LastStartupDialog_TYPE.Equals("Tangenta.Form_CheckInsertSampleData"))
                                {
                                    goto do_Form_DBSettings;
                                }
                            }
                            return bResult;

                        case Navigation.eEvent.PREV:
                            myStartup.eNextStep = startup_step.eStep.Check_DataBase;
                            return true;

                        case Navigation.eEvent.EXIT:
                            myStartup.eNextStep = startup_step.eStep.Cancel;
                            return false;
                    }

                    bResult = InsertSampleData(myStartup, xnav, ref Err);
                    return bResult;

                case fs.enum_GetDBSettings.Error_Load_DBSettings:
                    LogFile.Error.Show(Err);
                    myStartup.eNextStep = startup_step.eStep.Cancel;
                    return false;

                case fs.enum_GetDBSettings.No_TextValue:
                    myStartup.eNextStep = startup_step.eStep.Cancel;
                    return false;

                case fs.enum_GetDBSettings.No_ReadOnly:
                    Err = "ERROR enum_GetDBSettings return No_ReadOnly!";
                    LogFile.Error.Show(Err);
                    myStartup.eNextStep = startup_step.eStep.Cancel;
                    return false;

                default:
                    Err = "ERROR enum_GetDBSettings not handled!";
                    LogFile.Error.Show(Err);
                    myStartup.eNextStep = startup_step.eStep.Cancel;
                    return false;

            }

            myStartup.eNextStep = startup_step.eStep.Cancel;
            return false;
        }
Esempio n. 13
0
 internal bool CheckDataBaseVersion(startup myStartup, ref string Err)
 {
     if (myStartup.CurrentDataBaseVersionTextValue.Equals(DBSync.DBSync.DB_for_Tangenta.Settings.Version.TextValue))
     {
         return GetDBSettings_And_JOURNAL_DocInvoice_Type(myStartup, ref Err);
     }
     else
     {
         if (MessageBox.Show(this.Main_Form, lngRPM.s_Database_Version_is.s + myStartup.CurrentDataBaseVersionTextValue + lngRPM.s_ThisProgramWorksOnlyWithDatabase_Version.s + DBSync.DBSync.DB_for_Tangenta.Settings.Version.TextValue + "\r\n"+lngRPM.s_DoYouWantToUpgradeDBToLatestVersion.s, "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             myStartup.bUpgradeDone = m_UpgradeDB.UpgradeDB(myStartup.CurrentDataBaseVersionTextValue, DBSync.DBSync.DB_for_Tangenta.Settings.Version.TextValue, ref Err);
             return GetDBSettings_And_JOURNAL_DocInvoice_Type(myStartup, ref Err);
         }
         else
         {
             Err = lngRPM.s_Database_Version_is.s + myStartup.CurrentDataBaseVersionTextValue + "\r\n"+ lngRPM.s_ThisProgramWorksOnlyWithDatabase_Version.s + ":" + DBSync.DBSync.DB_for_Tangenta.Settings.Version.TextValue;
             myStartup.eNextStep = startup_step.eStep.Cancel;
             return false;
         }
     }
 }
Esempio n. 14
0
        public bool Get_ProgramSettings(startup myStartup,object oData, NavigationButtons.Navigation xnav,ref string Err)
        {
            if (fs.Get_JOURNAL_TYPE_ID())
            {
            do_Get_ProgramSettings:
                if (Get_ProgramSettings(xnav, true))
                {
                    switch (xnav.eExitResult)
                    {
                        case NavigationButtons.Navigation.eEvent.NEXT:
                            if (Get_FVI(xnav))
                            {
                                switch (xnav.eExitResult)
                                {
                                    case NavigationButtons.Navigation.eEvent.NEXT:
                                        myStartup.eNextStep++;
                                        return true;
                                    case NavigationButtons.Navigation.eEvent.PREV:
                                        goto do_Get_ProgramSettings;

                                    case NavigationButtons.Navigation.eEvent.EXIT:
                                        myStartup.eNextStep = Startup.startup_step.eStep.Cancel;
                                        return true;

                                }
                            }
                            break;

                        case NavigationButtons.Navigation.eEvent.PREV:
                            myStartup.eNextStep--;
                            return true;
                        case NavigationButtons.Navigation.eEvent.EXIT:
                            myStartup.eNextStep = Startup.startup_step.eStep.Cancel;
                            return true;
                    }
                }
                else
                {
                    myStartup.eNextStep = Startup.startup_step.eStep.Cancel;
                }
                return true;
            }
            return false;
        }