コード例 #1
0
        public string GetItems(string funcPara)
        {
            //string pInput = string.Format("<InputValue UserID=\"{0}\" Session=\"{1}\" {2}/>", userID, session, inputValue);
            string InputValue = CXmlPara.CreatePara(funcPara);

            COutputValue pageinfo = new COutputValue();

            CStock[]      list = service.GetInventoryStockList(InputValue, ref pageinfo);
            StringBuilder ret  = new StringBuilder();

            ret.Append("[");
            foreach (CStock stock in list)
            {
                if (stock != null)
                {
                    ret.Append("{");
                    ret.AppendFormat("ID:'{0}',\n", stock.ID);
                    ret.AppendFormat("Code:'{0}',\n", stock.Code);
                    ret.AppendFormat("Name:'{0}',\n", stock.Name);
                    ret.AppendFormat("ParentID:'{0}',\n", stock.ParentID);
                    ret.AppendFormat("Description:'{0}'\n", stock.Description);
                    ret.Append("}");
                    if (stock != list[list.Length - 1])
                    {
                        ret.Append(",");
                    }
                }
            }
            ret.Append("]");
            return(ret.ToString());
        }
コード例 #2
0
        public string GetAutoStock(string Input)
        {
            ServiceREF.InventoryService.COutputValue     pageinfo = new ServiceREF.InventoryService.COutputValue();
            ServiceREF.InventoryService.InventoryService service  = new ServiceREF.InventoryService.InventoryService();

            CStock[]      list = service.GetInventoryStockList(Input, ref pageinfo);
            StringBuilder ret  = new StringBuilder();

            if (list != null && list.Length > 0)
            {
                foreach (var item in list)
                {
                    ret.AppendFormat("{0}|{1}|{2}\n", item.ID, item.Code, item.Name);
                }
            }
            string result = string.Empty;

            if (ret.Length > 0)
            {
                result = ret.ToString(0, ret.Length - 1);
            }
            return(result);
        }