Exemplo n.º 1
0
        /// <summary>
        /// 添加会员卡
        /// </summary>
        /// <param name="clubcard"></param>
        /// <returns></returns>
        public ReturnedData CustomerCardAddSub(ClubCardVO clubcard)
        {
            IClubCardMgm clubCardMgm = new ClubCardMgm();
            clubcard.CreatedDate = DateTime.Now;
            clubcard.LastModifiedDate = DateTime.Now;
            clubcard.SalesTime = DateTime.Now;
            clubcard.ExpireDate = clubcard.SalesTime.AddYears(2);
            clubcard.CreatorID = Emp.UserName;
            clubcard.LastModifierID = Emp.UserName;
            clubcard.ClubCardTypeName = new ClubCardTypeMgm().GetCardTypeByID(clubcard.ClubCardTypeID).CardTypeName;

            clubcard.ClubCardPwd = "123456";
            //clubcard.OpenCardStore = Emp.StroeName;
            //clubcard.SalesMan = Emp.Name;//存疑
            ReturnedData data = new ReturnedData();
            try
            {
                clubCardMgm.AddClubCard(clubcard);
                ICustomerMgm cusMgm = new CustomerMgm();
                var cust = cusMgm.GetCustomerByID(clubcard.CustomerID);
                cust.CardFlag = 1;
                cusMgm.EditCustomer(cust);
                data.Message = "开卡成功";
                data.Success = true;
            }
            catch (Exception ex)
            {
                data.Success = false;
                data.Message = "开卡失败";
                data.Error = ex.ToString();

            }

            return data;
        }
Exemplo n.º 2
0
        public void TestMethod3()
        {
            //add ClubCard
            ClubCardVO clubCardVO = new ClubCardVO();
            clubCardVO.Balance = 0.0M;
            clubCardVO.Birthday = "19860909";
            clubCardVO.CardStatus = 0;
            clubCardVO.ClubCardNo = "00001";
            clubCardVO.ClubCardPwd = "11111";
            clubCardVO.ClubCardTypeID = 1;
            clubCardVO.ClubCardTypeName = "金卡";
            clubCardVO.CustName = "tianx";
            clubCardVO.CustomerID = 1;
            clubCardVO.ExpireDate = DateTime.Parse("2025/09/09 12:00");
            clubCardVO.SalesMan = "songge";
            clubCardVO.SalesTime = DateTime.Parse("2015/09/09 12:00");

            clubCardVO.OpenCardStore = "minhangqu";

            clubCardVO.CreatedDate = DateTime.Now;
            clubCardVO.CreatorID = "001";
            clubCardVO.LastModifiedDate = DateTime.Now;
            clubCardVO.LastModifierID = "002";
            clubCardVO.LogicalStatus = 1;
            clubCardVO.PackageDiscount = 0.8M;
            clubCardVO.PayDiscount = 0.2M;

            //VO to PO
            Mapper.CreateMap<ClubCardVO, ClubCardPO>();

            ClubCardMgm clubMgm = new ClubCardMgm();
            clubMgm.AddClubCard(clubCardVO);
        }