예제 #1
0
        public void GetSaleParentByMultiFilterTest()
        {
            CommodityImpl target = new CommodityImpl(); // TODO: Initialize to an appropriate value
            SOSearchTerm filter = new SOSearchTerm(); // TODO: Initialize to an appropriate value

            //filter.OrderId = "SO_ID_20101123_00001";
            //filter.SaleEmpID = "EMP_ID_003";
            //filter.SaleEmpName = "卷";
            //filter.CustomerID = "CUS_ID_000009";
            //filter.CustomerName = "团";
            //filter.ComdID = "Comd_ID_00005";
            //filter.ComdName = "无线";
            filter.SaleDateStart = DateTime.Parse("2010-11-01");
            //filter.SaleDateEnd = DateTime.Parse("2010-12-31");
            //filter.StatusKBN = 1;
            //filter.DeliveryFLG = 1;
            //filter.PaymentFLG = 0;

            List<SaleParent> actual;
            actual = target.SOGetParentByMultiFilter(filter);
            Assert.AreEqual(1, actual.Count);
        }
예제 #2
0
 public void SetSearchContentToInit()
 {
     searchTerm = new SOSearchTerm();
     SetSearchContent(searchTerm);
 }
예제 #3
0
 private void SetSearchContent(SOSearchTerm term)
 {
     form.sTxtCustomer.Text = searchTerm.CustomerName;
     form.sTxtSaleEmp.Text = searchTerm.SaleEmpName;
     form.sDtSaleDateStart.Value = searchTerm.SaleDateStart;
     form.sDtSaleDateEnd.Value = searchTerm.SaleDateEnd;
     form.sCmbOrderStatus.SelectedIndex = -1;
     foreach (object obj in form.sCmbOrderStatus.Items)
     {
         if ((obj as ExtItem).Tag.Equals(searchTerm.StatusKBN))
         {
             form.sCmbOrderStatus.SelectedItem = obj;
             break;
         }
     }
     form.sCmbDeliveryStatus.SelectedIndex = -1;
     foreach (object obj in form.sCmbDeliveryStatus.Items)
     {
         if ((obj as ExtItem).Tag.Equals(searchTerm.DeliveryFLG))
         {
             form.sCmbDeliveryStatus.SelectedItem = obj;
             break;
         }
     }
     form.sCmbPayStatus.SelectedIndex = -1;
     foreach (object obj in form.sCmbPayStatus.Items)
     {
         if ((obj as ExtItem).Tag.Equals(searchTerm.PaymentFLG))
         {
             form.sCmbPayStatus.SelectedItem = obj;
             break;
         }
     }
     form.sCmbCommoName.SelectedIndex = -1;
     foreach (object obj in form.sCmbCommoName.Items)
     {
         if ((obj as ExtItem).Tag.Equals(searchTerm.ComdName))
         {
             form.sCmbCommoName.SelectedItem = obj;
             break;
         }
     }
     form.sCmbStandard.SelectedIndex = -1;
     foreach (object obj in form.sCmbStandard.Items)
     {
         if ((obj as ExtItem).Tag.Equals(searchTerm.ComdID))
         {
             form.sCmbStandard.SelectedItem = obj;
             break;
         }
     }
     //form.sTxtCommId.Text = searchTerm.ComdID;
 }
예제 #4
0
        public List<SaleParent> SOGetParentByMultiFilter(SOSearchTerm filter)
        {
            List<SaleParent> saleParentList;

            UtilService utilService = new UtilService();

            Hashtable hashTable = new Hashtable();

            //orderid
            if (!(filter.OrderId == null || filter.OrderId.Equals("")))
            {
                hashTable.Add("@SaleOrderID", filter.OrderId);
            }
            //customer
            if (!(filter.CustomerID == null || filter.CustomerID.Equals("")))
            {
                hashTable.Add("@CustomerID", filter.CustomerID);
            }
            if (!(filter.CustomerName == null || filter.CustomerName.Equals("")))
            {
                hashTable.Add("@CustomerName", utilService.buildWildSearchFilter(filter.CustomerName));
            }
            //saleman
            if (!(filter.SaleEmpID == null || filter.SaleEmpID.Equals("")))
            {
                hashTable.Add("@SaleEmpID", filter.SaleEmpID);
            }
            if (!(filter.SaleEmpName == null || filter.SaleEmpName.Equals("")))
            {
                hashTable.Add("@SaleEmpName", utilService.buildWildSearchFilter(filter.SaleEmpName));
            }
            //commodity
            if (!(filter.ComdID == null || filter.ComdID.Equals("")))
            {
                hashTable.Add("@ComdID", filter.ComdID);
            }
            if (!(filter.ComdName == null || filter.ComdName.Equals("")))
            {
                hashTable.Add("@ComdName", utilService.buildWildSearchFilter(filter.ComdName));
            }

            //SaleDate
            if (filter.SaleDateStart != DateTime.MinValue)
            {
                hashTable.Add("@SaleDateStart", filter.SaleDateStart.ToString("yyyy-MM-dd"));
            }
            if (filter.SaleDateEnd != DateTime.MinValue)
            {
                hashTable.Add("@SaleDateEnd", filter.SaleDateEnd.ToString("yyyy-MM-dd"));
            }

            //KBN AND FLG
            if (filter.StatusKBN >= 0)
            {
                hashTable.Add("@StatusKBN", filter.StatusKBN);
            }

            if (filter.DeliveryFLG == 0)
            {
                hashTable.Add("@DeliveryFLG", false);
            }
            else if (filter.DeliveryFLG == 1)
            {
                hashTable.Add("@DeliveryFLG", true);
            }

            if (filter.PaymentFLG == 0)
            {
                hashTable.Add("@PaymentFLG", false);
            }
            else if (filter.PaymentFLG == 1)
            {
                hashTable.Add("@PaymentFLG", true);
            }

            try
            {
                saleParentList = comdDAO.SearchSaleParentByMultiFilter(hashTable);
            }
            catch (Exception ex)
            {
                throw;
            }
            return saleParentList;
        }