public static CouponEntity CouponMapper(TA_ussbk_Coupons tentity) { var resultl = new CouponEntity { couponid = tentity.couponid, couponcode = tentity.couponcode, cmsgforuser = tentity.cmsgforuser, cAdminRemarks = tentity.cAdminRemarks, cblocked = tentity.cblocked.HasValue ? tentity.cblocked.Value : false, camount = tentity.camount.Value, }; return(resultl); }
public long Create(CouponEntity tentity) { using (var scope = new TransactionScope()) { var NewRecord = new TA_ussbk_Coupons { couponcode = tentity.couponcode, cmsgforuser = tentity.cmsgforuser, cAdminRemarks = tentity.cAdminRemarks, cblocked = tentity.cblocked, camount = tentity.camount, }; _unitOfWork.CouponRepository.Insert(NewRecord); _unitOfWork.Save(); scope.Complete(); return(NewRecord.couponid); } }