public string GetStocks(int userID, string session, string inputValue) { string InputValue = CXmlPara.CreatePara(inputValue); ServiceREF.InventoryService.InventoryService service = new InventoryService(); ServiceREF.InventoryService.COutputValue pageinfo = new ServiceREF.InventoryService.COutputValue(); CStock[] list = service.GetInventoryStockList(InputValue, ref pageinfo); StringBuilder ret = new StringBuilder(); ret.Append("["); foreach (CStock 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 GetGridCoreStock(int currPage, int NumberRowOfPage, string inputValue, int refType) { CSession session = new CSession(); int userId = session.UserID; string result = ""; // string InputValue = CXmlPara.CreatePara(inputValue); string InputValue = CXmlPara.CreatePara(new CPara[] { new CPara("PageIndex", currPage.ToString()), new CPara("RowsPerPage", NumberRowOfPage.ToString()), new CPara("RefType", refType.ToString()), }, inputValue ); string InputValue1 = string.Format("<InputValue PageIndex=\"{0}\" RowsPerPage=\"{1}\" UserID=\"{2}\" RefType=\"{3}\" {4}/>", currPage, NumberRowOfPage, 1, refType, inputValue); ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue(); if (refType == 7) { CInward[] list = iv_service.GetInwardList(InputValue, ref outputValue); result = CGrid.ToJsonForHandle <CInward>(userId, 14, list, currPage, outputValue.TotalPage, outputValue.TotalRow); } else if (refType == 8) { COutward[] list = iv_service.GetOutwardList(InputValue, ref outputValue); result = CGrid.ToJsonForHandle <COutward>(userId, 14, list, currPage, outputValue.TotalPage, outputValue.TotalRow); } if (refType == 9) { CTransactionsStock[] list = iv_service.GetTransferList(InputValue, ref outputValue); result = CGrid.ToJsonForHandle <CTransactionsStock>(userId, 31, list, currPage, outputValue.TotalPage, outputValue.TotalRow); } return(result); }
public string GetProdutAutoComplete(int currPage, int NumberRowOfPage, string funcPara) { StringBuilder ret = new StringBuilder(); //string pInput = string.Format("<InputValue UserID='{0}' Session='{1}' PageIndex='{2}' RowsPerPage='{3}' {4}/>", userId, session, currPage, NumberRowOfPage, inputValue); string InputValue = CXmlPara.CreatePara(new CPara[] { new CPara("PageIndex", currPage.ToString()), new CPara("RowsPerPage", NumberRowOfPage.ToString()), }, funcPara ); ServiceREF.InventoryService.COutputValue pageinfo = new ServiceREF.InventoryService.COutputValue(); CItems[] list = iv_service.GetInventoryItemsList(InputValue, ref pageinfo); if (list != null && list.Length > 0) { foreach (var item in list) { //ret.AppendFormat("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}\n", item.Code, item.Name, item.ID, item.UnitName, item.CreditAccount, item.DebitAccount, item.SalePrice,item.UnitID); ret.AppendFormat("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}\n", item.Code, item.Name, item.ID, item.UnitName, item.CreditAccountName, item.DebitAccountName, item.SalePrice, item.UnitID, item.CreditAccount, item.DebitAccount, item.SerialNo, item.InwardAmount, item.OutwardAmount, item.ExpDate); } } string result = string.Empty; if (ret.Length > 0) { result = ret.ToString(0, ret.Length - 1); } return(result); }
public string GetGridInwardStockEntry(int currPage, int NumberRowOfPage, string inputValue) { StringBuilder ret = new StringBuilder(); string InputValue = string.Format("<InputValue PageIndex=\"{0}\" RowsPerPage=\"{1}\" {2}/>", currPage, NumberRowOfPage, inputValue); ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue(); CInwardDetail[] list = iv_service.GetInwardDetailList(InputValue, ref outputValue); if (list != null && list.Length > 0) { ret.Append("{"); ret.AppendFormat("'currpage':'{0}',", currPage); ret.AppendFormat("'totalpages':'{0}',", outputValue.TotalPage); ret.AppendFormat("'totalrecords':'{0}',", outputValue.TotalRow); ret.Append("'invdata':["); foreach (var item in list) { ret.Append(GetInwardStockEntry(item)); if (item != list[list.Length - 1]) { ret.Append(","); } } ret.Append("]"); ret.Append("}"); } string result = string.Empty; if (ret.Length > 0) { result = ret.ToString().Replace("'", "\""); } return(result); }
public string GetGrid(int currPage, int NumberRowOfPage, string inputValue, int refType) { CSession session = new CSession(); int userId = session.UserID; string result = ""; ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue(); // string InputValue = string.Format("<InputValue PageIndex='{0}' RowsPerPage='{1}' UserID='{2}' {3}/>", currPage, NumberRowOfPage, 1, inputValue); string InputValue = CXmlPara.CreatePara(new CPara[] { new CPara("PageIndex", currPage.ToString()), new CPara("RowsPerPage", NumberRowOfPage.ToString()), }, inputValue ); if (refType == 7) { CInwardDetail[] list = iv_service.GetInwardDetailList(InputValue, ref outputValue); result = CGrid.ToJsonForHandle <CInwardDetail>(userId, 15, list, currPage, outputValue.TotalPage, outputValue.TotalRow); } else if (refType == 8) { COutwardDetail[] list = iv_service.GetOutwardDetailList(InputValue, ref outputValue); result = CGrid.ToJsonForHandle <COutwardDetail>(userId, 46, list, currPage, outputValue.TotalPage, outputValue.TotalRow); } else if (refType == 9) { CTransactionsStockDetails[] list = iv_service.GetTransferDetails(InputValue, ref outputValue); result = CGrid.ToJsonForHandle <CTransactionsStockDetails>(userId, 32, list, currPage, outputValue.TotalPage, outputValue.TotalRow); } return(result); }
public string GetGrid(int userId, string session, int currPage, int NumberRowOfPage, string inputValue) { string result = ""; ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue(); string InputValue = string.Format("<InputValue PageIndex='{0}' RowsPerPage='{1}' UserID='{2}' {3}/>", currPage, NumberRowOfPage, 1, inputValue); //iv_service.upda // CTranferStockDetail[] list = iv_service.GetTra(InputValue, ref outputValue); //result = CGrid.ToJsonForHandle<CInwardDetail>(userId, 15, list, currPage, outputValue.TotalPage, outputValue.TotalRow); return(result); }
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); }
public string GetInventoryUnitList(string inputValue) { string _inputValue = string.Format("<InputValue {0}/>", inputValue); ServiceREF.InventoryService.COutputValue outputValue = new ServiceREF.InventoryService.COutputValue(); CUnit[] lst = iv_service.GetInventoryUnitList(_inputValue, ref outputValue); StringBuilder ret = new StringBuilder(); ret.Append("["); foreach (CUnit 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()); }