예제 #1
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);
        }
예제 #2
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);
 }
예제 #3
0
        public JsonResult SearchCustomerAndCard()
        {
            string mobileno = NullHelper.Convert<string>(Request["MobileNo"], "");
            string cardNo = NullHelper.Convert<string>(Request["CardNo"], "");
            ReturnedData data = new ReturnedData();
            if(!string.IsNullOrEmpty(mobileno)||!string.IsNullOrEmpty(cardNo))
            {
                ICustomerMgm custMgm = new CustomerMgm();
                IClubCardMgm cardMgm = new ClubCardMgm();
                //有缺陷
                if(!string.IsNullOrEmpty(mobileno))
                {
                    CustomerVO cust = custMgm.GetCustomerByMobileNo(mobileno);
                    if(cust!=null)
                    {
                        ClubCardVO card = cardMgm.GetClubCardByCustID(cust.CustomerID);
                        data.Data = GetCusAndCardModel(card, cust);
                        data.Success = true;
                    }
                    else
                    {
                        data.Success = false;
                        data.Message = "当前手机号无用户";
                    }

                }
                else if(!string.IsNullOrEmpty(cardNo))
                {
                    ClubCardVO card = cardMgm.GetClubCardByCardNo(cardNo);
                    if(card!=null)
                    {
                        CustomerVO cust = custMgm.GetCustomerByID(card.CustomerID);
                        data.Data = GetCusAndCardModel(card, cust);
                        data.Success = true;
                    }
                    else
                    {
                        data.Success = false;
                        data.Message = "当前会员卡号无用户";
                    }
                }
            }
            else
            {
                data.Success = false;
                data.Message = "请输入会员卡号或用户手机号码";
            }
            return Json(data,JsonRequestBehavior.AllowGet);
        }
예제 #4
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);
 }
예제 #5
0
        /// <summary>
        /// 客户详细信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult CustomerDetails(int id)
        {
            var result = new CustomerAndCar();
            if (id != -1)
            {
                ICustomerMgm couMgm = new CustomerMgm();
                ICarMgm carMgm = new CarMgm();
                CustomerVO customer = couMgm.GetCustomerByID(id);
                List<CarVO> car = new List<CarVO>();
                if (customer != null)
                {
                    car = carMgm.GetCarsByCustID(customer.CustomerID);
                    result = GetcusAndcarObj(customer, car.FirstOrDefault());
                }

            }

            return View(result);
        }
예제 #6
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;
        }