public HistoryPointController( IHistoryPointService _HistoryPoint , IUserRepository _user ) { HistoryPointService = _HistoryPoint; userRepository = _user; }
public static void DeletedPoint(int?TargetId, string TargetName) { IHistoryPointService HistoryPointService = DependencyResolver.Current.GetService <IHistoryPointService>(); var HistoryPoint = HistoryPointService.GetAllHistoryPoint().Where(x => x.TargetId == TargetId && x.TargetName == TargetName).ToList(); foreach (var item in HistoryPoint) { HistoryPointService.Delete(item); } }
public static void CreatePoint(int?CustomerId, int?TargetId, string TargetName, double?AccumulatedPoint, double?UsePoint) { IHistoryPointService HistoryPointService = DependencyResolver.Current.GetService <IHistoryPointService>(); var HistoryPoint = new HistoryPoint(); HistoryPoint.IsDeleted = false; HistoryPoint.CreatedUserId = WebSecurity.CurrentUserId; HistoryPoint.CreatedDate = DateTime.Now; HistoryPoint.ModifiedUserId = WebSecurity.CurrentUserId; HistoryPoint.ModifiedDate = DateTime.Now; HistoryPoint.CustomerId = CustomerId; HistoryPoint.TargetId = TargetId; HistoryPoint.TargetName = TargetName; HistoryPoint.AccumulatedPoint = AccumulatedPoint; HistoryPoint.UsePoint = UsePoint; HistoryPointService.Create(HistoryPoint); }