/// <summary> /// Guarda en la bd el objeto actual /// </summary> protected override bool SaveObject() { this.Datos.RaiseListChangedEvents = false; LineaFomento temp = _entity.Clone(); temp.ApplyEdit(); // do the save try { _entity = temp.Save(); _entity.ApplyEdit(); return(true); } catch (Exception ex) { PgMng.ShowInfoException(iQExceptionHandler.GetAllMessages(ex)); return(false); } finally { this.Datos.RaiseListChangedEvents = true; } }
protected override void SelectEstadoFomentoAction() { if (Fomento_DGW.CurrentRow == null) { return; } LineaFomento item = (LineaFomento)Fomento_DGW.CurrentRow.DataBoundItem; SelectEnumInputForm form = new SelectEnumInputForm(true); moleQule.Base.EEstado[] list = { moleQule.Base.EEstado.Anulado, moleQule.Base.EEstado.Abierto, moleQule.Base.EEstado.EnSolicitud, 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; ChangeEstadoFomento(Fomento_DGW.CurrentRow, (moleQule.Base.EEstado)estado.Oid); Fomento_DGW.CurrentCell.Value = estado.Texto; SetFomentoFormat(); } }
public LineaFomentoAddForm(LineaFomento source) : base() { InitializeComponent(); _entity = source.Clone(); _entity.BeginEdit(); SetFormData(); _mf_type = ManagerFormType.MFAdd; }
public static LineaFomentoList GetChildList(ExpedientInfo parent, bool childs) { CriteriaEx criteria = LineaFomento.GetCriteria(LineaFomento.OpenSession()); criteria.Query = LineaFomentoList.SELECT(parent); criteria.Childs = childs; LineaFomentoList list = DataPortal.Fetch <LineaFomentoList>(criteria); CloseSession(criteria.SessionCode); return(list); }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { LineaFomentoList listA = LineaFomentoList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Unlock: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { LineaFomentoList listD = LineaFomentoList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
protected override void SetFomentoFormat() { foreach (DataGridViewRow row in Fomento_DGW.Rows) { if (row.IsNewRow) { return; } LineaFomento item = (LineaFomento)row.DataBoundItem; Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado); SetRowFormat(row, "FechaSolicitudLFomento", item.FechaSolicitud); } }
protected override void DeleteLineaFomentoAction() { if (Fomento_DGW.CurrentRow == null) { return; } if (Fomento_DGW.CurrentRow.DataBoundItem == null) { return; } LineaFomento linea = Fomento_DGW.CurrentRow.DataBoundItem as LineaFomento; _entity.ExpedientesFomento.RemoveItem(linea); }
private static LineaFomentoList GetList(string query, bool childs) { CriteriaEx criteria = LineaFomento.GetCriteria(LineaFomento.OpenSession()); criteria.Childs = childs; if (nHManager.Instance.UseDirectSQL) { criteria.Query = query; } LineaFomentoList list = DataPortal.Fetch <LineaFomentoList>(criteria); CloseSession(criteria.SessionCode); return(list); }
protected override void NullLineaFomentoAction() { if (Fomento_DGW.CurrentRow == null) { return; } if (Fomento_DGW.CurrentRow.DataBoundItem == null) { return; } LineaFomento linea = Fomento_DGW.CurrentRow.DataBoundItem as LineaFomento; linea.EEstado = moleQule.Base.EEstado.Anulado; SetFomentoFormat(); }
protected override void AttachFacturaNavieraActon() { if (Fomento_DGW.CurrentRow == null) { return; } if (Fomento_DGW.CurrentRow.DataBoundItem == null) { return; } LineaFomento linea = Fomento_DGW.CurrentRow.DataBoundItem as LineaFomento; InputInvoiceList list = _entity.GetFacturasNaviera(); InputInvoiceSelectForm form = new InputInvoiceSelectForm(this, list); if (form.ShowDialog(this) == DialogResult.OK) { InputInvoiceInfo fac = form.Selected as InputInvoiceInfo; _entity.ExpedientesFomento.SetValues(_entity, fac, linea); } }
protected override void AdjuntarDocumentosFomentoAction() { if (Fomento_DGW.CurrentRow == null) { return; } LineaFomento item = (LineaFomento)Fomento_DGW.CurrentRow.DataBoundItem; try { AgenteEditForm form = new AgenteEditForm(typeof(LineaFomento), item as IAgenteHipatia, this); form.ShowDialog(this); } catch (HipatiaException ex) { if (ex.Code == HipatiaCode.NO_AGENTE) { AgenteAddForm form = new AgenteAddForm(typeof(LineaFomento), item as IAgenteHipatia, this); form.ShowDialog(this); } } }
protected void ChangeEstadoFomento(DataGridViewRow row, moleQule.Base.EEstado estado) { LineaFomento item = row.DataBoundItem as LineaFomento; item.EEstado = estado; }
public static string SELECT_INFORME_FOMENTO(QueryConditions conditions) { return(LineaFomento.SELECT_INFORME_FOMENTO(conditions, false)); }
public static string SELECT_BY_COBRO(QueryConditions conditions) { return(LineaFomento.SELECT_BY_COBRO(conditions, false)); }
public static string SELECT_BY_COBRO_AND_PENDIENTES(QueryConditions conditions) { return(LineaFomento.SELECT_BY_COBRO_AND_PENDIENTES(conditions, false)); }
protected void MarkAsTeus20(DataGridViewRow row) { LineaFomento item = row.DataBoundItem as LineaFomento; item.Teus = Library.Store.Resources.Labels.TEUS20; }
protected override void GetFormSourceData() { _entity = LineaFomento.New(); _entity.BeginEdit(); }
public void CopyFrom(LineaFomento source) { _base.CopyValues(source); }
protected override void GetFormSourceData(long oid) { _entity = LineaFomento.Get(oid); _entity.BeginEdit(); }
public static string SELECT(ExpedientInfo parent) { return(LineaFomento.SELECT(new QueryConditions { Expedient = parent }, true)); }