/// <summary> /// Guarda en la bd el objeto actual /// </summary> protected override bool SaveObject() { this.Datos.RaiseListChangedEvents = false; FinancialCash temp = _entity.Clone(); temp.ApplyEdit(); // do the save try { _entity = temp.Save(); _entity.ApplyEdit(); return(true); } catch (Exception ex) { PgMng.ShowInfoException(ex); return(false); } finally { this.Datos.RaiseListChangedEvents = true; } }
public override void UpdateList() { switch (_current_action) { case molAction.Add: break; case molAction.ChangeStateContabilizado: case molAction.ChangeStateAnulado: case molAction.Unlock: case molAction.Edit: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public override void OpenEditForm() { FinancialCashEditForm form = new FinancialCashEditForm(ActiveItem, this); if (form.Entity != null) { AddForm(form); _entity = form.Entity; } }
public static FinancialCashList GetNegociadosList(DateTime dueDateFrom, DateTime dueDateTill, bool childs) { QueryConditions conditions = new QueryConditions { FechaAuxIni = dueDateFrom, FechaAuxFin = dueDateTill }; return(GetList(FinancialCash.SELECT_NEGOCIADOS(conditions, false), childs)); }
private static FinancialCashList GetList(string query, bool childs) { CriteriaEx criteria = FinancialCash.GetCriteria(FinancialCash.OpenSession()); criteria.Childs = childs; criteria.Query = query; FinancialCashList list = DataPortal.Fetch <FinancialCashList>(criteria); CloseSession(criteria.SessionCode); return(list); }
// called to retrieve data from database protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; Childs = criteria.Childs; IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); try { if (nHMng.UseDirectSQL) { IsReadOnly = false; while (reader.Read()) { this.AddItem(FinancialCashInfo.GetChild(reader, Childs)); } IsReadOnly = true; if (criteria.PagingInfo != null) { reader = nHManager.Instance.SQLNativeSelect(FinancialCash.SELECT_COUNT(criteria), criteria.Session); if (reader.Read()) { criteria.PagingInfo.TotalItems = Format.DataReader.GetInt32(reader, "TOTAL_ROWS"); } } } } catch (Exception ex) { iQExceptionHandler.TreatException(ex, new object[] { criteria.Query }); } this.RaiseListChangedEvents = true; }
public void CopyFrom(FinancialCash source) { _base.CopyValues(source); }
public void SetFormData(FinancialCashInfo source) { _entity = FinancialCash.Get(source.Oid, false); _entity.BeginEdit(); base.SetFormData(); }
public void Update(FinancialCash financialCash) { _financialCashDal.Update(financialCash); }
public void Insert(FinancialCash financialCash) { _financialCashDal.Add(financialCash); }
public static string SELECT(QueryConditions conditions) { return(FinancialCash.SELECT(conditions, false)); }