public string GetTemplate(string funcPara) { StringBuilder ret = new StringBuilder(); string InputValue = CXmlPara.CreatePara(funcPara); ServiceREF.CoreService.CControl[] lst = core_service.GetControls(InputValue); ret.Append("["); foreach (ServiceREF.CoreService.CControl cp in lst) { ret.Append("{"); ret.AppendFormat("'id':'{0}',", cp.ID); ret.AppendFormat("'text':'{0}',", cp.Caption); ret.AppendFormat("'value':'{0}'", cp.ID); ret.Append("}"); if (cp != lst[lst.Length - 1]) { ret.Append(","); } } ret.Append("]"); return(ret.ToString()); }
public string GetItem(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.VendorService.CVendorGroup vendorGroup = service.GetVendorGroup(InputValue); StringBuilder ret = new StringBuilder(); if (vendorGroup != null) { ret.Append("{"); ret.AppendFormat("ID:'{0}',\n", vendorGroup.ID); ret.AppendFormat("Code:'{0}',\n", vendorGroup.Code); ret.AppendFormat("Name:'{0}'\n", vendorGroup.Name); ret.Append("}"); } else { ret.Append("{}"); } return(ret.ToString()); }
public string UpdateItem(int userID, string session, string funcPara) { //string pInput = string.Format("<InputValue UserID=\"{0}\" Session=\"{1}\" {2}/>", userID, session, funcPara); string InputValue = CXmlPara.CreatePara(funcPara); CApplicationMessage message = service.UpdateAccount(InputValue); StringBuilder ret = new StringBuilder(); try { ret.Append("{"); ret.AppendFormat("Code:'{0}',\n", message.Code); ret.AppendFormat("Name:'{0}',\n", message.Name); ret.AppendFormat("Result:'{0}'\n", message.Result); ret.Append("}"); } catch (Exception ex) { CLogManager.Write("ChartAccountUI:UpdateItem", ex.ToString(), "Account"); } return(ret.ToString()); }
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, inputValue); string InputValue = CXmlPara.CreatePara(new CPara[] { new CPara("PageIndex", currPage.ToString()), new CPara("RowsPerPage", NumberRowOfPage.ToString()), }, funcPara ); COutputValue pageinfo = new COutputValue(); ServiceREF.VendorService.CVendorGroup[] list = service.GetVendorGroupList(InputValue, ref pageinfo); StringBuilder ret = new StringBuilder(); try { string format = "\"ID\":\"{0}\", \"Code\":\"{1}\", \"Name\":\"{2}\", \"Status\":\"{3}\""; ret.Append("{"); ret.AppendFormat("\"currpage\":\"{0}\",\"totalpages\":\"{1}\",\"totalrecords\":\"{2}\",\"invdata\":[", currPage, pageinfo.TotalPage, pageinfo.TotalRow); for (int i = 0; i < list.Length; i++) { string item = string.Format(format, list[i].ID, list[i].Code, list[i].Name, list[i].Status); ret.Append("{" + item + "}"); if (i < list.Length - 1) { ret.Append(","); } } ret.Append("]}"); } catch (Exception ex) { ret.Append(ex.ToString()); } return(ret.ToString()); }
public static string Update(string exAttribute) { string inputValue = CXmlPara.CreatePara(exAttribute); ServiceREF.CoreService.CApplicationMessage message = core_service.UpdatePersonRole(inputValue); StringBuilder ret = new StringBuilder(); try { ret.Append("{"); ret.AppendFormat("IsSuccess:'{0}',\n", message.IsSuccessfull); ret.AppendFormat("Code:'{0}',\n", message.Code); ret.AppendFormat("Name:'{0}',\n", message.Name); ret.AppendFormat("Result:'{0}',\n", message.Result); ret.AppendFormat("Description:'{0}'\n", message.Description); ret.Append("}"); } catch (Exception ex) { CLogManager.Write("CEmployeeDepartmentUI:Update", ex.ToString(), "Account"); } return(ret.ToString()); }
public string GetAccountList(string funcPara) { StringBuilder ret = new StringBuilder(); string inputValue = CXmlPara.CreatePara(funcPara); ServiceREF.GeneralLedgerService.COutputValue outputValue = new ServiceREF.GeneralLedgerService.COutputValue(); ServiceREF.GeneralLedgerService.CAccountList[] lst = gl_service.GetAccountList(inputValue, ref outputValue); ret.Append("["); foreach (ServiceREF.GeneralLedgerService.CAccountList cp in lst) { ret.Append("{"); ret.AppendFormat("'id':'{0}',", cp.ID); ret.AppendFormat("'text':'{0}',", cp.DisplayName); ret.AppendFormat("'value':'{0}'", cp.ID); ret.Append("}"); if (cp != lst[lst.Length - 1]) { ret.Append(","); } } ret.Append("]"); return(ret.ToString()); }
public string GetItemTypeList(int userId, string session, int currPage, int NumberRowOfPage) { //string pInput = string.Format("<InputValue PageIndex='{0}' RowsPerPage='{1}' />", currPage, NumberRowOfPage); string InputValue = CXmlPara.CreatePara(new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("PageIndex", currPage.ToString()), new KeyValuePair <string, string>("RowsPerPage", NumberRowOfPage.ToString()), } ); COutputValue pageinfo = new COutputValue(); CItemType[] list = service.GetItemTypeList(InputValue, ref pageinfo); StringBuilder ret = new StringBuilder(); try { string format = "\"ID\":\"{0}\", \"Code\":\"{1}\", \"Name\":\"{2}\""; ret.Append("{"); ret.AppendFormat("\"page\":\"{0}\",\"total\":\"{1}\",\"records\":\"{2}\",\"invdata\":[", currPage, pageinfo.TotalPage, pageinfo.TotalRow); for (int i = 0; i < list.Length; i++) { string item = string.Format(format, list[i].ID, list[i].Code, list[i].Name); ret.Append("{" + item + "}"); if (i < list.Length - 1) { ret.Append(","); } } ret.Append("]}"); } catch (Exception) { } return(ret.ToString()); }
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()); }
public string GetItem(string funcPara) { //string pInput = string.Format("<InputValue UserID=\"{0}\" Session=\"{1}\" {2}/>", userId, session, inputvalue); string InputValue = CXmlPara.CreatePara(funcPara); CStock stock = service.GetInventoryStock(InputValue); StringBuilder ret = new StringBuilder(); 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("}"); } else { ret.Append("{}"); } return(ret.ToString()); }
public string GetTaxList(string funcPara) { StringBuilder ret = new StringBuilder(); string inputValue = CXmlPara.CreatePara(funcPara); ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue(); ServiceREF.InventoryService.CTax[] lst = iv_service.GetInventoryTaxList(inputValue, ref outputValue); ret.Append("["); foreach (ServiceREF.InventoryService.CTax cp in lst) { ret.Append("{"); ret.AppendFormat("'id':'{0}',", cp.ID); ret.AppendFormat("'text':'{0}',", cp.Name); ret.AppendFormat("'value':'{0}',", cp.Percent); ret.AppendFormat("'id_value':'{0}'", cp.ID + "|" + cp.Percent); ret.Append("}"); if (cp != lst[lst.Length - 1]) { ret.Append(","); } } ret.Append("]"); return(ret.ToString()); }
public string GetInwardStock(string exAttribute, int refType) { string InputValue = CXmlPara.CreatePara(exAttribute); if (refType == 7) { CInward inward = iv_service.GetInward(InputValue); return(CJson.SerializeObject(inward)); } else if (refType == 8) { COutward outward = iv_service.GetOutward(InputValue); return(CJson.SerializeObject(outward)); } else if (refType == 9) { CTransactionsStock outward = iv_service.GetTransfer(InputValue); return(CJson.SerializeObject(outward)); } else { return(""); } }
public string GetListGroup() { string InputValue = CXmlPara.CreatePara(new CPara[] { }, ""); StringBuilder ret = new StringBuilder(); ServiceREF.CoreService.COutputValue output = new ServiceREF.CoreService.COutputValue(); CUserGroup[] list = service.GetUserGroupList(InputValue, ref output); ret.Append("["); foreach (CUserGroup cp in list) { ret.Append("{"); ret.AppendFormat("'id':'{0}',", cp.ID); ret.AppendFormat("'text':'{0}',", cp.Name); ret.AppendFormat("'value':'{0}'", cp.ID); ret.Append("}"); if (cp != list[list.Length - 1]) { ret.Append(","); } } ret.Append("]"); return(ret.ToString()); }
public string GetVendorList(string funcPara) { StringBuilder ret = new StringBuilder(); //string inputValue = string.Format("<InputValue {0}/>", InputValue); string InputValue = CXmlPara.CreatePara(funcPara); COutputValue outputValue = new COutputValue(); CVendor[] list = service.GetVendorList(InputValue, ref outputValue); if (list != null && list.Length > 0) { ret.Append("["); foreach (var item in list) { ret.Append(GetItem(item)); if (item != list[list.Length - 1]) { ret.Append(","); } } ret.Append("]"); } return(ret.ToString()); }
public string DeleteInventoryProduct(string InputValue) { string input = CXmlPara.CreatePara(InputValue); return(obj.DeleteItem(input)); }
//===================================================================== private ServiceREF.CoreService.CControlData[] GetData(string inputValue) { string p = CXmlPara.CreatePara(inputValue); return(core_service.GetControlData(p)); }
public string CreatePara(string inputValue) { return(CXmlPara.CreatePara(inputValue)); }