Exemplo n.º 1
0
        private void newToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            var add = _formFactory.CreateForm <QuickAdd>();

            add.FormTransactionSuccess += AddOnFormTransactionSuccess;

            add.ShowDialog();
        }
Exemplo n.º 2
0
        private void btnNew_Click(object sender, System.EventArgs e)
        {
            var add = _formFactory.CreateForm <Create>();

            //add.FormTransactionSuccess += add_FormTransactionSuccess;

            add.ShowDialog();
        }
Exemplo n.º 3
0
        private static Form Create(Type formType)
        {
            if (_factory == null)
            {
                throw new InvalidOperationException(@"Form factory has not been set up. Call the 'Use' method to inject an IFormFactory instance.");
            }

            return(_factory.CreateForm(formType));
        }
Exemplo n.º 4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            var isAuthorized = _authService.Authorize(txbUserName.Text);

            if (isAuthorized)
            {
                var mainForm = _formFactory.CreateForm(typeof(MainForm));
                mainForm.Show();
                mainForm.Closed += (s, args) => this.Close();
                this.Hide();
            }
        }
Exemplo n.º 5
0
        private void lblInventoryCodeValue_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var selectedMerchandise = _merchandises.FirstOrDefault(x => x.Inventory.Code == lblInventoryCodeValue.Text);

            if (selectedMerchandise != null)
            {
                var viewInventory = _formFactory.CreateForm <ConfigurationModule.Inventory.ViewDetail>();

                viewInventory.SelectedInventory = selectedMerchandise.Inventory;

                viewInventory.ShowDialog(this);
            }
            else
            {
                MessageBox.Show(@"No merchandise selected", @"Error");
            }
        }
Exemplo n.º 6
0
        private void lblServiceCategoryValue_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var selectedService = _services.FirstOrDefault(x => x.Code == lblServiceCategoryValue.Text);

            if (selectedService != null)
            {
                var viewCategory = _formFactory.CreateForm <ViewDetail>();

                viewCategory.ServiceCategory = selectedService.Category;

                viewCategory.ShowDialog(this);
            }
            else
            {
                MessageBox.Show(@"No service selected", @"Error");
            }
        }
Exemplo n.º 7
0
        private void btnBook_Click(object sender, EventArgs e)
        {
            if (dgvServices.Rows.Count == 0)
            {
                MessageBox.Show(@"No service selected");
            }
            else
            {
                var paymentForm = _formFactory.CreateForm <PointOfSalesModule.Payment.Create>();

                paymentForm.FinalizingPayment += paymentForm_FinalizingPayment;
                //paymentForm.FormTransactionSuccess += paymentForm_FormTransactionSuccess;

                paymentForm.Charged = dgvServices.Rows.Cast <DataGridViewRow>().Sum(row => long.Parse(row.Cells[@"dgvColServicePrice"].Value.ToString()));

                paymentForm.ShowDialog();
            }
        }
Exemplo n.º 8
0
        public Create(CreatePresenter presenter, IFormFactory formFactory)
        {
            _presenter   = presenter;
            _formFactory = formFactory;

            InitializeComponent();

            var customerSelection = _formFactory.CreateForm <CustomerSelection.View>();

            customerSelection.VehicleSelection += (sender, args) =>
            {
                VehicleRegistration = args.Entity;
            };

            customerSelection.ShowDialog();

            if (_vehicleRegistration == null)
            {
                Dispose();
            }

            _presenter.SetForm(this);
        }
Exemplo n.º 9
0
        public Create(CreatePresenter presenter, IFormFactory formFactory)
        {
            _presenter = presenter;
            _formFactory = formFactory;

            InitializeComponent();

            var customerSelection = _formFactory.CreateForm<CustomerSelection.View>();

            customerSelection.VehicleSelection += (sender, args) =>
            {
                VehicleRegistration = args.Entity;
            };

            customerSelection.ShowDialog();

            if (_vehicleRegistration == null)
            {
                Dispose();
            }

            _presenter.SetForm(this);
        }
Exemplo n.º 10
0
        private void btnNewPlant_Click_1(object sender, EventArgs e)
        {
            var mainForm = _formFactory.CreateForm(typeof(AddPlantForm));

            mainForm.Show();
        }
Exemplo n.º 11
0
        private void btnCustomers_Click(object sender, System.EventArgs e)
        {
            var form = _formFactory.CreateForm <PointOfSalesModule.Customer.View>();

            form.ShowDialog();
        }