예제 #1
0
        public string GetAccountAutoComplete(string funcPara)
        {
            StringBuilder ret        = new StringBuilder();
            string        InputValue = CXmlPara.CreatePara(funcPara);

            ServiceREF.GeneralLedgerService.COutputValue   outputValue = new ServiceREF.GeneralLedgerService.COutputValue();
            ServiceREF.GeneralLedgerService.CAccountList[] list        = gl_service.GetAccountList(InputValue, ref outputValue);
            if (list != null && list.Length > 0)
            {
                foreach (var item in list)
                {
                    ret.AppendFormat("{0}|{1}|{2}|{3}|{4}\n", item.Code, item.Name, item.ID, item.ChildCount, item.Level);
                }
            }
            string result = string.Empty;

            if (ret.Length > 0)
            {
                result = ret.ToString(0, ret.Length - 1);
            }
            return(result);
        }
예제 #2
0
        private string LoadData(string InputValue)
        {
            CChartAccountUI obj = new CChartAccountUI();

            ServiceREF.GeneralLedgerService.COutputValue         cpi     = new ServiceREF.GeneralLedgerService.COutputValue();
            ServiceREF.GeneralLedgerService.GeneralLedgerService service = new ServiceREF.GeneralLedgerService.GeneralLedgerService();
            string pInput = string.Format("<InputValue UserID=\"{0}\" Session=\"{1}\" ParentID=\"{2}\"/>", 1, "ED45A7F1-9FB8-4D82-9D48-1B2238DC666C", InputValue);

            ServiceREF.GeneralLedgerService.CAccountList[] list = service.GetAccountList(pInput, ref cpi);
            StringBuilder ret = new StringBuilder();

            if (list.Length > 0)
            {
                ret.Append("[");
                foreach (var item in list)
                {
                    string state = "open";
                    if (item.ChildCount != 0)
                    {
                        state = "closed";
                    }
                    else
                    {
                        state = "open";
                    }
                    ret.Append("{\n");
                    ret.AppendFormat("'id':'{0}',\n", item.ID);
                    ret.AppendFormat("'text':'{0}',\n", item.Code + " - " + item.Name);
                    ret.AppendFormat("'state':'{0}',\n", state);
                    ret.Append("'attributes':{");
                    ret.AppendFormat("'url':'{0}',", "../Mods/Items/Service/ChartAccountTree.ashx?inputValue=" + item.ID);
                    ret.AppendFormat("'isLoad':'{0}'", 1);
                    ret.Append("}\n");
                    ret.Append("}");
                    if (item != list[list.Length - 1])
                    {
                        ret.Append(",\n");
                    }
                }
                ret.Append("]");
            }
            string jsonReturn = "";

            if (ret.Length > 0)
            {
                jsonReturn = ret.ToString().Replace("'", "\"");
            }
            return(jsonReturn);
        }
예제 #3
0
        public string GetAccountList(string Input)
        {
            ServiceREF.GeneralLedgerService.GeneralLedgerService GLS      = new ServiceREF.GeneralLedgerService.GeneralLedgerService();
            ServiceREF.GeneralLedgerService.COutputValue         pageinfo = new ServiceREF.GeneralLedgerService.COutputValue();
            ServiceREF.GeneralLedgerService.CAccountList[]       list     = GLS.GetAccountList(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.DisplayName);
                }
            }
            string result = string.Empty;

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