示例#1
0
        protected override void EditPagoAction()
        {
            bool locked = false;

            if (Pago == null)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.NO_SELECTED);
                return;
            }

            if (Pago.EEstado == moleQule.Base.EEstado.Anulado)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.ITEM_ANULADO_NO_EDIT);
                return;
            }

            PayrollPaymentEditForm form = new PayrollPaymentEditForm(this, _entity, Pago.Oid, locked);

            form.MedioPago_BT.Enabled = false;
            form.ShowDialog(this);

            Payment current = Pago;

            Payments_BS.ResetBindings(false);
            _summary.Refresh(_entity);
            Summary_BS.ResetBindings(false);
            SetGridColors(Pagos_DGW.Name);
            _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false);
            Select(current);
        }
示例#2
0
        protected void ChangeState(moleQule.Base.EEstado estado)
        {
            if (Pago == null)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.NO_SELECTED);
                return;
            }

            if (Pago.EEstado == moleQule.Base.EEstado.Anulado)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.ITEM_ANULADO_NO_EDIT);
                return;
            }

            switch (estado)
            {
            case moleQule.Base.EEstado.Anulado:
            {
                if (Pago.EEstado == moleQule.Base.EEstado.Contabilizado)
                {
                    PgMng.ShowInfoException(moleQule.Common.Resources.Messages.NULL_CONTABILIZADO_NOT_ALLOWED);
                    return;
                }

                if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
                {
                    return;
                }
            }
            break;
            }

            try
            {
                _entity.Pagos.ChangeState(estado, Pago, _entity);
                _entity.ApplyEdit();
                _entity.ISave(Pago);
                _entity.BeginEdit();

                Payment current = Pago;
                Payments_BS.ResetBindings(false);
                _summary.Refresh(_entity);
                Summary_BS.ResetBindings(false);
                SetGridColors(Pagos_DGW.Name);
                _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false);
                Select(current);
            }
            catch (Exception ex)
            {
                PgMng.ShowInfoException(ex);
            }
        }
示例#3
0
        protected override void RefreshMainData()
        {
            _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false);
            PgMng.Grow();

            Datos.DataSource = _entity;
            PgMng.Grow();

            _entity.LoadChilds(typeof(Payment), true);
            Payments_BS.DataSource = _entity.Pagos.GetSortedList("Fecha", ListSortDirection.Descending);
            PgMng.Grow();

            Summary_BS.DataSource = _summary;

            base.RefreshMainData();
        }
示例#4
0
        protected override void RefreshAction()
        {
            Payment current = Pago;

            Payments_BS.DataSource = _entity.Pagos.GetSortedList("Fecha", ListSortDirection.Descending);
            Pagos_DGW.Refresh();
            Payments_BS.ResetBindings(false);

            _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false);
            UpdatePendientes();

            _summary.Refresh(_entity);
            Summary_BS.ResetBindings(false);

            SetGridColors(Pagos_DGW.Name);

            Select(current);
        }