示例#1
0
        private void UpdateReport()
        {
            var ri    = new RepositoryInjection();
            var _conn = ri.GetClass <IFactoryConnection>();
            var pioc  = new ParkingInOutController(_conn);

            if (CurrentControl != null)
            {
                var r = pioc.ListForReport(CurrentControl.Id);
                foreach (var item in r)
                {
                    item.Convenio         = ParkingAgreementId.SComponent.Text;
                    item.Desconto         = (decimal)DiscountValuePorcent.ValueControl == decimal.Zero ? (decimal)DiscountValueReal.ValueControl : (decimal)DiscountValuePorcent.ValueControl;
                    item.FormaPagamento   = FormOfPaymentId.SComponent.Text;
                    item.Troco            = (decimal)ChangeOfMoney.ValueControl;
                    item.ValorPago        = (decimal)AmountPaid.ValueControl;
                    item.ValorTotal       = (decimal)TotalValue.ValueControl;
                    item.ValorTotalaPagar = (decimal)TotalPayable.ValueControl;
                    item.DataFinal        = DateTime.Now;
                }

                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSetTicket", r));
                reportViewer1.RefreshReport();
            }
        }
示例#2
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();
        }
示例#3
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();
            }
        }