Beispiel #1
0
        private static long GetSessionID(out bool bolIsOverFlow)
        {
            long lSessionID = 0;

            bolIsOverFlow = false;
            LBDbParameterCollection parmCol = new LBDbParameterCollection();

            parmCol.Add(new LBParameter("ClientIP", enLBDbType.String, MachineIP));
            parmCol.Add(new LBParameter("ClientSerial", enLBDbType.String, MachineSeries));

            DataSet dsReturn;
            Dictionary <string, object> dictValue;

            ExecuteSQL.CallSP(15000, false, parmCol, out dsReturn, out dictValue);
            if (dictValue.ContainsKey("SessionID"))
            {
                long.TryParse(dictValue["SessionID"].ToString(), out lSessionID);
            }
            if (dictValue.ContainsKey("IsOverFlow"))
            {
                if (dictValue["IsOverFlow"].ToString() == "1")
                {
                    bolIsOverFlow = true;
                }
            }

            return(lSessionID);
        }
Beispiel #2
0
        public static void CallSP(int iSPType, bool bolIsNeedSession, LBDbParameterCollection parmCollection, out DataSet dsReturn, out Dictionary <string, object> dictReturn)
        {
            dictReturn = new Dictionary <string, object>();
            DataTable dtSPIN = new DataTable("SPIN");

            foreach (LBParameter parm in parmCollection)
            {
                if (!dtSPIN.Columns.Contains(parm.ParameterName))
                {
                    dtSPIN.Columns.Add(parm.ParameterName, LBDbType.GetSqlDbType(parm.LBDBType));
                }
            }

            DataRow drNew = dtSPIN.NewRow();

            foreach (LBParameter parm in parmCollection)
            {
                if (parm.Direction != ParameterDirection.Output)
                {
                    drNew[parm.ParameterName] = parm.Value;
                }
            }
            dtSPIN.Rows.Add(drNew);

            //LBWebService.LBWebService webservice = GetLBWebService();
            string    strErrorMsg;
            bool      bolIsError;
            DataTable dtOut;

            CallSP(iSPType, bolIsNeedSession, dtSPIN, out dsReturn, out dtOut);

            if (dtOut != null && dtOut.Rows.Count > 0)
            {
                foreach (DataColumn dc in dtOut.Columns)
                {
                    if (!dictReturn.ContainsKey(dc.ColumnName))
                    {
                        dictReturn.Add(dc.ColumnName, dtOut.Rows[0][dc.ColumnName]);
                    }
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// 调用存储过程或中间层
 /// </summary>
 /// <param name="iSPType">存储过程号</param>
 /// <param name="parmCollection">参数数据</param>
 /// <param name="dsReturn">返回的查询数据</param>
 /// <param name="dictReturn">返回的参数值</param>
 public static void CallSP(int iSPType, LBDbParameterCollection parmCollection, out DataSet dsReturn, out Dictionary <string, object> dictReturn)
 {
     CallSP(iSPType, true, parmCollection, out dsReturn, out dictReturn);
 }