示例#1
0
 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
     });
 }
示例#2
0
        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;
            }
        }
示例#3
0
 public TithesViewModel UpdateTithe(TithesViewModel tithe)
 {
     db.Entry(GetTitheById(tithe.TitheId)).CurrentValues.SetValues(ModelFactory.CreateTithe(tithe));
     SaveAll();
     return(GetMemberTitheByTitheId(tithe.TitheId));
 }