public void Create(CashBookEntry item) { using (var context = GetContext()) { item.Id = DbIdHelper.GetNextID(); context.CashBookEntries.AddObject(item); Commit(context); } }
public void Edit(long id, CashBookEntry item) { using (var context = GetContext()) { var existingEntity = GetCashBookEntry(id, context); if (existingEntity != null) { existingEntity.Explicatii = item.Explicatii; existingEntity.Incasari = item.Incasari; existingEntity.NrActCasa = item.NrActCasa; existingEntity.NrAnexe = item.NrAnexe; existingEntity.NrCrt = item.NrCrt; existingEntity.Plati = item.Plati; } Commit(context); } }
/// <summary> /// Create a new CashBookEntry object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="nrCrt">Initial value of the NrCrt property.</param> /// <param name="nrActCasa">Initial value of the NrActCasa property.</param> /// <param name="nrAnexe">Initial value of the NrAnexe property.</param> /// <param name="explicatii">Initial value of the Explicatii property.</param> /// <param name="incasari">Initial value of the Incasari property.</param> /// <param name="plati">Initial value of the Plati property.</param> /// <param name="registruCasaZiId">Initial value of the RegistruCasaZiId property.</param> public static CashBookEntry CreateCashBookEntry(global::System.Int64 id, global::System.Int32 nrCrt, global::System.String nrActCasa, global::System.Int32 nrAnexe, global::System.String explicatii, global::System.Decimal incasari, global::System.Decimal plati, global::System.Int64 registruCasaZiId) { CashBookEntry cashBookEntry = new CashBookEntry(); cashBookEntry.Id = id; cashBookEntry.NrCrt = nrCrt; cashBookEntry.NrActCasa = nrActCasa; cashBookEntry.NrAnexe = nrAnexe; cashBookEntry.Explicatii = explicatii; cashBookEntry.Incasari = incasari; cashBookEntry.Plati = plati; cashBookEntry.RegistruCasaZiId = registruCasaZiId; return cashBookEntry; }
/// <summary> /// Deprecated Method for adding a new object to the CashBookEntries EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCashBookEntries(CashBookEntry cashBookEntry) { base.AddObject("CashBookEntries", cashBookEntry); }