Exemple #1
0
        public List<Customer> getCusByMultiFilter(CusSearchTerm filter)
        {
            List<Customer> cusList;
            UtilService utilService = new UtilService();

            Hashtable hashTable = new Hashtable();
            if (!(filter.CustomerName == null || filter.CustomerName.Equals("")))
            {
                hashTable.Add("@CusName", utilService.buildWildSearchFilter(filter.CustomerName));
            }
            if (!(filter.CompanyName == null || filter.CompanyName.Equals("")))
            {
                hashTable.Add("@CusCompName", utilService.buildWildSearchFilter(filter.CompanyName));
            }
            if (!(filter.TelNum == null || filter.TelNum.Equals("")))
            {
                hashTable.Add("@TelNum", utilService.buildWildSearchFilter(filter.TelNum));
            }
            if (!(filter.CusTypeID == null || filter.CusTypeID.Equals("")))
            {
                hashTable.Add("@CusTypeID", filter.CusTypeID);
            }

            try
            {
                cusList = cusDAO.searchCusByMultiFilter(hashTable);
            }
            catch (Exception ex)
            {
                cusList = null;
            }
            return cusList;
        }
 public ReRebateTypeCustomerTree(TreeView tv, ICustomer icustomer, CusSearchTerm searchTerm)
     : base(tv, icustomer, searchTerm)
 {
 }
 public CustomerTree(TreeView tv, ICustomer icustomer, CusSearchTerm searchTerm)
     : base(tv)
 {
     this.icustomer = icustomer;
     this.searchTerm = searchTerm;
 }
 public CusNolyTree(TreeView tv, ICustomer icustomer, CusSearchTerm searchTerm)
     : base(tv, icustomer, searchTerm)
 {
 }
        public void getCusByMultiFilterTest()
        {
            CustomerImpl target = new CustomerImpl(); // TODO: 初始化为适当的值
            CusSearchTerm filter = new CusSearchTerm(); // TODO: 初始化为适当的值
            List<Customer> actual;

            filter.CompanyName = "市";
            actual = target.getCusByMultiFilter(filter);
            Assert.AreEqual(2, actual.Count);

            filter = new CusSearchTerm();
            filter.CompanyName = "市";
            filter.CustomerName = "C";
            actual = target.getCusByMultiFilter(filter);
            Assert.AreEqual(1, actual.Count);

            filter = new CusSearchTerm();
            filter.CompanyName = "市";
            filter.CustomerName = "业务员";
            filter.TelNum = "444";
            actual = target.getCusByMultiFilter(filter);
            Assert.AreEqual(1, actual.Count);
        }
Exemple #6
0
 private void SetSearchContent(CusSearchTerm term)
 {
     form.sTxtName.Text = term.CustomerName;
     form.sTxtCompName.Text = term.CompanyName;
     form.sTxtTelNum.Text = term.TelNum;
 }
Exemple #7
0
 public void SetSearchContentToInit()
 {
     searchTerm = new CusSearchTerm();
     SetSearchContent(searchTerm);
 }
Exemple #8
0
        private void ResetCmbCus()
        {
            cmbCus.Items.Clear();
            if (null == cmbCusType.SelectedItem)
            {
                return;
            }

            // 顾客列表
            CusSearchTerm cusSearchTerm = new CusSearchTerm();
            cusSearchTerm.CusTypeID = (cmbCusType.SelectedItem as ExtItem).Tag.ToString();
            List<Customer> cusList = icustomer.getCusByMultiFilter(cusSearchTerm);
            foreach (Customer cus in cusList)
            {
                ExtItem item;

                if (cus.CompanyName != string.Empty)
                {
                    item = new ExtItem(cus.CompanyName, cus.CustomId);
                }
                else
                {
                    item = new ExtItem(cus.Name, cus.CustomId);
                }
                cmbCus.Items.Add(item);
            }
        }