Example #1
0
        public FFilterCompany()
        {
            StateForm = StateForm.Editing;

            InitializeComponent();

            sMenuProcess1.Visibility = System.Windows.Visibility.Hidden;
            elementHost1.Visible     = false;

            gridFilterCompany.SMenuComponent.Visible   = false;
            gridFilterCompany.Label.Visible            = false;
            gridFilterCompany.SComponent.SelectionMode = DataGridViewSelectionMode.CellSelect;

            var ri = new RepositoryInjection();

            _conn = ri.GetClass <IFactoryConnection>();

            _filterCompanyApp = new FilterCompanyApp(_conn);
            _companyApp       = new CompanyApp(_conn);
            _dbTableApp       = new DbTableApp(_conn);

            InitializeStrutureColumns();
            UpdateDataSource();
        }
Example #2
0
 public CompanyApp(IFactoryConnection efc)
 {
     _epr        = new CompanyRepo(efc);
     _filter     = new FilterCompanyApp(efc);
     _dbTableApp = new DbTableApp(efc);
 }
Example #3
0
 public DbTableController(IFactoryConnection connection)
 {
     _connection = connection;
     _DbTableApp = new DbTableApp(connection);
 }
Example #4
0
        public FLogin(SplashScreen splash)
        {
            _splashScreen = splash;
            var ri   = new RepositoryInjection();
            var conn = ri.GetClass <IFactoryConnection>();

            _userApp               = new UserApp(conn);
            _companyApp            = new CompanyApp(conn);
            _translateApp          = new TranslateApp(conn);
            _tableApp              = new TableApp(conn);
            _dbTableApp            = new DbTableApp(conn);
            _automaticNumberingApp = new AutomaticNumberingApp(conn);

            _userController = new UserController(conn);

            GlobalUser.Forms               = _tableApp.Search().ToList();
            GlobalUser.Translates          = _translateApp.Search().ToList();
            GlobalUser.Tables              = _dbTableApp.Search().ToList();
            GlobalUser.AutomaticNumberings = _automaticNumberingApp.Search().ToList();

            InitializeComponent();

            Unidade.ObjetoApp     = new InvokeMethod(typeof(CompanyController), TypeExecute.SearchAll, "ListCompany", typeof(Company));
            Unidade.DisplayMember = "PersonName";
            Unidade.ValueMember   = "Id";
            Unidade.Enabled       = false;
            Unidade.Refresh();
            Unidade.SComponent.DropDown += SComponentOnDropDown;
            Unidade.Caption              = "Unidade";

            EntrarButton.SComponent.BackColor = Color.DarkSlateGray;
            EntrarButton.SComponent.ForeColor = Color.White;
            EntrarButton.SComponent.Text      = @"Entrar";
            EntrarButton.SComponent.Click    += EntrarButton_Click;
            EntrarButton.Enabled = false;

            SenhaTextBox.SComponent.PasswordChar = '*';
            SenhaTextBox.Caption = "Senha";
            SenhaTextBox.SComponent.TextChanged += SenhaComponentOnTextChanged;

            UsuarioTextBox.SComponent.TextChanged += UsuarioComponentOnTextChanged;
            UsuarioTextBox.Caption = "Login";

            var cont = false;

            if (_companyApp.Search().Any())
            {
                if (!_userApp.Search().Any())
                {
                    MessageBox.Show(@"Necessário cadastrar um usuário",
                                    @"BEM VINDO AO ESR SOFTWARES", MessageBoxButtons.OK);
                    var fuser = new FUser
                    {
                        StateForm       = StateForm.Inserting,
                        ClosedAfterSave = true
                    };
                    fuser.RefreshControls();
                    ((User)fuser.CurrentControl).IsAdministrator = true;
                    _splashScreen.Close();
                    fuser.ShowDialog();
                }
                return;
            }
            ;
            MessageBox.Show(@"Este é o seu primeiro acesso ao sistema, por favor, cadastre sua empresa.",
                            @"BEM VINDO AO ESR SOFTWARES", MessageBoxButtons.OK);

            do
            {
                var fcompany = new FCompany()
                {
                    StateForm       = StateForm.Inserting,
                    ClosedAfterSave = true
                };
                fcompany.RefreshControls();
                _splashScreen.Close();
                fcompany.ShowDialog();
                if (!_companyApp.Search().Any())
                {
                    cont = MessageBox.Show(@"Necessário cadastrar uma empresa, deseja continuar ?",
                                           @"BEM VINDO AO ESR SOFTWARES", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                           DialogResult.Yes;
                }
            } while (cont);

            if (!_companyApp.Search().Any())
            {
                Close();
            }
            else
            {
                if (_userApp.Search().Any())
                {
                    return;
                }
                MessageBox.Show(@"Necessário cadastrar um usuário",
                                @"BEM VINDO AO ESR SOFTWARES", MessageBoxButtons.OK);
                var fuser = new FUser
                {
                    ClosedAfterSave = true,
                    StateForm       = StateForm.Inserting,
                };
                ((User)fuser.CurrentControl).IsAdministrator = true;
                _splashScreen.Close();
                fuser.ShowDialog();
            }
        }
Example #5
0
 public ParkingInOutApp(IFactoryConnection efc)
 {
     _epr        = new ParkingInOutRepo(efc);
     _autNumApp  = new AutomaticNumberingApp(efc);
     _dbTableApp = new DbTableApp(efc);
 }