public TITHES CreateTithe(TithesViewModel tithe) { return(new TITHES { TITHE_ID = tithe.TitheId, MEMBER_ID = tithe.MemberId, DONATION_TYPE_ID = tithe.DonationType, TITHE_DATE = Convert.ToDateTime(tithe.TitheDate), IS_CHECK = tithe.IsCheck, CHECK_NUMBER = tithe.CheckNumber, TITHE_AMOUNT = tithe.TitheAmount, COMMENTS = tithe.Comments }); }
public TithesViewModel AddTithe(TithesViewModel tithe) { try { var titheRecord = ModelFactory.CreateTithe(tithe); db.TITHES.Add(titheRecord); SaveAll(); return(GetMemberTitheByTitheId(titheRecord.TITHE_ID)); } catch (Exception ex) { Console.WriteLine(ex); throw; } }
public TithesViewModel UpdateTithe(TithesViewModel tithe) { db.Entry(GetTitheById(tithe.TitheId)).CurrentValues.SetValues(ModelFactory.CreateTithe(tithe)); SaveAll(); return(GetMemberTitheByTitheId(tithe.TitheId)); }