Ejemplo n.º 1
0
        protected override void SetEstadoItem()
        {
            if (LineaRegistros_DGW.CurrentRow == null)
            {
                return;
            }

            LineaRegistro item = (LineaRegistro)LineaRegistros_DGW.CurrentRow.DataBoundItem;

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <EEstado> .GetList(GetEstados()));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;

                if (estado.Oid == ((long)EEstado.Anulado))
                {
                    NullItem(LineaRegistros_DGW.CurrentRow);
                }
                else
                {
                    ChangeState(LineaRegistros_DGW.CurrentRow, (EEstado)estado.Oid);
                }

                LineaRegistros_DGW.CurrentCell.Value = estado.Texto;

                SetGridFormat();
            }
        }
Ejemplo n.º 2
0
        protected void SetTipo()
        {
            CashLine item = Lines_DGW.CurrentRow.DataBoundItem as CashLine;

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            if (_linea_libre)
            {
                ETipoLineaCaja[] list = { ETipoLineaCaja.SalidaPorIngreso, ETipoLineaCaja.EntradaPorTraspaso, ETipoLineaCaja.EntradaPorTarjetaCredito, ETipoLineaCaja.Otros };
                form.SetDataSource(Library.Invoice.EnumText <ETipoLineaCaja> .GetList(list));
            }
            else
            {
                ETipoLineaCaja[] list = { ETipoLineaCaja.SalidaPorIngreso, ETipoLineaCaja.EntradaPorTraspaso, ETipoLineaCaja.EntradaPorTarjetaCredito };
                form.SetDataSource(Library.Invoice.EnumText <ETipoLineaCaja> .GetList(list));
            }

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource tipo = form.Selected as ComboBoxSource;
                item.ETipoLinea = (ETipoLineaCaja)tipo.Oid;

                SetRowFormat(Lines_DGW.CurrentRow);

                Lines_BS.ResetBindings(false);
            }
        }
Ejemplo n.º 3
0
        private void Tipo_BT_Click(object sender, EventArgs e)
        {
            if (!_entity.CanChangeType())
            {
                return;
            }

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(moleQule.Store.Structs.EnumText <ETipoLineaLibroGanadero> .GetList(GetTypes()));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;
                _entity.Tipo = estado.Oid;
                Tipo_TB.Text = _entity.TipoLabel;

                switch (_entity.ETipo)
                {
                case ETipoLineaLibroGanadero.Nacimiento:
                    ChangeStateAction(moleQule.Base.EEstado.Alta);
                    break;

                case ETipoLineaLibroGanadero.Muerte:
                    ChangeStateAction(moleQule.Base.EEstado.Baja);
                    break;
                }
            }

            Status_BT.Enabled = _entity.ETipo == ETipoLineaLibroGanadero.TraspasoExplotacion;
        }
        protected override void SelectEstadoExpedienteREAAction()
        {
            if (ExpedienteREA_DGW.CurrentRow == null)
            {
                return;
            }

            REAExpedient item = (REAExpedient)ExpedienteREA_DGW.CurrentRow.DataBoundItem;

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            moleQule.Base.EEstado[] list = { moleQule.Base.EEstado.Anulado, moleQule.Base.EEstado.Abierto, moleQule.Base.EEstado.Solicitado, moleQule.Base.EEstado.Aceptado, moleQule.Base.EEstado.Desestimado, moleQule.Base.EEstado.Charged };
            form.SetDataSource(moleQule.Base.EnumText <moleQule.Base.EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;

                ChangeEstadoExpedienteREA(ExpedienteREA_DGW.CurrentRow, (moleQule.Base.EEstado)estado.Oid);

                ExpedienteREA_DGW.CurrentCell.Value = estado.Texto;

                SetExpedienteREAFormat();
            }
        }
Ejemplo n.º 5
0
        public EditPolicyDocument()
        {
            InitializeComponent();
            //Loads user from database into combobox, where DisplayMemberPath and SelectedValuePath = "Name".
            ComboBoxSource.SetupItemsInComboBoxDisplay(userComboboxField.ItemsSource       = DisplayComboboxList.SetUpNameInComboBox(),
                                                       userComboboxField.DisplayMemberPath = "Name", userComboboxField.SelectedValuePath = "Name");

            //Policy data label and saved policy number to edit.
            policyDataLabel.Content = CatchPolicyData.savedPolicyNumber;
            //Date picker and saved date to edit.
            dateToEdit.Content = CatchPolicyData.savedFullDate;
            //User name label and saved user name to edit.
            userDataLabel.Content = CatchPolicyData.savedUserName;
            //Broker name label and saved broker name to edit.
            brokerNameLabel.Content = CatchPolicyData.savedBrokerName;

            //Fill data picker by date saved in database.
            editDate.SelectedDate = CatchPolicyData.savedFullDate;
            //Fill User name combobox by name saved in database.
            userComboboxField.SelectedValue = userDataLabel.Content.ToString();
            //Fill insurance policy text field by policy number saved in date base.
            policyNumberTextField.Text = policyDataLabel.Content.ToString();
            //Fill Broker name text field by broker name saved in data base.
            brokerNameTextField.Text = brokerNameLabel.Content.ToString();
        }
        protected override void SelectEstadoLineaAction()
        {
            if (Lineas_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            LineaPedido item = (LineaPedido)Lineas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            EEstado[] list = { EEstado.Anulado, EEstado.Abierto, EEstado.Solicitado, EEstado.Closed };

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;

                item.Estado = estado.Oid;

                ControlsMng.UpdateBinding(Datos_Lineas);
            }
        }
Ejemplo n.º 7
0
        protected virtual void SetPaymentStatusAction()
        {
            moleQule.Base.EEstado[] estados = new moleQule.Base.EEstado[3] {
                moleQule.Base.EEstado.Pendiente, moleQule.Base.EEstado.Pagado, moleQule.Base.EEstado.Devuelto
            };

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(moleQule.Base.EnumText <moleQule.Base.EEstado> .GetList(estados));

            try
            {
                Datos.RaiseListChangedEvents = false;

                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    ComboBoxSource item = form.Selected as ComboBoxSource;

                    _entity.EstadoPago    = item.Oid;
                    PaymentStatus_TB.Text = _entity.EstadoPagoLabel;
                }
            }
            finally
            {
                Datos.RaiseListChangedEvents = true;
            }
        }
Ejemplo n.º 8
0
        protected virtual void SetFormaPago()
        {
            if (!ControlsMng.IsCurrentItemValid(Datos_DGW))
            {
                return;
            }
            CreditCard item = ControlsMng.GetCurrentItem(Datos_DGW) as CreditCard;

            EFormaPago[] list;

            if (item.ETipoTarjeta == ETipoTarjeta.Credito)
            {
                list = new EFormaPago[] { EFormaPago.MesVencido, EFormaPago.XDiasMes }
            }
            ;
            else
            {
                list = new EFormaPago[] { EFormaPago.Contado }
            };

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <EFormaPago> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource forma_pago = form.Selected as ComboBoxSource;

                item.FormaPago = forma_pago.Oid;
                Datos_DGW.CurrentCell.Value = item.FormaPagoLabel;
            }
        }
Ejemplo n.º 9
0
 public RemoveUser()
 {
     InitializeComponent();
     //Loads user from database into combobox, where DisplayMemberPath and SelectedValuePath = "Name".
     ComboBoxSource.SetupItemsInComboBoxDisplay(nameDataUserName.ItemsSource       = DisplayComboboxList.SetUpNameInComboBox(),
                                                nameDataUserName.DisplayMemberPath = "Name", nameDataUserName.SelectedValuePath = "ID");
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Deletes user from database after selecting in combobox and click delete button.
        /// </summary>
        private void DeleteUserFromDatabaseButton(object sender, RoutedEventArgs e)
        {
            DeleteUser.DeleteClientFromDatabase(nameDataUserName.DisplayMemberPath, nameDataUserName.SelectedValue);

            ComboBoxSource.SetupItemsInComboBoxDisplay(nameDataUserName.ItemsSource       = DisplayComboboxList.SetUpNameInComboBox(),
                                                       nameDataUserName.DisplayMemberPath = "Name", nameDataUserName.SelectedValuePath = "ID");
        }
Ejemplo n.º 11
0
        public override void RefreshSecondaryData()
        {
            ModuloList modulos = ModuloList.GetList(false);

            Library.Instruction.HComboBoxSourceList _combo_modulos = new Library.Instruction.HComboBoxSourceList(modulos);
            Datos_Modulos.DataSource = _combo_modulos;
            PgMng.Grow(string.Empty, "_combo_modulos");

            InstructorList instructores = InstructorList.GetList(false);

            Library.Instruction.HComboBoxSourceList _combo_instructores = new Library.Instruction.HComboBoxSourceList(instructores);
            Datos_Instructores.DataSource = _combo_instructores;
            PgMng.Grow(string.Empty, "_combo_instructores");

            PromocionList promociones = PromocionList.GetList(false);

            Library.Instruction.HComboBoxSourceList _combo_promociones = new Library.Instruction.HComboBoxSourceList(promociones);
            ComboBoxSource combo = new ComboBoxSource(-1, "No especificado");

            _combo_promociones.Add(combo);
            Datos_Promociones.DataSource = _combo_promociones;
            PgMng.Grow(string.Empty, "_combo_promociones");

            //_respuestas = RespuestaList.GetList();
        }
Ejemplo n.º 12
0
        public override void RefreshSecondaryData()
        {
            ModuloList modulos = ModuloList.GetList(false);

            Library.Instruction.HComboBoxSourceList _combo_modulos = new Library.Instruction.HComboBoxSourceList(modulos);
            Datos_Modulos.DataSource = _combo_modulos;
            PgMng.Grow(string.Empty, "_combo_modulos");

            InstructorList instructores = InstructorList.GetList(false);

            Library.Instruction.HComboBoxSourceList _combo_instructores = new Library.Instruction.HComboBoxSourceList(instructores);
            Datos_Instructores.DataSource = _combo_instructores;
            PgMng.Grow(string.Empty, "_combo_instructores");

            PromocionList promociones = PromocionList.GetList(false);

            Library.Instruction.HComboBoxSourceList _combo_promociones = new Library.Instruction.HComboBoxSourceList(promociones);
            ComboBoxSource combo = new ComboBoxSource(-1, "No especificado");

            _combo_promociones.Add(combo);
            Datos_Promociones.DataSource = _combo_promociones;
            PgMng.Grow(string.Empty, "_combo_promociones");

            _lista_preguntas = PreguntaList.GetPreguntasModulo(Entity.OidModulo);
            PgMng.Grow(string.Empty, "Preguntas del Módulo");
            //_submodulos = SubmoduloList.GetList(false);
            //_temas = TemaList.GetList(false);
        }
Ejemplo n.º 13
0
        protected virtual void SetChargeStatusAction()
        {
            EEstado[] estados = new EEstado[3] {
                EEstado.Pendiente, EEstado.Charged, EEstado.Devuelto
            };

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <EEstado> .GetList(estados));
            try
            {
                Datos.RaiseListChangedEvents = false;

                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    ComboBoxSource item = form.Selected as ComboBoxSource;

                    _entity.EstadoCobro = item.Oid;
                    EstadoCobro_TB.Text = _entity.EstadoCobroLabel;
                }
            }
            finally
            {
                Datos.RaiseListChangedEvents = true;
            }
        }
Ejemplo n.º 14
0
        private void SetMedioPagoAction()
        {
            EMedioPago[]        list = { EMedioPago.Domiciliacion, EMedioPago.Ingreso, EMedioPago.Transferencia };
            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <EMedioPago> .GetList(list));

            try
            {
                Datos.RaiseListChangedEvents = false;

                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    ComboBoxSource item = form.Selected as ComboBoxSource;
                    _entity.MedioPago = item.Oid;
                    MedioPago_TB.Text = _entity.EMedioPagoLabel;

                    if (!Library.Common.EnumFunctions.NeedsCuentaBancaria(_entity.EMedioPago))
                    {
                        _entity.OidCuentaBancaria = 0;
                        _entity.CuentaBancaria    = string.Empty;
                        CuentaBancaria_TB.Text    = string.Empty;
                    }
                }
            }
            finally
            {
                Datos.RaiseListChangedEvents = true;
            }
        }
Ejemplo n.º 15
0
        private void Datos_DG_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this is SubtipoFacturaSelectForm)
            {
                return;
            }
            if (Datos_DG.CurrentRow == null)
            {
                return;
            }
            if (e.ColumnIndex == -1)
            {
                return;
            }

            if (Datos_DG.Columns[e.ColumnIndex].Name == Tipo.Name)
            {
                DataGridViewRow row  = Datos_DG.CurrentRow;
                SubtipoFactura  item = row.DataBoundItem as SubtipoFactura;

                SelectEnumInputForm form = new SelectEnumInputForm(true);
                form.SetDataSource(Library.Common.EnumText <ESubtipoFactura> .GetList(false));

                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    ComboBoxSource selected = form.Selected as ComboBoxSource;

                    item.Tipo = selected.Oid;
                }
            }
        }
Ejemplo n.º 16
0
        protected override void SetStatusAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            if (item.EEstado == moleQule.Base.EEstado.Anulado)
            {
                return;
            }
            if (item.EEstado == moleQule.Base.EEstado.Pagado)
            {
                return;
            }

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            moleQule.Base.EEstado[] list = { moleQule.Base.EEstado.Abierto, moleQule.Base.EEstado.Contabilizado, moleQule.Base.EEstado.Anulado };
            form.SetDataSource(moleQule.Base.EnumText <moleQule.Base.EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;

                ChangeState(item, (moleQule.Base.EEstado)estado.Oid);

                Payrolls_BS.ResetBindings(false);

                SetGridFormat();
            }
        }
Ejemplo n.º 17
0
 public HComboBoxSourceList(MunicipioList lista)
 {
     foreach (MunicipioInfo item in lista)
     {
         ComboBoxSource combo = new ComboBoxSource();
         combo.Texto = item.Nombre;
         combo.Oid   = item.Oid;
         this.Add(combo);
     }
 }
Ejemplo n.º 18
0
 public HComboBoxSourceList(ProveedorList lista)
 {
     foreach (ProveedorInfo item in lista)
     {
         ComboBoxSource combo = new ComboBoxSource();
         combo.Texto = item.Nombre;
         combo.Oid   = item.Oid;
         this.Add(combo);
     }
 }
Ejemplo n.º 19
0
        public ImportUserPolicyToDatabase()
        {
            InitializeComponent();

            //Loads user from database into combobox, where DisplayMemberPath and SelectedValuePath = "Name".
            ComboBoxSource.SetupItemsInComboBoxDisplay(chosePolicyOwnerCombobox.ItemsSource       = DisplayComboboxList.SetUpNameInComboBox(),
                                                       chosePolicyOwnerCombobox.DisplayMemberPath = "Name", chosePolicyOwnerCombobox.SelectedValuePath = "Name");

            //Fill combobox by current logged user.
            chosePolicyOwnerCombobox.SelectedValue = UserInformation.CurrentLoggedInUser;
        }
        public NotSettledPolicyDocumentsDatagrid()
        {
            InitializeComponent();

            //Sets usernames into combobox from database.
            ComboBoxSource.SetupItemsInComboBoxDisplay(userNameCombobox.ItemsSource       = DisplayComboboxList.SetUpNameInComboBox(),
                                                       userNameCombobox.DisplayMemberPath = "Name", userNameCombobox.SelectedValuePath = "Name");

            //Load not settled insurance policies into datagrid.
            showNotSettledPolicyDocumentDatagrid.ItemsSource = DisplayNotSettledDocuments.InDataGrid();
        }
Ejemplo n.º 21
0
        public HComboBoxSourceList(MaterialDocenteList lista)
        {
            foreach (MaterialDocenteInfo item in lista)
            {
                ComboBoxSource combo = new ComboBoxSource();

                combo.Texto = item.Nombre;
                combo.Oid   = item.Oid;

                this.Add(combo);
            }
        }
Ejemplo n.º 22
0
        protected virtual void SelectStatusAction()
        {
            SelectEnumInputForm form = new SelectEnumInputForm(true);

            moleQule.Base.EEstado[] list = { moleQule.Base.EEstado.Active, moleQule.Base.EEstado.Baja };
            form.SetDataSource(moleQule.Base.EnumText <moleQule.Base.EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;
                _entity.Status = estado.Oid;
            }
        }
Ejemplo n.º 23
0
        protected void SetSaleMethodAction()
        {
            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(moleQule.Common.Structs.EnumText <ETipoFacturacion> .GetList(false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource tipo_venta = form.Selected as ComboBoxSource;
                _entity.ETipoFacturacion = (ETipoFacturacion)tipo_venta.Oid;
                FormaVenta_TB.Text       = _entity.TipoFacturacionLabel;
            }
        }
Ejemplo n.º 24
0
        public HComboBoxSourceList(Type tipo)
        {
            string[] nombres = Enum.GetNames(tipo);

            foreach (string item in nombres)
            {
                ComboBoxSource combo  = new ComboBoxSource();
                object         estado = Enum.Parse(tipo, item);
                combo.Texto = estado.ToString().Replace('_', ' ');
                combo.Oid   = (int)estado;
                this.Add(combo);
            }
        }
Ejemplo n.º 25
0
        private void TipoCuenta_BT_Click(object sender, EventArgs e)
        {
            SelectEnumInputForm form = new SelectEnumInputForm(true);

            ETipoCuenta[] list = { ETipoCuenta.CuentaCorriente, ETipoCuenta.LineaCredito };
            form.SetDataSource(Library.Common.EnumText <ETipoCuenta> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;
                _entity.TipoCuenta = estado.Oid;
            }
        }
        public HComboBoxSourceList(PlanAnualList lista)
        {
            this.AddEmptyItem();
            foreach (PlanAnualInfo item in lista)
            {
                ComboBoxSource combo = new ComboBoxSource();

                combo.Texto = item.Nombre;
                combo.Oid   = item.Oid;

                this.Add(combo);
            }
        }
        public HComboBoxSourceList(DepartamentoList lista)
        {
            this.AddEmptyItem();
            foreach (DepartamentoInfo item in lista)
            {
                ComboBoxSource combo = new ComboBoxSource();

                combo.Texto = item.Nombre;
                combo.Oid   = item.Oid;

                this.Add(combo);
            }
        }
        private void Estado_BT_Click(object sender, EventArgs e)
        {
            SelectEnumInputForm form = new SelectEnumInputForm(true);

            moleQule.Base.EEstado[] list = { moleQule.Base.EEstado.Active, moleQule.Base.EEstado.Baja };
            form.SetDataSource(moleQule.Base.EnumText <moleQule.Base.EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;
                _entity.Estado = estado.Oid;
            }
        }
Ejemplo n.º 29
0
        protected void SetEstadoAction()
        {
            SelectEnumInputForm form = new SelectEnumInputForm(true);

            moleQule.Base.EEstado[] list = { moleQule.Base.EEstado.Abierto, moleQule.Base.EEstado.Anulado, moleQule.Base.EEstado.Contabilizado, moleQule.Base.EEstado.Exportado };
            form.SetDataSource(moleQule.Base.EnumText <moleQule.Base.EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;
                _entity.Estado = estado.Oid;
            }
        }
Ejemplo n.º 30
0
        protected void SetCategoriaAction()
        {
            SelectEnumInputForm form = new SelectEnumInputForm(true);

            ECategoriaGasto[] list = { ECategoriaGasto.Administracion, ECategoriaGasto.Bancario, ECategoriaGasto.Impuesto, ECategoriaGasto.SeguroSocial, ECategoriaGasto.Otros };
            form.SetDataSource(moleQule.Store.Structs.EnumText <ECategoriaGasto> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource categoria = form.Selected as ComboBoxSource;
                _entity.CategoriaGasto = categoria.Oid;
            }
        }