public void AddTransiction(Transiction t) { if (!HasTransiction(t)) { Transictions.Add(t); } }
public bool InsertIntoTransiction(long service_id, double service_amount) { try { var transictions = new Transictions { Guid = Guid.NewGuid().ToString().ToUpper(), ServiceId = service_id, TransictionAmount = service_amount, TransictionDate = DateTime.Now, IsActive = true, CreatedOn = DateTime.Now, UpdatedOn = DateTime.Now }; context.Add(transictions); context.SaveChanges(); return(true); } catch (Exception ex) { string error = ex.GetBaseException().Message; } return(false); }