public string GetLanguageList(string inputValue) { System.Text.StringBuilder ret = new System.Text.StringBuilder(); ServiceREF.CoreService.CoreService service = new ServiceREF.CoreService.CoreService(); ServiceREF.CoreService.COutputValue outputValue = new ServiceREF.CoreService.COutputValue(); ServiceREF.CoreService.CLanguage[] list = service.GetLanguageList(inputValue, ref outputValue); if (list != null && list.Length > 0) { ret.Append("["); foreach (ServiceREF.CoreService.CLanguage item in list) { ret.Append("{"); ret.AppendFormat("ID:'{0}',\n", item.ID); ret.AppendFormat("Code:'{0}',\n", item.Code); ret.AppendFormat("Name:'{0}'\n", item.Name); ret.Append("}"); if (item != list[list.Length - 1]) { ret.Append(","); } } ret.Append("]"); } return(ret.ToString()); }
public string GetParams(int userId, string sViewID) { StringBuilder ret = new StringBuilder(); string InputValue = CXmlPara.CreatePara(new CPara[] { new CPara("ViewID", sViewID) }, "" ); ServiceREF.CoreService.COutputValue outputValue = new ServiceREF.CoreService.COutputValue(); ServiceREF.CoreService.CDesignParameter[] list = CoreService.GetViewDesignParameter(InputValue, ref outputValue); ret.Append("{["); for (int i = 0; i < list.Length; i++) { ret.Append("{"); ret.AppendFormat("\"{0}\":\"{1}\",", "name", list[i].VariableName); ret.AppendFormat("\"{0}\":\"{1}\",", "type", list[i].VariableType); ret.AppendFormat("\"{0}\":\"{1}\",", "label", list[i].VariableLabel); ret.AppendFormat("\"{0}\":\"{1}\",", "fcode", list[i].FilterCode); ret.AppendFormat("\"{0}\":\"{1}\"", "dcode", list[i].DataCode); ret.Append("}"); if (i < list.Length - 1) { ret.Append(","); } } ret.Append("]}"); return(ret.ToString()); }
protected void Page_Load(object sender, EventArgs e) { ServiceREF.CoreService.CoreService service = new ServiceREF.CoreService.CoreService(); ServiceREF.CoreService.COutputValue output = new ServiceREF.CoreService.COutputValue(); ServiceREF.CoreService.CUserList messs = service.Login("<InputValue UserLogin=\"qc\" Password=\"123456\" />", ref output); if (output.IsSuccessfull) { Response.Write(messs.FullName); } else { Response.Write("Invalid login info"); } }
public string GetViews(int userId, string sPageCode) { string ret = ""; string InputValue = CXmlPara.CreatePara(new CPara[] { new CPara("ViewCode", sPageCode) }, "" ); ServiceREF.CoreService.COutputValue outputValue = new ServiceREF.CoreService.COutputValue(); ServiceREF.CoreService.CViewList[] list = CoreService.GetViewList(InputValue, ref outputValue); ret = CGrid.ToJsonForHandle <ServiceREF.CoreService.CViewList>(userId, 28, list, 1, 1, 1000); return(ret); }
private static string LoadTreeData(string exAttribute) { string inputValue = CXmlPara.CreatePara(new CPara[] { new CPara("FilterCode", "Employee") }, exAttribute); ServiceREF.CoreService.COutputValue outputValue = new ServiceREF.CoreService.COutputValue(); ServiceREF.CoreService.CPersonRole[] list = core_service.GetPersonRoleList(inputValue, ref outputValue); StringBuilder ret = new StringBuilder(); if (list != null && 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/Core/Service/EmployeeDepartment.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); }
private static string LoadTreeGrid(string exAttribute, int pLevel, int pParentId) { string inputValue = CXmlPara.CreatePara(new CPara[] { new CPara("FilterCode", "Employee") }, exAttribute); ServiceREF.CoreService.COutputValue outputValue = new ServiceREF.CoreService.COutputValue(); ServiceREF.CoreService.CPersonRole[] list = core_service.GetPersonRoleList(inputValue, ref outputValue); StringBuilder ret = new StringBuilder(); try { string format = "\"ID\":\"{0}\", \"Code\":\"{1}\", \"Name\":\"{2}\", \"parent_id\":\"{3}\", \"level\":\"{4}\", \"isLeaf\":\"{5}\", \"expanded\":\"{6}\", \"loaded\":\"{6}\""; ret.AppendFormat("{{\"page\":\"{0}\",\"total\":\"{1}\",\"records\":\"{2}\",\"invdata\":[", 1, outputValue.TotalPage, outputValue.TotalRow); for (int i = 0; i < list.Length; i++) { string isLeaf = list[i].ChildCount > 0 ? "false" : "true"; int _level = 0; if (list[i].Level > 0) { _level = list[i].Level - 1; } else if (pParentId > 0) { _level = pLevel + 1; } string item = string.Format(format, list[i].ID, list[i].Code, list[i].Name, list[i].ParentID, _level, isLeaf, "false"); ret.Append("{" + item + "}"); if (i < list.Length - 1) { ret.Append(","); } } ret.Append("]}"); } catch (Exception ex) { CLogManager.Write("ChartAccountUI:GetItems(int, string, string)", ex.ToString(), "Account"); } return(ret.ToString()); }
public string GetPersonAutoComplete(string funcPara) { StringBuilder ret = new StringBuilder(); string InputValue = CXmlPara.CreatePara(funcPara); ServiceREF.CoreService.COutputValue outputValue = new ServiceREF.CoreService.COutputValue(); ServiceREF.CoreService.CPerson[] list = core_service.GetPersonList(InputValue, ref outputValue); if (list != null && list.Length > 0) { foreach (var item in list) { ret.AppendFormat("{0}|{1}|{2}|{3}|{4}|{5}\n", item.Code, item.Name, item.TaxNo, item.Address, item.Email, item.ID); } } string result = string.Empty; if (ret.Length > 0) { result = ret.ToString(0, ret.Length - 1); } return(result); }