protected void EditFacturaGastos(Expedient expediente, InputInvoiceInfo fac) { this.Enabled = false; try { PgMng.Reset(5, 1, "Recalculando gastos y costes del expediente...", this); PgMng.Grow(); expediente.LoadConceptosAlbaranes(false); PgMng.Grow(); expediente.UpdateGasto(fac, expediente.Conceptos, true); PgMng.Grow(); UpdateExpensesList(); UpdateBindings(); PgMng.Grow(); } finally { PgMng.FillUp(); this.Enabled = true; } }
protected void RemoveFacturaGastos(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) { item.IsSelected = true; } PgMng.Grow(); expediente.LoadConceptosAlbaranes(false); PgMng.Grow(); expediente.RemoveGasto(fac, expediente.Conceptos, true); PgMng.Grow(); UpdateExpensesList(); Datos.ResetBindings(false); PgMng.Grow(); } finally { PgMng.FillUp(); this.Enabled = true; } }
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; } }