示例#1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            api = new AdminPaqImp();
            Enterprise dbEnterprise = new Enterprise();

            foreach (Empresa enterprise in api.Empresas)
            {
                try
                {
                    if (ValidateDBConfig())
                    {
                        dbEnterprise.SaveEnterprise(enterprise);
                        DtCustomer = CustomerInterface.ReadCustomers();
                        DtSeries   = AccountInterface.ReadSeries();
                        DtFolios   = AccountInterface.ReadFolios();
                    }
                    else
                    {
                        OpenConfig();
                        return;
                    }
                }
                catch (Exception ex)
                {
                    ErrLogger.Log(ex.Message);
                }
            }
        }
示例#2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            api = new AdminPaqImp();
            Enterprise dbEnterprise = new Enterprise();

            foreach (Empresa enterprise in api.Empresas)
            {
                try
                {
                    if (ValidateDBConfig())
                    {
                        dbEnterprise.SaveEnterprise(enterprise);
                        DtCustomer = CustomerInterface.ReadCustomers();
                        DtSeries   = AccountInterface.ReadSeries();
                        DtFolios   = AccountInterface.ReadFolios();

                        Settings set = Settings.Default;
                        if (set.empresa == 1)
                        {
                            MessageBox.Show("Por favor seleccione la empresa en la cual desea trabajar.");
                            OpenConfig();
                            return;
                        }
                    }
                    else
                    {
                        OpenConfig();
                        return;
                    }
                }
                catch (Exception ex)
                {
                    ErrLogger.Log(ex.Message);
                }
            }
        }