コード例 #1
0
        public string GetStockList(string InputValue)
        {
            //return obj.GetItems(InputValue);
            string strInputValue = CXmlPara.CreatePara(InputValue);

            COutputValue pageinfo = new COutputValue();

            CStock[] list = service.GetInventoryStockList(strInputValue, ref pageinfo);

            StringBuilder ret = new StringBuilder();

            ret.Append("[");
            foreach (CStock stock in list)
            {
                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("}");
                    if (stock != list[list.Length - 1])
                    {
                        ret.Append(",");
                    }
                }
            }
            ret.Append("]");
            return(ret.ToString());
        }
コード例 #2
0
        public string GetItems(int userID, string session, string funcPara)
        {
            //string pInput = string.Format("<InputValue UserID=\"{0}\" Session=\"{1}\" {2}/>", userID, session, inputValue);
            string InputValue = CXmlPara.CreatePara(funcPara);

            COutputValue pageinfo = new COutputValue();

            CCustomerGroup[] list = service.GetCustomerGroupList(InputValue, ref pageinfo);
            StringBuilder    ret  = new StringBuilder();

            ret.Append("[");
            foreach (CCustomerGroup customergroup in list)
            {
                if (customergroup != null)
                {
                    ret.Append("{");
                    ret.AppendFormat("ID:'{0}',\n", customergroup.ID);
                    ret.AppendFormat("Code:'{0}',\n", customergroup.Code);
                    ret.AppendFormat("Name:'{0}'\n", customergroup.Name);
                    ret.Append("}");
                    if (customergroup != list[list.Length - 1])
                    {
                        ret.Append(",");
                    }
                }
            }
            ret.Append("]");
            return(ret.ToString());
        }
コード例 #3
0
        public string GetItems(string funcPara)
        {
            //string pInput = string.Format("<InputValue UserID=\"{0}\" Session=\"{1}\" {2}/>", userID, session, inputValue);
            string InputValue = CXmlPara.CreatePara(funcPara);

            COutputValue pageinfo = new COutputValue();

            CStock[]      list = service.GetInventoryStockList(InputValue, ref pageinfo);
            StringBuilder ret  = new StringBuilder();

            ret.Append("[");
            foreach (CStock stock in list)
            {
                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("}");
                    if (stock != list[list.Length - 1])
                    {
                        ret.Append(",");
                    }
                }
            }
            ret.Append("]");
            return(ret.ToString());
        }
コード例 #4
0
        public string GetItems(int userId, string session, int currPage, int NumberRowOfPage, string funcPara)
        {
            //string _pInput = string.Format("<InputValue PageIndex='{0}' RowsPerPage='{1}' {2} />", currPage, NumberRowOfPage, funcPara);
            string InputValue = CXmlPara.CreatePara(funcPara);

            COutputValue pageinfo = new COutputValue();

            CCustomerGroup[] list = service.GetCustomerGroupList(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());
        }
コード例 #5
0
        public string GetDataAutoComplete(int userId, string session, 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
                                                    );

            COutputValue outputValue = new COutputValue();

            CVendor[] list = service.GetVendorList(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);
        }
コード例 #6
0
        protected IList <T> CallFunctionWithList <T>(int functionID, string inputValue, ref COutputValue output) where T : new()
        {
            try
            {
                DataSet ds = CallFunction(functionID, inputValue);
                //List<T> list = new List<T>();
                if (ds == null)
                {
                    return(null);
                }
                if (ds.Tables.Count == 0)
                {
                    return(null);
                }

                IList <T> list = CDb.MapList <T>(ds.Tables[0]);
                if (ds.Tables.Count > 1)
                {
                    output = CDb.Map <COutputValue>(ds.Tables[1]);
                }

                return(list);
            }
            catch (Exception ex)
            {
                output = new COutputValue()
                {
                    Code = "SYSTEM_ERROR", Name = "Error", Description = ex.Message
                };
            }
            return(null);
        }
コード例 #7
0
ファイル: LoginUI.cs プロジェクト: phinamcn03/ttdk
        public string Login(string inputValue)
        {
            COutputValue  outputValue = new COutputValue();
            CUserList     list        = service.Login(inputValue, ref outputValue);
            StringBuilder ret         = new StringBuilder();

            if (list != null)
            {
                ret.Append("{");
                ret.AppendFormat("ID:'{0}',\n", list.ID);
                ret.AppendFormat("IsSuccessfull:{0},\n", outputValue.IsSuccessfull.ToString().ToLower());
                ret.AppendFormat("LoginName:'{0}',\n", list.LoginName);
                ret.AppendFormat("FullName:'{0}',\n", list.FullName);
                ret.AppendFormat("Session:'{0}',\n", list.Session);
                ret.AppendFormat("ClientGroupID:'{0}',\n", list.ClientGroupID);
                ret.AppendFormat("LastActionDateTime:'{0}',\n", list.LastActionDateTime);
                ret.AppendFormat("LanguageID:'{0}',\n", list.LanguageID);
                ret.AppendFormat("Status:'{0}'\n", list.Status);
                ret.Append("}");
            }
            else
            {
                ret.Append("{");
                ret.AppendFormat("IsSuccessfull:{0},", outputValue.IsSuccessfull.ToString().ToLower());
                ret.AppendFormat("Name:'{0}',", outputValue.Name);
                ret.AppendFormat("Code:'{0}',", outputValue.Code);
                ret.AppendFormat("Description:'{0}'", outputValue.Description);
                ret.Append("}");
            }
            return(ret.ToString());
        }
コード例 #8
0
        public string GetAccountListInCSV(string InputValue, ref string PageInfo)
        {
            COutputValue         pInfo = new COutputValue();
            IList <CAccountList> list  = new CAccountListDao().GetAccountList(InputValue, ref pInfo);

            PageInfo = pInfo.ToCSV();
            return(CAccountList.ToCSV <CAccountList>(list));
        }
コード例 #9
0
ファイル: CCustomerUI.cs プロジェクト: phinamcn03/ttdk
        public string GetCustomerList(string funcPara)
        {
            string       InputValue  = CreatePara(funcPara);
            COutputValue outputValue = new COutputValue();

            CCustomer[] list = service.GetCustomerList(InputValue, ref outputValue);
            return(CJson.SerializeObject(list));
        }
コード例 #10
0
        public string GetInventoryItemGroupListInCSV(string InputValue, ref string PageInfo)
        {
            COutputValue       pInfo = new COutputValue();
            IList <CItemGroup> list  = new CItemsDao().GetInventoryItemGroupList(InputValue, ref pInfo);

            PageInfo = pInfo.ToCSV();
            return(CItemGroup.ToCSV <CItemGroup>(list));
        }
コード例 #11
0
        public string GetInventoryStockListInCSV(string InputValue, ref string PageInfo)
        {
            COutputValue   pInfo = new COutputValue();
            IList <CStock> list  = new CStockDao().GetInventoryStockList(InputValue, ref pInfo);

            PageInfo = pInfo.ToCSV();
            return(CStock.ToCSV <CStock>(list));
        }
コード例 #12
0
        public string GetInventoryTaxListInCSV(string InputValue, ref string PageInfo)
        {
            COutputValue pInfo = new COutputValue();
            IList <CTax> list  = new CTaxDao().GetInventoryTaxList(InputValue, ref pInfo);

            PageInfo = pInfo.ToCSV();
            return(CTax.ToCSV <CTax>(list));
        }
コード例 #13
0
        public string GetInventoryBaseListInCSV(string InputValue, ref string PageInfo)
        {
            COutputValue           pInfo = new COutputValue();
            IList <CInventoryBase> list  = new CInventoryBaseDao().GetInventoryBaseList(CSystemFunction.GetInventoryActiveIngredient, InputValue, ref pInfo);

            PageInfo = pInfo.ToCSV();
            return(CInventoryBase.ToCSV <CInventoryBase>(list));
        }
コード例 #14
0
        public string GetInventoryUnitListInCSV(string InputValue, ref string PageInfo)
        {
            ///
            COutputValue  pInfo = new COutputValue();
            IList <CUnit> list  = new CUnitDao().GetInventoryUnitList(InputValue, ref pInfo);

            PageInfo = pInfo.ToCSV();
            return(CUnit.ToCSV <CUnit>(list));
        }
コード例 #15
0
 public IList <CClientGroupConfig> GetClientGroupConfig(string pInputValue, ref COutputValue pOutputValue)
 {
     try
     {
         return(CallFunctionWithList <CClientGroupConfig>(CSystemFunction.GetClientGroupConfig, pInputValue, ref pOutputValue));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CClientGroupDao", ex.Message);
         return(null);
     }
 }
コード例 #16
0
ファイル: CTransferDao.cs プロジェクト: phinamcn03/ttdk
 public IList <CTransactionsStock> GetTransferList(string pInputValue, ref COutputValue pOutput)
 {
     try
     {
         return(CallFunctionWithList <CTransactionsStock>(CSystemFunction.GetTransfer, pInputValue, ref pOutput));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("GetTransferList", ex.Message);
         return(null);
     }
 }
コード例 #17
0
ファイル: CTransferDao.cs プロジェクト: phinamcn03/ttdk
 public IList <CInwardDetail> GetInwardDetailList(string pInputValue, ref COutputValue pOutput)
 {
     try
     {
         return(CallFunctionWithList <CInwardDetail>(CSystemFunction.GetInwardDetailList, pInputValue, ref pOutput));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("GetInwardDetailList", ex.Message);
         return(null);
     }
 }
コード例 #18
0
 public IList <CDesignParameter> GetViewDesignParameter(string pInputValue, ref COutputValue pOutputValue)
 {
     try
     {
         return(CallFunctionWithList <CDesignParameter>(CSystemFunction.GetViewDesignParameter, pInputValue, ref pOutputValue));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CViewDao", ex.Message);
         return(null);
     }
 }
コード例 #19
0
 public IList <CStock> GetInventoryStockList(string pInputValue, ref COutputValue pOutput)
 {
     try
     {
         return(CallFunctionWithList <CStock>(CSystemFunction.GetInventoryStock, pInputValue, ref pOutput));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CStockDao", ex.Message);
         return(null);
     }
 }
コード例 #20
0
 public IList <CCurrency> GetCurrencyList(string pInputValue, ref COutputValue pOutput)
 {
     try
     {
         return(CallFunctionWithList <CCurrency>(CSystemFunction.GetCurrencyList, pInputValue, ref pOutput));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CItemsDao", ex.Message);
         return(null);
     }
 }
コード例 #21
0
 public IList <CCustomerGroup> GetCustomerGroupList(string pInputValue, ref COutputValue pOutput)
 {
     try
     {
         return(CallFunctionWithList <CCustomerGroup>(CSystemFunction.GetCustomerGroupList, pInputValue, ref pOutput));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CApplicationDao", ex.Message);
         return(null);
     }
 }
コード例 #22
0
 public IList <CAsset> GetAssetList(string pInputValue, ref COutputValue pOutputValue)
 {
     try
     {
         return(CallFunctionWithList <CAsset>(CSystemFunction.GetFixedAsset, pInputValue, ref pOutputValue));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CAssetDao", ex.Message);
         return(null);
     }
 }
コード例 #23
0
ファイル: CGroupBaseDao.cs プロジェクト: phinamcn03/ttdk
 public IList <CGroupBase> GetGroupBaseList(string pInputValue, ref COutputValue pOutputValue)
 {
     try
     {
         return(CallFunctionWithList <CGroupBase>(CSystemFunction.GetGroup, pInputValue, ref pOutputValue));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CGroupBaseDao", ex.Message);
         return(null);
     }
 }
コード例 #24
0
ファイル: CRefTypeDao.cs プロジェクト: phinamcn03/ttdk
 public IList <CRefType> GetRefTypeList(string pInputValue, ref COutputValue pOutput)
 {
     try
     {
         return(CallFunctionWithList <CRefType>(CSystemFunction.GetRefType, pInputValue, ref pOutput));
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CEmployeeDao", ex.Message);
         return(null);
     }
 }
コード例 #25
0
        public List <CActiveIngredient> GetInventoryBaseList(string InputValue, ref COutputValue Output)
        {
            IList <CInventoryBase>   list    = new CInventoryBaseDao().GetInventoryBaseList(CSystemFunction.GetInventoryActiveIngredient, InputValue, ref Output);
            List <CActiveIngredient> listRet = new List <CActiveIngredient>(list.Count);

            foreach (CInventoryBase inv in list)
            {
                CActiveIngredient obj = new CActiveIngredient(inv);
                listRet.Add(obj);
            }

            return(listRet);
        }
コード例 #26
0
 public IList <CUserGroup> GetUserGroupList(string pInputValue, ref COutputValue output)
 {
     try
     {
         IList <CUserGroup> list = CallFunctionWithList <CUserGroup>(CSystemFunction.GetUserGroup, pInputValue, ref output);
         return(list);
     }
     catch (Exception ex)
     {
         CLogManager.WriteDAL("CUserGroupDao", ex.Message);
         return(null);
     }
 }
コード例 #27
0
ファイル: CCustomerUI.cs プロジェクト: phinamcn03/ttdk
        public string GetGrid(int userId, string session, int currPage, int NumberRowOfPage, string exAttribute)
        {
            string InputValue = CXmlPara.CreatePara(new CPara[] {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("RowsPerPage", NumberRowOfPage.ToString()),
            },
                                                    exAttribute
                                                    );

            COutputValue outputValue = new COutputValue();

            CCustomer[] list = service.GetCustomerList(InputValue, ref outputValue);
            return(CGrid.ToJsonForHandle <CCustomer>(1, 6, list, currPage, outputValue.TotalPage, outputValue.TotalRow));
        }
コード例 #28
0
ファイル: CItemUI.cs プロジェクト: phinamcn03/ttdk
        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, funcPara);
            string InputValue = CXmlPara.CreatePara(new CPara[]
            {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("RowsPerPage", NumberRowOfPage.ToString()),
            },
                                                    funcPara
                                                    );
            COutputValue outputValue = new COutputValue();

            CItems[] list = service.GetInventoryItemsList(InputValue, ref outputValue);
            return(CGrid.ToJsonForHandle <CItems>(1, 3, list, currPage, outputValue.TotalPage, outputValue.TotalRow));
        }
コード例 #29
0
        public string GetGrid(int currPage, int NumberRowOfPage, string exAttribute)
        {
            string InputValue = CXmlPara.CreatePara(new CPara[] {
                new CPara("PageIndex", currPage.ToString()),
                new CPara("RowsPerPage", NumberRowOfPage.ToString()),
            }, exAttribute);

            COutputValue outputValue = new COutputValue();

            CClientGroupConfig[] list = service.GetClientGroupConfig(InputValue, ref outputValue);
            int totalPage             = outputValue.TotalPage;
            int totalRow = outputValue.TotalRow;

            return(CGrid.ToJsonForHandle <CClientGroupConfig>(1, 22, list, currPage, totalPage, totalRow));
        }
コード例 #30
0
        public string GetItems(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();

            CStock[] list = service.GetInventoryStockList(InputValue, ref pageinfo);
            return(CGrid.ToJsonForHandle <CStock>(1, 1, list, currPage, pageinfo.TotalPage, pageinfo.TotalRow));
        }