コード例 #1
0
        public static bool validateMemberProductModel(MemberProductModel MemberProductModel)
        {
            var validationResults = new List <ValidationResult>();
            //validate MemberProductModel
            var  validationContext = new ValidationContext(MemberProductModel, serviceProvider: null, items: null);
            bool isValid           = System.ComponentModel.DataAnnotations.Validator.TryValidateObject(MemberProductModel, validationContext, validationResults, true);

            return(isValid);
        }
コード例 #2
0
 public static MemberProductContract ToMemberProductContract(this MemberProductModel memProductModel)
 {
     return(new MemberProductContract
     {
         MemberID = memProductModel.MemberID,
         RefProductID = memProductModel.RefProductID,
         IsMemberProductActive = memProductModel.IsMemberProductActive,
         MemberProductValue = memProductModel.MemberProductValue
     });
 }
コード例 #3
0
 public bool UpdateMemberProduct(MemberProductModel memberProduct)
 {
     if (MemberProductValidation.validateMemberProductModel(memberProduct))
     {
         int currentUserMemberId = _asaMemberAdapter.GetMemberIdFromContext();
         memberProduct.MemberID = currentUserMemberId;
         return(_asaMemberAdapter.UpdateMemberProduct(memberProduct));
     }
     return(false);
 }
コード例 #4
0
        public bool UpdateMemberProduct(MemberProductModel memberProduct)
        {
            bool result = SaltServiceAgent.UpdateMemberProduct(memberProduct.ToMemberProductContract());

            return(result);
        }
コード例 #5
0
 /// <summary>
 /// Adds member product
 /// </summary>
 /// <param name="memberProduct"></param>
 /// <returns>bool</returns>
 public bool AddMemberProduct(MemberProductModel memberProduct)
 {
     throw new NotImplementedException();
 }