示例#1
0
        protected void NewOtroGasto(Expedient expediente)
        {
            expediente.NuevoGasto(true);

            UpdateBindings();
            UpdateExpensesList();
        }
示例#2
0
        protected void AddFacturaGastos(Expedient expediente, InputInvoiceInfo fac)
        {
            this.Enabled = false;

            try
            {
                PgMng.Reset(5, 1, "Recalculando gastos y costes del expediente...", this);

                if (fac.Conceptos == null)
                {
                    fac.LoadChilds(typeof(InputInvoiceLine), false);
                }

                foreach (InputInvoiceLineInfo item in fac.Conceptos)
                {
                    if ((item.OidExpediente != expediente.Oid) && (item.OidExpediente != 0))
                    {
                        item.IsSelected = false;
                    }
                    else
                    {
                        item.IsSelected    = true;
                        item.OidExpediente = expediente.Oid;
                        item.Expediente    = expediente.Codigo;
                    }
                }
                PgMng.Grow();

                expediente.LoadConceptosAlbaranes(false);
                PgMng.Grow();

                expediente.NuevoGasto(fac, expediente.Conceptos, true);
                PgMng.Grow();

                UpdateExpensesList();
                UpdateBindings();
                PgMng.Grow();
            }
            catch (iQException ex)
            {
                PgMng.ShowInfoException(ex);
            }
            finally
            {
                PgMng.FillUp();
                this.Enabled = true;
            }
        }