Exemple #1
0
        public string GetProdutAutoComplete(int userId, string session, int currPage, int NumberRowOfPage, string funcPara)
        {
            StringBuilder ret = new StringBuilder();
            //string pInput = string.Format("<InputValue UserID='{0}' Session='{1}' PageIndex='{2}' RowsPerPage='{3}' {4}/>", userId, session, currPage, NumberRowOfPage, inputValue);
            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();
            CItems[] list = 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}\n", item.Code, item.Name, item.ID, item.UnitName, item.CreditAccount, item.DebitAccount, item.SalePrice,item.UnitID);
                    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);
        }
Exemple #2
0
        public string GetItems(int userId, string session, int currPage, int NumberRowOfPage, string funcPara)
        {
            //string InputValue = string.Format("<InputValue PageIndex='{0}' RowsPerPage='{1}' {2} />", currPage, NumberRowOfPage, funcPara);
            string InputValue = CXmlPara.CreatePara(new CPara[]
            {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("RowsPerPage", NumberRowOfPage.ToString()),
            },
                                                    funcPara
                                                    );
            COutputValue outputValue = new COutputValue();

            CItems[] list = service.GetInventoryItemsList(InputValue, ref outputValue);
            return(CGrid.ToJsonForHandle <CItems>(1, 3, list, currPage, outputValue.TotalPage, outputValue.TotalRow));
        }