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("{}"); }
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()); }
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()); }
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()); }