Esempio n. 1
0
        public string GetGridTransaction(int gridID, int currPage, int NumberRowOfPage, string exAttribute)
        {
            string InputValue = CXmlPara.CreatePara(new CPara[] {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("NumberRowOfPage", NumberRowOfPage.ToString())
            },
                                                    exAttribute
                                                    );

            ServiceREF.GeneralLedgerService.COutputValue         outputValue = new ServiceREF.GeneralLedgerService.COutputValue();
            ServiceREF.GeneralLedgerService.CTransactionDetail[] list        = GLS.GetTransactionDetail(InputValue);
            return(CGrid.ToJsonForHandle <ServiceREF.GeneralLedgerService.CTransactionDetail>(0, gridID, list, currPage, outputValue.TotalPage, outputValue.TotalRow));
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        public string GetList(int userID, string session, string funcPara)
        {
            //string pInput = string.Format("<InputValue UserID=\"{0}\" Session=\"{1}\" {2}/>", userId, session, funcPara);
            string InputValue = CXmlPara.CreatePara(funcPara);

            ServiceREF.GeneralLedgerService.COutputValue pageinfo = new ServiceREF.GeneralLedgerService.COutputValue();
            CAccountList[] list = service.GetAccountList(InputValue, ref pageinfo);
            StringBuilder  ret  = new StringBuilder();

            ret.Append("[");
            foreach (CAccountList account in list)
            {
                if (account != null)
                {
                    try
                    {
                        ret.Append("{");
                        ret.AppendFormat("ID:'{0}',\n", account.ID);
                        ret.AppendFormat("Code:'{0}',\n", account.Code);
                        ret.AppendFormat("Name:'{0}',\n", account.Name);
                        ret.AppendFormat("ParentID:'{0}',\n", account.ParentID);
                        ret.AppendFormat("Type:'{0}'\n", account.ParentID);
                        ret.Append("}");
                    }
                    catch (Exception ex)
                    {
                        CLogManager.Write("ChartAccountUI:GetList(int, string, string)", ex.ToString(), "Account");
                    }
                    if (account != list[list.Length - 1])
                    {
                        ret.Append(",");
                    }
                }
            }
            ret.Append("]");
            return(ret.ToString());
        }
Esempio n. 4
0
        public string GetAccountList(string inputValue)
        {
            string _inputValue = string.Format("<InputValue FilterCode=\"{0}\"/>", inputValue);

            ServiceREF.GeneralLedgerService.COutputValue outputValue = new ServiceREF.GeneralLedgerService.COutputValue();
            CAccountList[] lst = gl_service.GetAccountList(_inputValue, ref outputValue);
            StringBuilder  ret = new StringBuilder();

            ret.Append("[");
            foreach (CAccountList cp in lst)
            {
                ret.Append("{");
                ret.AppendFormat("'id':'{0}',", cp.ID);
                ret.AppendFormat("'text':'{0}',", cp.Name);
                ret.AppendFormat("'value':'{0}'", cp.Code);
                ret.Append("}");
                if (cp != lst[lst.Length - 1])
                {
                    ret.Append(",");
                }
            }
            ret.Append("]");
            return(ret.ToString());
        }