Example #1
0
        public Model.VO.CustomerVO GetCustomerByID(int custID)
        {
            CustomerData customerData = new CustomerData();
            CustomerVO customerVO = new CustomerVO();
            CustomerPO customerPO = customerData.GetCustomerByID(custID);
            customerVO = Mapper.Map<CustomerPO, CustomerVO>(customerPO);

            return customerVO;
        }
Example #2
0
        /// <summary>
        /// 添加客户提交
        /// </summary>
        /// <param name="cusandcar"></param>
        /// <returns></returns>
        public JsonResult AddCustomerSub(CustomerAndCar cusandcar)
        {
            ICustomerMgm customerMgm = new CustomerMgm();
            ICarMgm carMgm = new CarMgm();
            CustomerVO customer = new CustomerVO()
            {

                Name = cusandcar.Name,
                Sex = cusandcar.Sex,
                ICNo = cusandcar.ICNo,
                Birthday = cusandcar.Birthday,
                MobileNO = cusandcar.MobileNo,
                CreatorID = Emp.UserName,
                LastModifierID = Emp.UserName,
                CreatedDate = DateTime.Now,
                LastModifiedDate = DateTime.Now,
            };

            CarVO car = new CarVO()
            {

                CarNo = cusandcar.Carno,
                Brand = cusandcar.Brand,
                CarModel = cusandcar.Carmodel,
                Capacity = cusandcar.Capacity,
                Color = cusandcar.Color,
                FrameNo = cusandcar.FrameNo,
                EngineNo = cusandcar.EngineNo,
                MaintainKM = cusandcar.Maintainkm,
                InsureDate = cusandcar.Insuredate,
                ASDate = cusandcar.Asdate,
                CreatorID = Emp.UserName,
                LastModifierID = Emp.UserName,
                CreatedDate = DateTime.Now,
                LastModifiedDate = DateTime.Now,

            };

            ReturnedData data = new ReturnedData();
            try
            {
                car.CustomerID = customerMgm.AddAllCustomer(customer, car);
                //carMgm.AddCar(car);
                data.Message = "客户添加成功";
                data.Success = true;
            }
            catch (Exception ex)
            {
                data.Success = false;
                data.Message = "客户添加失败";
                data.Error = ex.ToString();

            }

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Example #3
0
 public int AddAllCustomer(CustomerVO cust, CarVO car)
 {
     CustomerData customerData = new CustomerData();
     var result = customerData.AddAllCustomer(Mapper.Map<CustomerVO, CustomerPO>(cust), Mapper.Map<CarVO, CarPO>(car));
     if (result <= 0)
     {
         throw new Exception("添加出现错误");
     }
     return result;
 }
Example #4
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();
 }
Example #5
0
 public void AddCustomer(CustomerVO cust)
 {
     throw new NotImplementedException();
 }
Example #6
0
        public List<CustomerVO> GetCustomers(CustomerQueryEntity filter)
        {
            List<CustomerVO> result = new List<CustomerVO>();

            #region Mock
            CustomerVO item1 = new CustomerVO(){
                CardFlag = 1,
                CustomerID = 1,
                MobileNO = "15852659874",
                Name = "田志良"
            };
            CustomerVO item2 = new CustomerVO()
            {
                CardFlag = 0,
                CustomerID = 2,
                MobileNO = "12687458596",
                Name = "郭艳艳"
            };
            CustomerVO item3 = new CustomerVO()
            {
                CardFlag = 1,
                CustomerID = 3,
                MobileNO = "16358748965",
                Name = "程彩琪"
            };
            CustomerVO item4 = new CustomerVO()
            {
                CardFlag = 0,
                CustomerID = 4,
                MobileNO = "15234951965",
                Name = "任东东"
            };
            CustomerVO item5 = new CustomerVO()
            {
                CardFlag = 1,
                CustomerID = 5,
                MobileNO = "12365847596",
                Name = "刘勇"
            };
            result.Add(item1);
            result.Add(item2);
            result.Add(item3);
            result.Add(item4);
            result.Add(item5);
            #endregion

            return result;
        }
Example #7
0
 private List<ConsumeVO> GetConsumeList(List<ComsumeItemViewModel> list,CustomerVO cust, ConsumeType conType,PayType paytype)
 {
     List<ConsumeVO> conList = new List<ConsumeVO>();
     DateTime date = DateTime.Now;
     list.ForEach(item =>
     {
         conList.Add(new ConsumeVO
         {
             ItemID = item.Itemid,
             ItemName = item.ItemName,
             ConsumeStore = Emp.StroeName,
             ConsumeCount = item.ItemConNum,
             OriginalPrice = item.ItemTotalPrice,
             CreatedDate = date,
             CreatorID = Emp.UserName,
             LastModifiedDate = date,
             LastModifierID = Emp.UserName,
             ConsumeDate = date,
             ConsumeType = (int)conType,
             ClubCardPackageID = "",
             PackageDetailID = 0,
             ClubCardNo = "",
             ClubCardID = 0,
             CustID = cust.CustomerID,
             CustName = cust.Name,
             OriginalStore = "",
             RemainCount = 0,
             Reserved1 = Emp.StoreId.ToString(),
             Reserved2=paytype.ToString()
         });
     });
     return conList;
 }
Example #8
0
 /// <summary>
 /// 模型转换
 /// </summary>
 /// <param name="customer"></param>
 /// <param name="car"></param>
 /// <returns></returns>
 private CustomerAndCar GetcusAndcarObj(CustomerVO customer, CarVO car)
 {
     CustomerAndCar cusandcar = new CustomerAndCar();
     cusandcar.Customerid = customer.CustomerID;
     cusandcar.Name = customer.Name;
     cusandcar.Sex = customer.Sex;
     cusandcar.ICNo = customer.ICNo;
     cusandcar.Birthday = customer.Birthday;
     cusandcar.Carno = car.CarNo;
     cusandcar.Brand = car.Brand;
     cusandcar.Carmodel = car.CarModel;
     cusandcar.Capacity = car.Capacity;
     cusandcar.Color = car.Color;
     cusandcar.FrameNo = car.FrameNo;
     cusandcar.EngineNo = car.EngineNo;
     cusandcar.Maintainkm = car.MaintainKM;
     cusandcar.Insuredate = car.InsureDate;
     cusandcar.Asdate = car.ASDate;
     cusandcar.MobileNo = customer.MobileNO;
     cusandcar.Carid = car.CarID;
     return cusandcar;
 }
Example #9
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();
 }
Example #10
0
 void ICustomerMgm.EditCustomer(CustomerVO cust)
 {
     throw new NotImplementedException();
 }
Example #11
0
 public int AddAllCustomer(CustomerVO customer, CarVO car)
 {
     throw new NotImplementedException();
 }
Example #12
0
 public bool EditCustomer(CustomerVO cust, CarVO car)
 {
     throw new NotImplementedException();
 }
Example #13
0
        public void TestMethod4()
        {
            //add customer
            CustomerVO customerVO = new CustomerVO();
            customerVO.Birthday = "19860907";
            customerVO.CardFlag = 1;
            customerVO.Company = "phillip";

            customerVO.CreatedDate = DateTime.Now;
            customerVO.CreatorID = "001";
            customerVO.LastModifiedDate = DateTime.Now;
            customerVO.LastModifierID = "002";
            customerVO.LogicalStatus = 1;
            customerVO.ICNo = "32092319860907331x";
            customerVO.MobileNO = "18516251396";
            customerVO.Name = "zhuqingsong";
            customerVO.Sex = "M";
            customerVO.Weixin = "chadzhu";

            //VO to PO
            Mapper.CreateMap<CustomerVO, CustomerPO>();

            CustomerMgm customerMgm = new CustomerMgm();
            customerMgm.AddCustomer(customerVO);
        }