Example #1
0
        public string GetProductAutoComplete(int currPage, int NumberRowOfPage, string funcPara)
        {
            StringBuilder ret        = new StringBuilder();
            string        InputValue = CXmlPara.CreatePara(new CPara[]
            {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("RowsPerPage", NumberRowOfPage.ToString()),
            },
                                                           funcPara
                                                           );

            ServiceREF.InventoryService.COutputValue pageinfo = new ServiceREF.InventoryService.COutputValue();
            ServiceREF.InventoryService.CItems[]     list     = iv_service.GetInventoryItemsList(InputValue, ref pageinfo);
            if (list != null && list.Length > 0)
            {
                foreach (var item in list)
                {
                    ret.AppendFormat("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}\n", item.Code, item.Name, item.ID, item.UnitName, item.CreditAccountName, item.DebitAccountName, item.SalePrice, item.UnitID, item.CreditAccount, item.DebitAccount);
                }
            }
            string result = string.Empty;

            if (ret.Length > 0)
            {
                result = ret.ToString(0, ret.Length - 1);
            }
            return(result);
        }
Example #2
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("{}");
        }
Example #3
0
        public string GetStockAutoComplete(string funcPara)
        {
            StringBuilder ret        = new StringBuilder();
            string        InputValue = CXmlPara.CreatePara(funcPara);

            ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue();
            ServiceREF.InventoryService.CStock[]     list        = iv_service.GetInventoryStockList(InputValue, ref outputValue);
            if (list != null && list.Length > 0)
            {
                foreach (var item in list)
                {
                    ret.AppendFormat("{0}|{1}|{2}\n", item.Code, item.Name, item.ID);
                }
            }
            string result = string.Empty;

            if (ret.Length > 0)
            {
                result = ret.ToString(0, ret.Length - 1);
            }
            return(result);
        }
Example #4
0
        public string GetTaxList(string funcPara)
        {
            StringBuilder ret        = new StringBuilder();
            string        inputValue = CXmlPara.CreatePara(funcPara);

            ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue();
            ServiceREF.InventoryService.CTax[]       lst         = iv_service.GetInventoryTaxList(inputValue, ref outputValue);
            ret.Append("[");
            foreach (ServiceREF.InventoryService.CTax cp in lst)
            {
                ret.Append("{");
                ret.AppendFormat("'id':'{0}',", cp.ID);
                ret.AppendFormat("'text':'{0}',", cp.Name);
                ret.AppendFormat("'value':'{0}',", cp.Percent);
                ret.AppendFormat("'id_value':'{0}'", cp.ID + "|" + cp.Percent);
                ret.Append("}");
                if (cp != lst[lst.Length - 1])
                {
                    ret.Append(",");
                }
            }
            ret.Append("]");
            return(ret.ToString());
        }