示例#1
0
        public JsonResult SearchCustomer(string carno)
        {
            ICustomerMgm custMgm = new CustomerMgm();
            //改为车牌号查询
            //CustomerVO cust = custMgm.GetCustomerByMobileNo(mobilno);
            //ClubCardVO card = new ClubCardMgm().GetClubCardByCustID(cust.CustomerID);
            var          cust = custMgm.GetCustomerByCarNo(carno);
            ClubCardVO   card = new ClubCardMgm().GetClubCardByCustID(cust.CustomerID);
            ReturnedData data = new ReturnedData();

            if (cust.CustomerID == 0)
            {
                data.Success = false;
                data.Message = "该车牌号没有客户";
            }
            else
            {
                data.Success = true;
            }
            if (card == null)
            {
                card = new ClubCardVO();
            }
            CustomerAndCard custandcard = GetCusAndCardModel(card, cust);

            data.Data = custandcard;
            return(Json(data, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult ClubcardDetails(int id, string type)
        {
            CustomerAndCard cusAndCard = new CustomerAndCard();
            CustomerMgm     custMgm    = new CustomerMgm();
            ClubCardMgm     cardMgm    = new ClubCardMgm();
            var             ddllist    = GetddlList(DDLlist.CardType, false, null, null);

            ViewData["CardType"] = ddllist;
            if (type == "cust")
            {
                var        recust = custMgm.GetCustomerByID(id);
                ClubCardVO recard = new ClubCardVO();
                if (recust.CardFlag == 1)
                {
                    recard = cardMgm.GetClubCardByCustID(recust.CustomerID);
                }

                cusAndCard = GetCusAndCardModel(recard, recust);
            }
            else if (type == "card")
            {
                var recard = cardMgm.GetClubCardByID(id);
                var recust = custMgm.GetCustomerByID(recard.CustomerID);
                cusAndCard = GetCusAndCardModel(recard, recust);
            }

            return(View(cusAndCard));
        }
示例#3
0
        //
        // GET: /ClubcardRecharge/
        public ActionResult Index()
        {
            int             id      = NullHelper.Convert <int>(Request["id"], 0);
            CustomerAndCard cuscard = new CustomerAndCard();

            if (id > 0)
            {
                IClubCardMgm cardMgm = new ClubCardMgm();
                ClubCardVO   card    = cardMgm.GetClubCardByID(id);
                ICustomerMgm custMgm = new CustomerMgm();
                CustomerVO   cust    = custMgm.GetCustomerByID(card.CustomerID);
                cuscard = GetCusAndCardModel(card, cust);
            }
            return(View(cuscard));
        }
示例#4
0
        /// <summary>
        /// 提交信息
        /// </summary>
        /// <returns></returns>
        public JsonResult ClubCardDetailSub(CustomerAndCard cusandcard)
        {
            ReturnedData data = null;

            //添加会员卡
            if (cusandcard.CardID == 0)
            {
                data = CustomerCardAddSub(GetCardModel(cusandcard));
            }
            else//修改会员卡
            {
                data = CustomerCardEdiSub(GetCardModel(cusandcard));
            }
            return(Json(data, JsonRequestBehavior.AllowGet));
        }
示例#5
0
        private ClubCardVO GetCardModel(CustomerAndCard cusandcard)
        {
            ClubCardVO clubcard = new ClubCardVO()
            {
                CustomerID     = cusandcard.CustID,
                CustName       = cusandcard.CustName,
                ClubCardID     = cusandcard.CardID,
                ClubCardNo     = cusandcard.CardNo,
                ClubCardTypeID = cusandcard.CardType,
                SalesMan       = cusandcard.SaleMan,
                OpenCardStore  = cusandcard.OpenCardStore,
                CardStatus     = cusandcard.CardStatu
            };

            return(clubcard);
        }
示例#6
0
        private CustomerAndCard GetCusAndCardModel(ClubCardVO recard, CustomerVO recust)
        {
            if (recard != null && recust != null)
            {
                CustomerAndCard cuandcard = new CustomerAndCard()
                {
                    CustID        = recust.CustomerID,
                    CustName      = recust.Name,
                    ICNo          = recust.ICNo,
                    MobileNo      = recust.MobileNO,
                    Birthday      = recust.Birthday,
                    CardID        = recard.ClubCardID,
                    CardNo        = recard.ClubCardNo,
                    CardType      = recard.ClubCardTypeID,
                    CardStatu     = recard.CardStatus,
                    OpenCardStore = recard.OpenCardStore,
                    SaleMan       = recard.SalesMan,
                    SaleTime      = recard.SalesTime,
                    ExpireDate    = recard.ExpireDate
                };
                cuandcard.CardTypeName = recard.ClubCardTypeName;
                switch (recard.CardStatus)
                {
                case (int)ClubCardStatus.OpenCard: cuandcard.CardStatuName = "开卡";
                    break;

                case (int)ClubCardStatus.Expire: cuandcard.CardStatuName = "过期";
                    break;

                case (int)ClubCardStatus.Froze: cuandcard.CardStatuName = "冻结";
                    break;

                case (int)ClubCardStatus.LogOff: cuandcard.CardStatuName = "注销";
                    break;

                case (int)ClubCardStatus.ReportLoss: cuandcard.CardStatuName = "挂失";
                    break;
                }
                return(cuandcard);
            }
            return(new CustomerAndCard());
        }
示例#7
0
        //
        // GET: /ClubcardConsume/
        public ActionResult Index()
        {
            ViewData["ConItem"] = GetddlList(DDLlist.PkgItem, false, null, null, null);
            //ViewData["CardPkgItem"]=GetddlList(DDLlist.CardPkg,null,null,null,)
            int id = NullHelper.Convert <int>(Request["id"], 0);

            ViewBag.StoreName = Emp.StroeName;
            ViewBag.Recivor   = Emp.UserName;
            CustomerAndCard cuscard = new CustomerAndCard();

            if (id > 0)
            {
                IClubCardMgm cardMgm = new ClubCardMgm();
                ClubCardVO   card    = cardMgm.GetClubCardByID(id);
                ICustomerMgm custMgm = new CustomerMgm();
                CustomerVO   cust    = custMgm.GetCustomerByID(card.CustomerID);
                cuscard = GetCusAndCardModel(card, cust);
            }
            return(View(cuscard));
        }
示例#8
0
 private CustomerAndCard GetCusAndCardModel(ClubCardVO recard, CustomerVO recust)
 {
     if (recard != null && recust != null)
     {
         CustomerAndCard cuandcard = new CustomerAndCard()
         {
             CustID        = recust.CustomerID,
             CustName      = recust.Name,
             ICNo          = recust.ICNo,
             MobileNo      = recust.MobileNO,
             Birthday      = recust.Birthday,
             CardID        = recard.ClubCardID,
             CardNo        = recard.ClubCardNo,
             CardType      = recard.ClubCardTypeID,
             CardStatu     = recard.CardStatus,
             OpenCardStore = recard.OpenCardStore,
             SaleMan       = recard.SalesMan,
             SaleTime      = recard.SalesTime,
             ExpireDate    = recard.ExpireDate
         };
         return(cuandcard);
     }
     return(new CustomerAndCard());
 }