コード例 #1
0
ファイル: View.cs プロジェクト: gofixiao/Macsauto-Backup
        public View(ViewPresenter presenter, FormFactory formFactory)
        {
            _presenter = presenter;
            _formFactory = formFactory;

            InitializeComponent();

            _presenter.SetForm(this);
        }
コード例 #2
0
 private void cbAutoSave_CheckedChanged(object sender, EventArgs e)
 {
     if (!suppressChangeEvent)
     {
         if (cbAutoSave.Checked)
         {
             linkAutoSaveSettings.Enabled = true;
             var form = FormFactory.Create <FAutoSaveSettings>();
             form.ScanProfile = ScanProfile;
             form.ShowDialog();
             if (!form.Result)
             {
                 cbAutoSave.Checked = false;
             }
         }
     }
     linkAutoSaveSettings.Enabled = cbAutoSave.Checked;
 }
コード例 #3
0
        private void CerrarCaja(Entities.Caja caja)
        {
            if (caja == null)
            {
                caja = Uow.Cajas.Listado().Where(c => c.OperadorId == Context.OperadorActual.Id && c.FCierre == null).FirstOrDefault();
            }

            caja.FCierre                = _clock.Now;
            caja.FechaModificacion      = _clock.Now;
            caja.OperadorModificacionId = Context.OperadorActual.Id;
            Uow.Cajas.Modificar(caja);
            Uow.Commit();

            var frm = FormFactory.Create <FrmCajaResumida>();

            AbrirTab(frm);
            //frm.Show();
        }
コード例 #4
0
 private void btnAddProfile_Click(object sender, EventArgs e)
 {
     if (!(appConfigManager.Config.NoUserProfiles && profileManager.Profiles.Any(x => x.IsLocked)))
     {
         var fedit = FormFactory.Create <FEditProfile>();
         fedit.ScanProfile = appConfigManager.Config.DefaultProfileSettings ?? new ScanProfile {
             Version = ScanProfile.CURRENT_VERSION
         };
         fedit.ShowDialog();
         if (fedit.Result)
         {
             profileManager.Profiles.Add(fedit.ScanProfile);
             profileManager.Save();
             BatchSettings.ProfileDisplayName = fedit.ScanProfile.DisplayName;
             UpdateProfiles();
         }
     }
 }
コード例 #5
0
        private void RealizarPresupuesto()
        {
            _presupuesto.Id             = Guid.NewGuid();
            _presupuesto.Fecha          = _clock.Now;
            _presupuesto.Concepto       = "PRESUPUESTO DE LIBROS";
            _presupuesto.LCN            = TxtNroPresupuesto.Text;
            _presupuesto.ClienteId      = _cliente.Id;
            _presupuesto.Descuento      = UcTotalesPresupuesto.Descuento;
            _presupuesto.Total          = UcTotalesPresupuesto.TotalPagar;
            _presupuesto.FechaAlta      = _clock.Now;
            _presupuesto.SucursalAltaId = Context.SucursalActual.Id;
            _presupuesto.OperadorAltaId = Context.OperadorActual.Id;

            Uow.Presupuesto.Agregar(_presupuesto);

            //VENTA DETALLE
            foreach (var titulo in UcTitulosVenta.Titulos.OrderBy(t => t.TituloNombre))
            {
                PresupuestosDetalle presupuestoDetalle = new PresupuestosDetalle();

                presupuestoDetalle.Id             = Guid.NewGuid();
                presupuestoDetalle.PresupuestoId  = _presupuesto.Id;
                presupuestoDetalle.TituloId       = titulo.TituloId;
                presupuestoDetalle.Cantidad       = titulo.Cantidad;
                presupuestoDetalle.Precio         = titulo.SubTotal;
                presupuestoDetalle.FechaAlta      = _clock.Now;
                presupuestoDetalle.SucursalAltaId = Context.SucursalActual.Id;
                presupuestoDetalle.OperadorAltaId = (Context.OperadorActual.Id);

                Uow.PresupuestoDetalle.Agregar(presupuestoDetalle);
            }

            Uow.Commit();

            _messageBoxDisplayService.ShowSuccess("Presupuesto Generado.");

            using (var crearPresupuesto = FormFactory.Create <FrmComprobantePresupuesto>(_presupuesto.Id))
            {
                crearPresupuesto._descripcion = "";
                crearPresupuesto._formaPago   = "";
                crearPresupuesto._recargo     = "";
                crearPresupuesto.ShowDialog();
            }
        }
コード例 #6
0
        private void EditarTitulo(PresupuestoDetalleDto presupuestoTitulo)
        {
            using (var formAgregarTitulo = FormFactory.Create <FrmSeleccionarLibro>(presupuestoTitulo.Id))
            {
                formAgregarTitulo.TituloAgregado += (o, titulo) =>
                {
                    if (!this.Titulos.Any(t => t.TituloId == titulo.TituloId))
                    {
                        var tituloModificado = Titulos.FirstOrDefault(x => x.Id == titulo.TituloId);
                        if (titulo != null)
                        {
                            tituloModificado.Cantidad = titulo.Cantidad;
                            tituloModificado.Precio   = titulo.PrecioVenta;
                            tituloModificado.SubTotal = titulo.SubTotal;
                        }

                        OnPresupuestoTitulosChanged(Titulos);
                        RefrescarTitulos();
                    }
                    else
                    {
                        foreach (PresupuestoDetalleDto presupTitulo in Titulos)
                        {
                            if (presupTitulo.TituloId == titulo.TituloId)
                            {
                                presupTitulo.TituloId           = titulo.TituloId;
                                presupTitulo.TituloNombreTitulo = titulo.TituloNombre;
                                presupTitulo.Cantidad           = titulo.Cantidad;
                                presupTitulo.Precio             = titulo.PrecioVenta;
                                presupTitulo.SubTotal           = titulo.SubTotal;

                                OnPresupuestoTitulosChanged(Titulos);
                                RefrescarTitulos();
                            }
                        }
                    }

                    formAgregarTitulo.Close();
                };

                formAgregarTitulo.ShowDialog();
            }
        }
コード例 #7
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            if (Monto != UcTotalesSenia.TotalPagar)
            {
                _messageBoxDisplayService.ShowError("Los montos no coiniden");
                return;
            }

            int sucursal = 1;
            ClienteMontoFavor clienteMontoFavor = new ClienteMontoFavor();

            clienteMontoFavor.Id                = Guid.NewGuid();
            clienteMontoFavor.ClienteId         = _cliente.Id;
            clienteMontoFavor.FechaComprobante  = _clock.Now;
            clienteMontoFavor.TipoComprobanteId = TipoComprobanteEnum.SeñaCliente;
            clienteMontoFavor.LCN               = "R" + sucursal.ToString().PadLeft(4, '0') + CalcularLCN().PadLeft(8, '0');
            clienteMontoFavor.Concepto          = "Seña " + clienteMontoFavor.LCN;
            clienteMontoFavor.Importe           = UcTotalesSenia.TotalPagar;
            clienteMontoFavor.ImpOcupado        = 0;
            clienteMontoFavor.Observaciones     = TipoComprobanteEnum.SeñaCliente.ToString();
            clienteMontoFavor.FechaAlta         = _clock.Now;
            clienteMontoFavor.OperadorAltaId    = Context.OperadorActual.Id;
            clienteMontoFavor.SucursalAltaId    = 2;

            Uow.ClientesMontosFavor.Agregar(clienteMontoFavor);

            Uow.Commit();

            _messageBoxDisplayService.ShowSuccess("Seña generada con éxito");

            var crearSenia = FormFactory.Create <FrmComprobante>();

            crearSenia._concepto = "Seña de Cliente";
            crearSenia._LCN      = clienteMontoFavor.LCN;
            var conv = new Conversion();

            crearSenia._montoTexto = conv.enletras(UcTotalesSenia.TotalPagar.ToString());
            //crearSenia._montoTexto = "cien";
            //crearSenia.Show();

            BuscarHistorial();
            Limpiar();
        }
コード例 #8
0
        private void btnEditProfile_Click(object sender, EventArgs e)
        {
            if (comboProfile.SelectedItem == null)
            {
                return;
            }
            var fedit = FormFactory.Create <FEditProfile>();

            fedit.ScanProfile = (ScanProfile)comboProfile.SelectedItem;
            fedit.ShowDialog();
            if (!fedit.Result)
            {
                return;
            }
            profileManager.Profiles[comboProfile.SelectedIndex] = fedit.ScanProfile;
            profileManager.Save();
            BatchSettings.ProfileDisplayName = fedit.ScanProfile.DisplayName;
            UpdateProfiles();
        }
コード例 #9
0
        private void CrearCliente()
        {
            using (var formCrearCliente = FormFactory.Create <FrmCrearEditarCliente>(default(Guid), ActionFormMode.Create))
            {
                int i = 0;
                if (int.TryParse(UcBuscadorConsignacion.Cuit, out i))
                {
                    formCrearCliente.SetearDni(UcBuscadorConsignacion.Cuit);
                }

                formCrearCliente.ClienteAgregado += (sender, cliente) =>
                {
                    ActualizarCliente(cliente);
                    formCrearCliente.Close();
                };

                formCrearCliente.ShowDialog();
            }
        }
コード例 #10
0
        private void btnDownload_Click(object sender, EventArgs e)
        {
            var progressForm = FormFactory.Create <FDownloadProgress>();

            if (!engineToInstall.IsInstalled)
            {
                progressForm.QueueFile(engineToInstall.Component);
            }

            var selectedLanguages = SelectedLanguages;

            foreach (var langComponent in engineToInstall.LanguageComponents.Where(x => selectedLanguages.Contains(x.Id)))
            {
                progressForm.QueueFile(langComponent);
            }

            Close();
            progressForm.ShowDialog();
        }
コード例 #11
0
ファイル: FrmLibrosListado.cs プロジェクト: windygu/Libreria
        private void rmiClientesConsignacion_Click(object sender, EventArgs e)
        {
            if (tituloSeleccionadoContextMenu != null)
            {
                using (var form = FormFactory.Create <FrmClientesListadoResumido>())
                {
                    //var clientes = _tituloNegocio.ClientesConsignacion(tituloSeleccionadoContextMenu.Id,
                    //    this.Context.SucursalActual.Id);

                    var remitos = _tituloNegocio.RemitosConsignacion(tituloSeleccionadoContextMenu.Id,
                                                                     this.Context.SucursalActual.Id);

                    //form.ActualizarClientes(clientes);
                    form.ActualizarRemitosVenta(remitos);
                    form.ShowDialog();
                }

                tituloSeleccionadoContextMenu = null;
            }
        }
コード例 #12
0
ファイル: FDesktop.cs プロジェクト: gas3/twain
        private async Task ScanWithNewProfile()
        {
            var editSettingsForm = FormFactory.Create <FEditProfile>();

            editSettingsForm.ScanProfile = appConfigManager.Config.DefaultProfileSettings ?? new ScanProfile {
                Version = ScanProfile.CURRENT_VERSION
            };
            editSettingsForm.ShowDialog();
            if (!editSettingsForm.Result)
            {
                return;
            }
            profileManager.Profiles.Add(editSettingsForm.ScanProfile);
            profileManager.DefaultProfile = editSettingsForm.ScanProfile;
            profileManager.Save();

            await scanPerformer.PerformScan(editSettingsForm.ScanProfile, new ScanParams(), this, notify, ReceiveScannedImage());

            Activate();
        }
コード例 #13
0
        private void ScanWithNewProfile()
        {
            var editSettingsForm = FormFactory.Create <FEditScanSettings>();

            editSettingsForm.ScanSettings = new ExtendedScanSettings {
                Version = ExtendedScanSettings.CURRENT_VERSION
            };
            editSettingsForm.ShowDialog();
            if (!editSettingsForm.Result)
            {
                return;
            }
            profileManager.Profiles.Add(editSettingsForm.ScanSettings);
            profileManager.DefaultProfile = editSettingsForm.ScanSettings;
            profileManager.Save();

            UpdateScanButton();

            scanPerformer.PerformScan(editSettingsForm.ScanSettings, this, this);
        }
コード例 #14
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var fedit = FormFactory.Create <FEditProfile>();

            fedit.ScanProfile = appConfigManager.Config.DefaultProfileSettings ?? new ScanProfile {
                Version = ScanProfile.CURRENT_VERSION
            };
            fedit.ShowDialog();
            if (fedit.Result)
            {
                profileManager.Profiles.Add(fedit.ScanProfile);
                if (profileManager.Profiles.Count == 1)
                {
                    profileManager.DefaultProfile = fedit.ScanProfile;
                }
                UpdateProfiles();
                SelectProfile(x => x == fedit.ScanProfile);
                profileManager.Save();
            }
        }
コード例 #15
0
    static void Main()
    {
        var builder = new ContainerBuilder();

        builder.RegisterType <FormInterceptor>();
        Castle.DynamicProxy.Generators.AttributesToAvoidReplicating.Add <System.Security.Permissions.UIPermissionAttribute>();
        // Register your forms
        builder.RegisterType <frmMain>()
        .Named <Form>("frmMain")
        .EnableClassInterceptors()
        .InterceptedBy(typeof(FormInterceptor));
        builder.RegisterType <frmSubForm>()
        .Named <Form>("frmSubForm")
        .EnableClassInterceptors()
        .InterceptedBy(typeof(FormInterceptor));
        FormFactory = new FormFactory(builder.Build());
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(FormFactory.CreateForm("frmMain").Value);
    }
コード例 #16
0
 private Operador RequerirAdministrador()
 {
     using (var login = FormFactory.Create <FrmLogin>())
     {
         login.RolesAceptados = new List <string>()
         {
             RolesNames.Admin, RolesNames.SuperAdmin
         };
         login.CambiarIdentity = false;
         if (login.ShowDialog() == DialogResult.OK)
         {
             return(login.UltimoOperadorIngresado);
         }
         else
         {
             //Cancelado.
             return(null);
         }
     }
 }
コード例 #17
0
        private static void createTestPreKDocument()
        {
            TimeZoneInfo timezone = TimeZoneInfo.FindSystemTimeZoneById("Canada Central Standard Time");

            using (FormFactory formFactory = new FormFactory())
            {
                string filename = formFactory.GenerateForm(new SubmittedPreKApplicationForm(Examples.PreK), timezone);

                if (!string.IsNullOrEmpty(filename))
                {
                    Console.WriteLine("Form created: " + filename);
                }
                else
                {
                    Console.WriteLine("Something went wrong, and the form could not be created.");
                }
                Console.WriteLine("Press any key to continue (will delete all forms created)...");
                Console.ReadKey();
            }
        }
コード例 #18
0
        public HomePresenter(IStateManager manager) : base(manager)
        {
            Form = (IHomeView) FormFactory.CreateForm("MainForm", new object[] {this});
            //onClosingEvent to stop the application
            ((Form) Form).FormClosing += (sender, args) => ApplicationState.IsRunning = false;
            ProductSection = new ProductSection(Form.ProductDataTable, this, Form);
            SettingsSection = new SettingsSection(this);

            StateManager.EventManager.AddEvent(new Event(
                Config.EventListenerImmediate,
                CheckIsLoginHandler,
                GetStateManager().EventManager,
                true));

            IsProductsDisplayed = false;
            Form.TabLabelText = Tab1LabelText;
            Form.SetSearchParams(ProductSection.GetSearchParameters());


            if (!StateManager.UserSession.IsActive) //prevent any actions till login
                return;
        }
コード例 #19
0
ファイル: FormMain.cs プロジェクト: cuplexProjects/C-Projects
        private void renameTabToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_tabPageClickIndex < 0 || _tabPageClickIndex > tabControlNotepad.TabCount)
            {
                Log.Warning("Rename tab page could not find selected index: {_tabPageClickIndex}", _tabPageClickIndex);
                return;
            }
            var tabPage = tabControlNotepad.TabPages[_tabPageClickIndex];

            var renameTabControl = new RenameTabPageControl {
                TabPageName = tabPage.Text
            };
            var renameTabForm = FormFactory.CreateFormFromUserControl(renameTabControl);

            if (renameTabForm.ShowDialog(this) == DialogResult.OK)
            {
                string tabPageName = renameTabControl.TabPageName;
                _tabPageDataCollection.TabPageDictionary[_tabPageClickIndex].TabPageLabel = tabPageName;
                tabPage.Text = tabPageName;
                _applicationState.TabTextDataChanged = true;
            }
        }
コード例 #20
0
        private void GuardarDevolucion()
        {
            //Recorro y controlo que ninguna cantidad sea mayor a la disponible
            foreach (var devolucionesTitulos in ucTitulosDevolucion.TitulosDevolucion)
            {
                int?_cantidadTotal = devolucionesTitulos.Cantidad;

                if (devolucionesTitulos.CantidadConsignada < _cantidadTotal)
                {
                    _messageBoxDisplayService.ShowError("La cantidad devuleta es mayor a la cantidad disponible del libro: " + devolucionesTitulos.TituloNombre);
                    return;
                }
            }

            //Genero TitulosConsignacionesDevueltas
            Guid titulosConsignacionDevuelta = TitulosConsignacionesDevueltas(_proveedor.Id);

            foreach (var devolucionTitulo in ucTitulosDevolucion.TitulosDevolucion)
            {
                int?_cantidadTotal = devolucionTitulo.Cantidad;

                if (devolucionTitulo.CantidadConsignada >= _cantidadTotal)
                {
                    DescontarLibrosConsignados(_cantidadTotal, devolucionTitulo.TituloId);
                    ModificarTitulosConsignacion(devolucionTitulo.TituloId, _proveedor.Id, _cantidadTotal);
                    TitulosConsignacionesDevueltaDetalle(devolucionTitulo, _cantidadTotal, titulosConsignacionDevuelta);
                }
            }

            Uow.Commit();
            _messageBoxDisplayService.ShowSuccess("Devolución guardada correctamente");

            using (var crearComprobante = FormFactory.Create <FrmComprobanteDevolucion>(titulosConsignacionDevuelta))
            {
                crearComprobante.ShowDialog();
            }

            onDevolucionRealizada();
        }
コード例 #21
0
        private void EditarTituloDevolucion(VentaTitulo compraTituloDevolucion)
        {
            using (var formAgregarTitulo = FormFactory.Create <FrmSeleccionarLibro>(compraTituloDevolucion.TituloId, ActionFormMode.Edit))
            {
                formAgregarTitulo.Cantidad        = compraTituloDevolucion.Cantidad;
                formAgregarTitulo.TituloAgregado += (o, titulo) =>
                {
                    if (!this.TitulosDevolucion.Any(t => t.TituloId == titulo.TituloId))
                    {
                        TitulosDevolucion.Add(titulo);
                        OnDevolucionTitulosChanged(TitulosDevolucion);
                        OnCompraTitulosChanged(Titulos);
                        RefrescarTitulos();
                    }
                    else
                    {
                        foreach (VentaTitulo devolucionTitulo in TitulosDevolucion)
                        {
                            if (devolucionTitulo.TituloId == titulo.TituloId)
                            {
                                devolucionTitulo.TituloId     = titulo.TituloId;
                                devolucionTitulo.TituloNombre = titulo.TituloNombre;
                                devolucionTitulo.Cantidad     = titulo.Cantidad;
                                devolucionTitulo.PrecioBase   = titulo.PrecioBase;
                                devolucionTitulo.PrecioVenta  = titulo.PrecioVenta;
                                devolucionTitulo.SubTotal     = titulo.SubTotal;
                                OnDevolucionTitulosChanged(TitulosDevolucion);
                                OnCompraTitulosChanged(Titulos);
                                RefrescarTitulos();
                            }
                        }
                    }

                    formAgregarTitulo.Close();
                };

                formAgregarTitulo.ShowDialog();
            }
        }
コード例 #22
0
ファイル: UcTitulosVenta.cs プロジェクト: windygu/Libreria
        private void btnAgregarPresupuesto_Click(object sender, EventArgs e)
        {
            using (var formAgregarTitulo = FormFactory.Create <FrmSeleccionarLibroPresupuesto>(Guid.Empty))
            {
                formAgregarTitulo.TituloAgregado += (o, titulo) =>
                {
                    if (!this.Titulos.Any(t => t.TituloId == titulo.TituloId))
                    {
                        Titulos.Add(titulo);
                        OnVentaTitulosChanged(Titulos);
                        RefrescarTitulos();
                    }
                    else
                    {
                        _messageBoxDisplayService.ShowInfo("Ya agregó el libro " + titulo.TituloNombre.ToString());
                    }
                    formAgregarTitulo.Close();
                };

                formAgregarTitulo.ShowDialog();
            }
        }
コード例 #23
0
 private void cmbPage_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbPage.SelectedIndex == cmbPage.Items.Count - 1)
     {
         // "Custom..." selected
         var form = FormFactory.Create <FPageSize>();
         form.PageSizeDimens = lastPageSizeItem.Type == ScanPageSize.Custom
             ? lastPageSizeItem.CustomDimens
             : lastPageSizeItem.Type.PageDimensions();
         if (form.ShowDialog() == DialogResult.OK)
         {
             UpdatePageSizeList();
             SelectCustomPageSize(form.PageSizeName, form.PageSizeDimens);
         }
         else
         {
             cmbPage.SelectedIndex = lastPageSizeIndex;
         }
     }
     lastPageSizeIndex = cmbPage.SelectedIndex;
     lastPageSizeItem  = (PageSizeListItem)cmbPage.SelectedItem;
 }
コード例 #24
0
        private async void PerformScan()
        {
            if (profileManager.Profiles.Count == 0)
            {
                var editSettingsForm = FormFactory.Create <FEditProfile>();
                editSettingsForm.ScanProfile = new ScanProfile
                {
                    Version = ScanProfile.CURRENT_VERSION
                };
                editSettingsForm.ShowDialog();
                if (!editSettingsForm.Result)
                {
                    return;
                }
                profileManager.Profiles.Add(editSettingsForm.ScanProfile);
                profileManager.DefaultProfile = editSettingsForm.ScanProfile;
                profileManager.Save();
                UpdateProfiles();
                lvProfiles.SelectedIndices.Add(0);
            }
            if (SelectedProfile == null)
            {
                MessageBox.Show(MiscResources.SelectProfileBeforeScan, MiscResources.ChooseProfile, MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }
            if (profileManager.DefaultProfile == null)
            {
                var profile = SelectedProfile;
                profileManager.DefaultProfile = profile;
                UpdateProfiles();
                SelectProfile(x => x == profile);
            }
            profileManager.Save();
            await scanPerformer.PerformScan(SelectedProfile, new ScanParams(), this, null, ImageCallback);

            Activate();
        }
コード例 #25
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (lvProfiles.SelectedItems.Count > 0)
     {
         int profileIndex = lvProfiles.SelectedItems[0].Index;
         var fedit        = FormFactory.Create <FEditScanSettings>();
         fedit.ScanSettings = profileManager.Profiles[profileIndex];
         fedit.ShowDialog();
         if (fedit.Result)
         {
             profileManager.Profiles[profileIndex] = fedit.ScanSettings;
             profileManager.Save();
             UpdateProfiles();
             SelectProfile(x => x == fedit.ScanSettings);
             lvProfiles.SelectedIndices.Add(profileIndex);
         }
         else
         {
             // Rollback
             profileManager.Load();
         }
     }
 }
コード例 #26
0
        public ViewControl(string viewName, int maxHeight)
        {
            InitializeComponent();
            this.gridView.Name = this.viewName = viewName;
            this.Edit.Text     = "...";
            this.Edit.Width    = 30;
            this.Edit.UseColumnTextForButtonValue = true;
            view    = Program.Context.ViewToGridManager.bindToView(gridView);
            addForm = FormFactory.createAddForm(viewName, this);
            addForm.StartPosition    = FormStartPosition.CenterParent;
            updateForm               = FormFactory.createUpdateForm(viewName, this);
            updateForm.StartPosition = FormStartPosition.CenterParent;
            this.gridView.Height     = maxHeight - 50;
            if (view.Insertable == false)
            {
                this.Add.Visible = false;
            }
            if (view.Updateable == false)
            {
                this.Edit.Visible = false;
            }
//            this.
        }
コード例 #27
0
        private void BtnAceptar_Click(object sender, EventArgs e)
        {
            using (var formAgregarMovilPago = FormFactory.Create <FrmSelectorMovil>(Guid.Empty, ActionFormMode.Create))
            {
                formAgregarMovilPago.PagoBaseAgregado += (o, pagoBase) =>
                {
                    if (!this.PagosBases.Any(t => t.MovilId == pagoBase.MovilId))
                    {
                        PagosBases.Add(pagoBase);
                        OnPagoBaseChanged(PagosBases);
                        RefrescarPagosBase();
                    }
                    else
                    {
                        //_messageBoxDisplayService.ShowInfo("Ya agregó el libro " + titulo.TituloNombre.ToString());
                    }

                    formAgregarMovilPago.Close();
                };

                formAgregarMovilPago.ShowDialog();
            }
        }
コード例 #28
0
ファイル: FrmDBDatabase.cs プロジェクト: BillyWu/Granitypark
        private void btnOk_Click(object sender, EventArgs e)
        {
            FormFactory dbhelp = new FormFactory();

            bool f*g = dbhelp.WriteConfig(txtserver.Text, txtdatebase.Text, txtuserid.Text, txtpassword.Text, "Granity.granityMgr", this.txtXT.Text, this.txtServerIP.Text);

            if (!f*g)
            {
                MessageBox.Show("输入连接字符串错误,请重新输入!", "系统提示!");
                return;
            }
            if (!dbhelp.ConnectionResult("value", "Granity.granityMgr", "select * from 用户信息表"))
            {
                MessageBox.Show("输入连接字符串错误,请重新输入!", "系统提示!");
                this.txtserver.Text   = "";
                this.txtdatebase.Text = "";
                this.txtuserid.Text   = "";
                this.txtpassword.Text = "";
                return;
            }
            success = true;
            this.Close();
        }
コード例 #29
0
        private void BtnAgregar_Click(object sender, EventArgs e)
        {
            using (var formAgregarPago = FormFactory.Create <FrmAgregarPago>())
            {
                formAgregarPago.Importe       = ImporteDebe;
                formAgregarPago.PagoAgregado += (o, pago) =>
                {
                    _pagos.Add(pago);
                    ActualizarPagoEfectivoFijo();
                    if (Importe < TotalPagos() || PagoFijoEfectivo < 0)
                    {
                        _pagos.Remove(pago);
                        _IMessageBoxDisplayService.ShowError("La suma de los pagos no debe superar el importe total de la orden de pago.");
                    }

                    RefrescarPagos();

                    formAgregarPago.Close();
                };

                formAgregarPago.ShowDialog();
            }
        }
コード例 #30
0
ファイル: MainView.cs プロジェクト: SwatInc/CD4
        public void OpenMdiForm <T>(string parameter = null) where T : Form
        {
            var form = FormFactory.Create <T>();

            //subscribe for required form events
            if (typeof(T) == typeof(ResultEntryView))
            {
                //cast form as ResultEntryView
                var resultView = (ResultEntryView)Convert.ChangeType(form, typeof(ResultEntryView));
                //subscribe for events
                //GenerateReportByCin event
                resultView.GenerateReportByCin += ResultView_OnGenerateReportByCin;
            }

            //Check whether the form is authentication form
            if (typeof(T) == typeof(AuthenticationView))
            {
                //cast T as authenticationView
                var authView = (AuthenticationView)Convert.ChangeType(form, typeof(AuthenticationView));
                //subscribe for the required event
                authView.UserAuthorized += AuthView_UserAuthorized;
            }
            //if parameter is not null, assign it to form tag
            if (!string.IsNullOrEmpty(parameter))
            {
                form.Tag = parameter;
            }
            form.MdiParent = this;
            //check for authorization
            if (!_authEvaluator.EvaluateAuthForItem <Form>(form))
            {
                XtraMessageBox.Show($"You are not authorised to for {form.Tag}. Please contact your administrator if you require authorisation.");
                return;
            }
            form.Show();
            form.FormClosed += Form_FormClosed;
        }
コード例 #31
0
        private void EditarTitulo(CompraTitulo compraTitulo)
        {
            using (var formAgregarTitulo = FormFactory.Create <FrmSeleccionarLibroCompra>(compraTitulo.TituloId, ActionFormMode.Edit))
            {
                formAgregarTitulo.Cantidad        = compraTitulo.CantidadCompra;
                formAgregarTitulo.TituloAgregado += (o, titulo) =>
                {
                    if (!this.Titulos.Any(t => t.TituloId == titulo.TituloId))
                    {
                        Titulos.Add(titulo);
                        OnCompraTitulosChanged(Titulos);
                        RefrescarTitulos();
                    }
                    else
                    {
                        foreach (CompraTitulo compraTitulo1 in Titulos)
                        {
                            if (compraTitulo1.TituloId == titulo.TituloId)
                            {
                                compraTitulo1.TituloId       = titulo.TituloId;
                                compraTitulo1.TituloNombre   = titulo.TituloNombre;
                                compraTitulo1.CantidadCompra = titulo.CantidadCompra;
                                compraTitulo1.PrecioBase     = titulo.PrecioBase;
                                compraTitulo1.PrecioVenta    = titulo.PrecioVenta;
                                compraTitulo1.SubTotal       = titulo.SubTotal;
                                OnCompraTitulosChanged(Titulos);
                                RefrescarTitulos();
                            }
                        }
                    }

                    formAgregarTitulo.Close();
                };

                formAgregarTitulo.ShowDialog();
            }
        }
コード例 #32
0
ファイル: Reader.cs プロジェクト: foogoof/nihilisp
                public static IFlatCollection FlatCollectionFormReader(TextReader stream, Reader reader, char open, char close, FormFactory factory)
                {
                    char cur;
                    if (!(PeekChar(stream, out cur) && cur == open)) {
                        return null;
                    }

                    IFlatCollection coll = factory();
                    SkipChar(stream);

                    do {
                        SkipWhitespace(stream);
                        object form = reader.ReadNextForm(stream);
                        if (form != null) {
                            coll.Append(form);
                        }
                        SkipWhitespace(stream);
                        if (Empty(stream)) {
                            throw new ReaderException("Unterminated vector!");
                        }

                    } while (PeekChar(stream, out cur) && cur != close);

                    SkipChar(stream);

                    return coll;
                }