コード例 #1
0
ファイル: BigAttachManager.cs プロジェクト: caodevelop/bgqt
        public bool GetFileList(
            Guid transactionid,
            Guid userid,
            int curpage,
            int pagesize,
            //string orderbyField,
            //string orderbyType,
            out string strJsonResult)
        {
            bool result = true;

            strJsonResult = string.Empty;
            ErrorCodeInfo error    = new ErrorCodeInfo();
            string        paramstr = string.Empty;

            paramstr += $"userid:{userid}";
            paramstr += $"||curpage:{curpage}";
            paramstr += $"||pagesize:{pagesize}";
            //paramstr += $"||orderbyField:{orderbyField}";
            //paramstr += $"||orderbyType:{orderbyType}";
            string funname = "GetFileList";

            try
            {
                do
                {
                    AttachResultInfo resultinfo = new AttachResultInfo();
                    BigFileListInfo  bfli       = new BigFileListInfo();


                    BigAttachDBProvider Provider = new BigAttachDBProvider();
                    result = Provider.GetFileList(transactionid, userid, curpage, pagesize, out bfli, out error);
                    if (result == true)
                    {
                        resultinfo.data = bfli;
                        strJsonResult   = JsonConvert.SerializeObject(resultinfo);
                        LoggerHelper.Info(userid.ToString(), funname, paramstr, Convert.ToString(error.Code), true, transactionid);
                        result = true;
                        break;
                    }
                    else
                    {
                        LoggerHelper.Info(userid.ToString(), funname, paramstr, Convert.ToString(error.Code), false, transactionid);
                        result = false;
                    }
                } while (false);
            }
            catch (Exception ex)
            {
                error.Code = ErrorCode.Exception;
                LoggerHelper.Info(userid.ToString(), funname, paramstr, Convert.ToString(error.Code), false, transactionid);
                LoggerHelper.Error("BigAttachManager调用GetFileList异常", paramstr, ex.ToString(), transactionid);
                strJsonResult = JsonHelper.ReturnJson(false, Convert.ToInt32(error.Code), error.Info);
                result        = false;
            }
            return(result);
        }
コード例 #2
0
ファイル: BigAttachManager.cs プロジェクト: caodevelop/bgqt
        public bool Search(
            Guid transactionid,
            Guid userid,
            string keyword,
            int top,
            out string strJsonResult)
        {
            bool result = true;

            strJsonResult = string.Empty;
            ErrorCodeInfo error    = new ErrorCodeInfo();
            string        paramstr = string.Empty;

            paramstr += $"userid:{userid}";
            paramstr += $"||keyword:{keyword}";
            paramstr += $"||top:{top}";
            string funname = "Search";

            try
            {
                do
                {
                    AttachResultInfo resultinfo = new AttachResultInfo();
                    BigFileListInfo  bfli       = new BigFileListInfo();


                    BigAttachDBProvider Provider = new BigAttachDBProvider();
                    result = Provider.Search(transactionid, userid, keyword, top, out bfli, out error);
                    if (result == true)
                    {
                        resultinfo.data = bfli;
                        strJsonResult   = JsonConvert.SerializeObject(resultinfo);
                        LoggerHelper.Info(userid.ToString(), funname, paramstr, Convert.ToString(error.Code), true, transactionid);
                        result = true;
                        break;
                    }
                    else
                    {
                        LoggerHelper.Info(userid.ToString(), funname, paramstr, Convert.ToString(error.Code), false, transactionid);
                        result = false;
                    }
                } while (false);
            }
            catch (Exception ex)
            {
                error.Code = ErrorCode.Exception;
                LoggerHelper.Info(userid.ToString(), funname, paramstr, Convert.ToString(error.Code), false, transactionid);
                LoggerHelper.Error("BigAttachManager调用GetFileList异常", paramstr, ex.ToString(), transactionid);
                strJsonResult = JsonHelper.ReturnJson(false, Convert.ToInt32(error.Code), error.Info);
                result        = false;
            }
            return(result);
        }