protected override void LoadAyudas() { if (_entity.ExpedientesFomento == null || _entity.ExpedientesFomento.Count == 0) { PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this); try { PgMng.Grow(); _entity.LoadChilds(typeof(REAExpedient), true, true); Datos_REA.DataSource = _entity.ExpedientesREA; Datos_REA.ResetBindings(true); PgMng.Grow(); } finally { PgMng.FillUp(); } } else { Datos_REA.DataSource = _entity.ExpedientesREA; Datos_REA.ResetBindings(false); } AyudaTotal_NTB.Text = _entity.AyudaExpediente.ToString("C2"); CalculateBeneficios(); SetExpedienteREAFormat(); }
protected override void GetFormSourceData(long oid, object[] parameters) { _entity = ExpedientInfo.Get(oid, false); PgMng.Grow(); _entity.LoadChilds(typeof(Batch), true, true); PgMng.Grow(string.Empty, "Partidas"); _entity.LoadChilds(typeof(Expense), true, true); PgMng.Grow(string.Empty, "Gastos"); }
public override void DeleteObject(long oid) { ExpedientInfo exp = ExpedientInfo.Get(oid, false); exp.LoadChilds(typeof(Batch), false, true); if (exp.Partidas.Count > 0) { MessageBox.Show("El expediente tiene productos asociados", moleQule.Face.Resources.Labels.ADVISE_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Warning); _action_result = DialogResult.Ignore; return; } exp.LoadChilds(typeof(Maquinaria), false, true); if (exp.Maquinarias != null && exp.Maquinarias.Count > 0) { MessageBox.Show("El expediente tiene maquinas asociadas", moleQule.Face.Resources.Labels.ADVISE_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Warning); _action_result = DialogResult.Ignore; return; } Expedient.Delete(oid); _action_result = DialogResult.OK; ExpedienteList cache = Cache.Instance.Get(typeof(ExpedienteList)) as ExpedienteList; if (cache != null) { cache.RemoveItem(oid); } //Se eliminan todos los formularios de ese objeto foreach (EntityDriverForm form in _list_active_form) { if (form is ItemMngBaseForm) { if (((ItemMngBaseForm)form).Oid == oid) { form.Dispose(); break; } } } }
protected override void GetFormSourceData(long oid, object[] parameters) { _entity = ExpedientInfo.Get(oid, false); PgMng.Grow(); _entity.LoadChilds(typeof(Batch), true, true); PgMng.Grow(string.Empty, "Partidas"); try { _entity.LoadChilds(typeof(Expense), true, true); PgMng.Grow(string.Empty, "Gastos"); } catch { PgMng.ShowWarningException(Resources.Messages.DUPLICATED_EXPENSE_LINE); } }
protected override void LoadStock() { if (_entity.Stocks.Count == 0) { PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this); try { PgMng.Grow(); _entity.LoadChilds(typeof(Stock), true, true); PgMng.Grow(); SelectStockAction(Datos_Productos.Current as ProductInfo); } finally { PgMng.FillUp(); } } }