Ejemplo n.º 1
0
        public void GetPurchaseParentByMultiFilterTest()
        {
            CommodityImpl target = new CommodityImpl(); // TODO: 初始化为适当的值
            POSearchTerm filter = new POSearchTerm(); // TODO: 初始化为适当的值
            filter.ComdID = "Comd_ID_00003";
            filter.ComdName = "雷";
            filter.PurchaseEmpName = "杨";
            filter.Supplier = "大连";
            filter.PurchaseDateStart = DateTime.Parse("2010-11-01");
            filter.PurchaseDateEnd = DateTime.Parse("2010-11-10");
            filter.StatusKBN = 2;
            filter.PaymentFLG = 0;
            filter.ReceivingFLG = 1;

            List<PurchaseParent> actual;
            actual = target.POGetParentByMultiFilter(filter);
            Assert.AreEqual(1, actual.Count);
        }
Ejemplo n.º 2
0
 public void SetSearchContentToInit()
 {
     searchTerm = new POSearchTerm();
     SetSearchContent(searchTerm);
 }
Ejemplo n.º 3
0
 private void SetSearchContent(POSearchTerm term)
 {
     form.sTxtSupplier.Text = searchTerm.Supplier;
     form.sTxtPurEmp.Text = searchTerm.PurchaseEmpName;
     form.sDtPurDateStart.Value = searchTerm.PurchaseDateStart;
     form.sDtPurDateEnd.Value = searchTerm.PurchaseDateEnd;
     form.sCmbPurStatus.SelectedIndex = -1;
     foreach (object obj in form.sCmbPurStatus.Items)
     {
         if ((obj as ExtItem).Tag.Equals(searchTerm.StatusKBN))
         {
             form.sCmbPurStatus.SelectedItem = obj;
             break;
         }
     }
     form.sCmbRecStatus.SelectedIndex = -1;
     foreach (object obj in form.sCmbRecStatus.Items)
     {
         if ((obj as ExtItem).Tag.Equals(searchTerm.ReceivingFLG))
         {
             form.sCmbRecStatus.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.sTxtCommId.Text = searchTerm.ComdID;
 }
Ejemplo n.º 4
0
        public List<PurchaseParent> POGetParentByMultiFilter(POSearchTerm filter)
        {
            List<PurchaseParent> purchaseParentList;

            UtilService utilService = new UtilService();

            Hashtable hashTable = new Hashtable();

            if (!(filter.Supplier == null || filter.Supplier.Equals("")))
            {
                hashTable.Add("@SupplierID", utilService.buildWildSearchFilter(filter.Supplier));
            }

            if (!(filter.PurchaseEmpName == null || filter.PurchaseEmpName.Equals("")))
            {
                hashTable.Add("@EmpName", utilService.buildWildSearchFilter(filter.PurchaseEmpName));
            }

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

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

            if (!(filter.ComdName == null || filter.ComdName.Equals("")))
            {
                hashTable.Add("@ComdName", utilService.buildWildSearchFilter(filter.ComdName));
            }

            if (!(filter.ComdID == null || filter.ComdID.Equals("")))
            {
                hashTable.Add("@ComdID", filter.ComdID);
            }

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

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

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

            try
            {
                purchaseParentList = comdDAO.SearchPurchaseParentByMultiFilter(hashTable);
            }
            catch (Exception ex)
            {
                throw;
            }
            return purchaseParentList;
        }