Пример #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;
        }
Пример #2
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;
 }
Пример #3
0
 public CustomerVO GetCustomerByCarNo(string carno)
 {
     CustomerData custdata = new CustomerData();
     CustomerPO result = custdata.GetCustomerByCarNo(carno);
     if (result != null)
     {
         return Mapper.Map<CustomerPO, CustomerVO>(result);
     }
     else
     {
         return new CustomerVO();
     }
 }
Пример #4
0
        public List<CustomerVO> GetCustomers(CustomerQueryEntity filter)
        {
            CustomerData customerData = new CustomerData();
            List<CustomerVO> customerVOList = new List<CustomerVO>();

            DataSet ds = customerData.GetCustomers(filter);
            List<CustomerPO> customerPOList = ds.GetEntity<List<CustomerPO>>();

            customerPOList.ForEach(i =>
            {
                customerVOList.Add(Mapper.Map<CustomerPO, CustomerVO>(i));
            });

            return customerVOList;
        }
Пример #5
0
        public bool CheckPhoneNo(string phoneNo)
        {
            CustomerData customerData = new CustomerData();

            StringBuilder strSql = new StringBuilder();
            string strWhere = "";
            if (!string.IsNullOrEmpty(phoneNo.Trim()))
            {
                strSql.AppendFormat(" MobileNO = '{0}' ", phoneNo);
            }

            strWhere = strSql.ToString();
            int cnt = customerData.GetRecordCount(strWhere);

            if (cnt > 0)
                return true;
            else
                return false;
        }
Пример #6
0
 public bool EditCustomer(Model.VO.CustomerVO cust, Model.VO.CarVO car)
 {
     CustomerData customerData = new CustomerData();
     return customerData.EditCustomer(Mapper.Map<CustomerVO, CustomerPO>(cust), Mapper.Map<CarVO, CarPO>(car));
 }
Пример #7
0
 public void EditCustomer(Model.VO.CustomerVO cust)
 {
     CustomerData customerData = new CustomerData();
     customerData.EditCustomer(Mapper.Map<CustomerVO, CustomerPO>(cust));
 }
Пример #8
0
 public void DelCustomer(int id)
 {
     CustomerData customerData = new CustomerData();
     customerData.DelCustomer(id);
 }
Пример #9
0
 public int GetRecordCount(CustomerQueryEntity filter)
 {
     CustomerData custdata = new CustomerData();
     return custdata.GetRecordCount(filter);
 }