public bool Update(DtoCashVoucherRequest request) { var cashVoucher = CashVoucherRepository.Get(request.Id); if (cashVoucher != null) { cashVoucher.EnableAudit(); cashVoucher.Ycv_Name = request.Name; cashVoucher.Ycv_SchoolId = request.SchoolId; cashVoucher.Ycv_PublishCount = request.PublishCount; cashVoucher.Ycv_Amount = request.Amount; cashVoucher.Ycv_LimitByPerson = request.LimitByPerson; cashVoucher.Ycv_OrderAmountLimit = request.OrderAmountLimit; cashVoucher.Ycv_ExpireType = request.ExpireType; cashVoucher.Ycv_ExpireDate = request.ExpireDate; cashVoucher.Ycv_ExpireDayCount = request.ExpireDay; cashVoucher.Ycv_ApplyScopeType = request.ApplyScopeType; cashVoucher.Ycv_ApplyGrade = request.Grade; cashVoucher.Ycv_CourseType = request.CourseType; cashVoucher.Ycv_CourseId = request.CourseId; cashVoucher.Ycv_RelatedCourseId = request.RelatedCourseId; cashVoucher.Ycv_UseWithVoucherType = request.UseWithVoucherType; cashVoucher.Ycv_Remark = request.Remark; cashVoucher.Ycv_UpdateTime = DateTime.Now; cashVoucher.Ycv_Editor = request.Editor; return(CashVoucherRepository.Update(cashVoucher)); } return(false); }
public bool UpdateStatus(int id, int status) { var cashVoucher = CashVoucherRepository.Get(id); if (cashVoucher != null) { cashVoucher.EnableAudit(); cashVoucher.Ycv_Status = status; return(CashVoucherRepository.Update(cashVoucher)); } return(false); }