/// <summary> /// 添加客户信息 /// </summary> /// <param name="entity"></param> /// <param name="list"></param> /// <returns></returns> public int AddCustomer(CustomerEntity entity, List<CusAddressEntity> list) { entity.IncludeAll(); int line = this.Customer.Add(entity); if (!list.IsNullOrEmpty()) { list.ForEach(a => { a.CusNum = entity.CusNum; a.IncludeAll(); }); line += this.CusAddress.Add(list); } if (line > 0) { CacheHelper.Remove(CacheKey.JOOSHOW_CUSADDRESS_CACHE); } return line; }
/// <summary> /// 查询所有的客户数据信息 /// </summary> /// <returns></returns> public List<CustomerEntity> GetList() { CustomerEntity entity = new CustomerEntity(); entity.IncludeAll(); entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete); List<CustomerEntity> listResult = this.Customer.GetList(); return listResult; }
/// <summary> /// 根据客户编号获得客户信息 /// </summary> /// <param name="cusNum"></param> /// <returns></returns> public CustomerEntity GetSingleCustomer(string cusNum) { CustomerEntity entity = new CustomerEntity(); entity.IncludeAll(); entity.Where(a => a.CusNum == cusNum); entity = this.Customer.GetSingle(entity); return entity; }
/// <summary> /// 分页查询客户信息 /// </summary> /// <param name="entity"></param> /// <param name="pageInfo"></param> /// <returns></returns> public List<CustomerEntity> GetCustomerList(CustomerEntity entity, ref PageInfo pageInfo) { entity.IncludeAll(); entity.OrderBy(a => a.ID, EOrderBy.DESC); entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete); int rowCount = 0; List<CustomerEntity> listResult = this.Customer.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount); pageInfo.RowCount = rowCount; return listResult; }