Beispiel #1
0
        public string GetAutoCompleteVendor(string inputName)
        {
            StringBuilder ret        = new StringBuilder();
            string        InputValue = CXmlPara.CreatePara(new CPara[] {
                new CPara("PageIndex", "1"),
                new CPara("RowsPerPage", "100"),
                new CPara("Name", inputName),
            }, "");

            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);
            ret.Append("[");
            foreach (var item in venList)
            {
                ret.Append("{");
                ret.AppendFormat("'id':'{0}',", item.ID);
                ret.AppendFormat("'text':'{0}',", item.Name);
                ret.AppendFormat("'value':'{0}'", item.ID);
                ret.Append("}");
                if (item != venList[venList.Length - 1])
                {
                    ret.Append(",");
                }
            }
            ret.Append("]");

            return(ret.ToString());
        }
Beispiel #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());
        }
Beispiel #3
0
        public string GetObjectName(string exAttribute, string inputType)
        {
            string ret        = "";
            string InputValue = CXmlPara.CreatePara(new CPara[] { }, exAttribute);

            switch (inputType)
            {
            case "1":
                ServiceREF.CustomerService.CustomerService cus_service = new ServiceREF.CustomerService.CustomerService();
                ServiceREF.CustomerService.CCustomer       cus         = cus_service.GetCustomer(InputValue);
                ret = CJson.SerializeObject(cus);
                break;

            case "2":
                ServiceREF.VendorService.VendorService ven_service = new ServiceREF.VendorService.VendorService();
                ServiceREF.VendorService.CVendor       ven         = ven_service.GetVendor(InputValue);
                ret = CJson.SerializeObject(ven);
                break;

            case "3":
                ServiceREF.GeneralLedgerService.CEmployee emp = gl_service.GetEmployee(InputValue);
                ret = CJson.SerializeObject(emp);
                break;
            }
            return(ret);
        }
Beispiel #4
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());
        }
Beispiel #5
0
 public CGroupBase()
 {
     customerService  = new ServiceREF.CustomerService.CustomerService();
     inventoryService = new ServiceREF.InventoryService.InventoryService();
     vendorService    = new ServiceREF.VendorService.VendorService();
 }