Пример #1
0
        public string GetGrid(int gridID, string instant, int currPage, int NumberRowOfPage, string exAttribute)
        {
            string InputValue = CXmlPara.CreatePara(new CPara[] {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("NumberRowOfPage", NumberRowOfPage.ToString())
            },
                                                    exAttribute
                                                    );

            switch (instant)
            {
            case "Customer":
                ServiceREF.CustomerService.COutputValue     coutputValue = new ServiceREF.CustomerService.COutputValue();
                ServiceREF.CustomerService.CCustomerGroup[] clist        = customerService.GetCustomerGroupList(InputValue, ref coutputValue);
                return(CGrid.ToJsonForHandle <ServiceREF.CustomerService.CCustomerGroup>(0, gridID, clist, currPage, coutputValue.TotalPage, coutputValue.TotalRow));

            case "Product":
                ServiceREF.InventoryService.COutputValue poutputValue = new ServiceREF.InventoryService.COutputValue();
                ServiceREF.InventoryService.CItemGroup[] plist        = inventoryService.GetInventoryItemGroupList(InputValue, ref poutputValue);
                return(CGrid.ToJsonForHandle <ServiceREF.InventoryService.CItemGroup>(0, gridID, plist, currPage, poutputValue.TotalPage, poutputValue.TotalRow));

            case "Vendor":
                ServiceREF.VendorService.COutputValue   vpageinfo = new ServiceREF.VendorService.COutputValue();
                ServiceREF.VendorService.CVendorGroup[] vlist     = vendorService.GetVendorGroupList(InputValue, ref vpageinfo);
                return(CGrid.ToJsonForHandle <ServiceREF.VendorService.CVendorGroup>(0, gridID, vlist, currPage, vpageinfo.TotalPage, vpageinfo.TotalRow));
            }
            return("{}");
        }
Пример #2
0
        public string GetCusAutoComplete(int currPage, int NumberRowOfPage, string inputName, string inputType)
        {
            string        _template  = "{0}|{1}|{2}|{3}\n";
            StringBuilder result     = new StringBuilder();
            string        InputValue = CXmlPara.CreatePara(new CPara[] { }, inputName);

            switch (inputType)
            {
            case "1":
                ServiceREF.CustomerService.CustomerService cus_service = new ServiceREF.CustomerService.CustomerService();
                ServiceREF.CustomerService.COutputValue    cus_output  = new ServiceREF.CustomerService.COutputValue();
                ServiceREF.CustomerService.CCustomer[]     cusList     = cus_service.GetCustomerList(InputValue, ref cus_output);
                foreach (var item in cusList)
                {
                    result.AppendFormat(_template, item.ID, item.Code, item.Name, item.Address);
                }
                break;

            case "2":
                ServiceREF.VendorService.VendorService ven_service = new ServiceREF.VendorService.VendorService();
                ServiceREF.VendorService.COutputValue  ven_output  = new ServiceREF.VendorService.COutputValue();
                ServiceREF.VendorService.CVendor[]     venList     = ven_service.GetVendorList(InputValue, ref ven_output);
                foreach (var item in venList)
                {
                    result.AppendFormat(_template, item.ID, item.Code, item.Name, item.Address);
                }
                break;
            }
            return(result.ToString());
        }
Пример #3
0
        public string GetDataAutoComplete(int currPage, int NumberRowOfPage, string inputName, string inputType)
        {
            string        _template  = "{0}|{1}|{2}\n";
            StringBuilder result     = new StringBuilder();
            string        InputValue = CXmlPara.CreatePara(new CPara[] {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("RowsPerPage", NumberRowOfPage.ToString()),
                new CPara("Name", inputName),
            }, "");

            switch (inputType)
            {
            case "1":
                ServiceREF.CustomerService.CustomerService cus_service = new ServiceREF.CustomerService.CustomerService();
                ServiceREF.CustomerService.COutputValue    cus_output  = new ServiceREF.CustomerService.COutputValue();
                ServiceREF.CustomerService.CCustomer[]     cusList     = cus_service.GetCustomerList(InputValue, ref cus_output);
                foreach (var item in cusList)
                {
                    result.AppendFormat(_template, item.ID, item.Code, item.Name);
                }
                break;

            case "2":
                ServiceREF.VendorService.VendorService ven_service = new ServiceREF.VendorService.VendorService();
                ServiceREF.VendorService.COutputValue  ven_output  = new ServiceREF.VendorService.COutputValue();
                ServiceREF.VendorService.CVendor[]     venList     = ven_service.GetVendorList(InputValue, ref ven_output);
                foreach (var item in venList)
                {
                    result.AppendFormat(_template, item.ID, item.Code, item.Name);
                }
                break;

            case "3":
                ServiceREF.GeneralLedgerService.COutputValue gl_output = new ServiceREF.GeneralLedgerService.COutputValue();
                ServiceREF.GeneralLedgerService.CEmployee[]  empList   = gl_service.GetEmployeeList(InputValue, ref gl_output);
                foreach (var item in empList)
                {
                    result.AppendFormat(_template, item.ID, item.Code, item.Name);
                }
                break;
            }
            return(result.ToString());
        }