Пример #1
0
        public DataSet GetLogList(int iStart, int iLimit, int iType, string strOptID, string strDate, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" where 1=1");
            if (strOptID != "")
            {
                strWhere.AppendFormat(" and operatorID ='{0}'", strOptID);
            }
            if (iType != -1)
            {
                strWhere.AppendFormat(" and log_type={0}", iType);
            }
            if (strDate == "")
            {
                strDate = DateTime.Now.ToString();
            }
            strWhere.AppendFormat(" and DATEDIFF(dd,convert(datetime,'{0}',120),log_time) = 0", strDate);

            string strNumSQL  = string.Format("select count(log_id) from sysLog {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and log_id not in (select top {0} log_id from sysLog {1} order by log_id desc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} * from sysLog {1} {2} order by log_id desc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="iStart"></param>
        /// <param name="iLimit"></param>
        /// <param name="iType"></param>
        /// <param name="iBusiness"></param>
        /// <param name="strSpgate"></param>
        /// <returns></returns>
        public DataSet GetList(int iStart, int iLimit, int iType, int iBusiness, string strSpgate, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" where 1=1");
            if (strSpgate != "")
            {
                strWhere.AppendFormat(" and GateNumber='{0}'", strSpgate);
            }
            if (iType != -1)
            {
                strWhere.AppendFormat(" and GateType={0}", iType);
            }
            if (iBusiness != -1)
            {
                strWhere.AppendFormat(" and BusinessID={0}", iBusiness);
            }
            string strNumSQL  = string.Format("select count(ID) from SmsSpgate {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and ID not in (select top {0} id from SmsSpgate {1} order by id asc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} * from SmsSpgate {1} {2} order by id asc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="iStart"></param>
        /// <param name="iLimit"></param>
        /// <param name="strUserID"></param>
        /// <param name="strParentID"></param>
        /// <param name="iStatus"></param>
        /// <param name="iTotalCount"></param>
        /// <returns></returns>
        public DataSet GetUserList(int iStart, int iLimit, string strUserID, string strParentID, int iStatus, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" where 1=1");
            if (strUserID != "")
            {
                strWhere.AppendFormat(" and UserID='{0}'", strUserID);
            }
            if (iStatus != -1)
            {
                strWhere.AppendFormat(" and Status={0}", iStatus);
            }
            if (strParentID != "")
            {
                strWhere.AppendFormat(" and ParentID='{0}'", strParentID);
            }
            string strNumSQL  = string.Format("select count(ID) from SmsUser {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and ID not in (select top {0} id from SmsUser {1} order by id asc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} UserID,ParentID,Status,SendedNum,Balance,SignStr,CreatTime,UserName,CompanyName,Phone,ExtraInfo from SmsUser {1} {2} order by id asc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));
        }
Пример #4
0
        public DataSet GetIllegalList(int iStart, int iLimit, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" where 1=1");
            string strNumSQL  = string.Format("select count(ID) from SmsIllegal {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and ID not in (select top {0} id from SmsIllegal {1} order by id asc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} * from SmsIllegal {1} {2} order by id asc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));
        }
Пример #5
0
        public DataSet GetEasyScriptList(int iStart, int iLimit, string strMapID, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.AppendFormat(" where MapID='{0}'", strMapID);
            string strNumSQL  = string.Format("select count(id) from MapScriptDetail {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and ID not in (select top {0} id from MapScriptDetail {1} order by id asc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} * from MapScriptDetail {1} {2} order by id asc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));
        }
Пример #6
0
        public DataSet GetHistoryList(int iStart, int iLimit, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" where 1=1");
            string strNumSQL  = string.Format("select count(ID) from SmsHistory {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and ID not in (select top {0} id from SmsHistory {1} order by id asc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} UserID,ParentID,PhoneNum,FeeNum,SendResult,SpgateNo,PhoneList,MsgContent,SendTime,StatusString from SmsHistory {1} {2} order by id asc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));
        }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="iStart"></param>
        /// <param name="iLimit"></param>
        /// <param name="iType"></param>
        /// <param name="strUserID"></param>
        /// <param name="iTotalCount"></param>
        /// <returns></returns>
        public DataSet GetList(int iStart, int iLimit, int iType, string strUserID, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" where 1=1");
            if (strUserID != "")
            {
                strWhere.AppendFormat(" and ManagerID='{0}'", strUserID);
            }
            if (iType != -1)
            {
                strWhere.AppendFormat(" and ManagerType={0}", iType);
            }
            string strNumSQL  = string.Format("select count(ID) from SmsManager {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and ID not in (select top {0} id from SmsManager {1} order by id asc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} ManagerID,ManagerType,UserName,CreatTime,CompanyName,Address,Phone,ExtraInfo,Balance,Used,str(ManagerType)+','+ManagerID as PortPower from SmsManager {1} {2} order by id asc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));

            /*WhereClip where = SmsPlatForm.SmsManager.ID != -1;
             * if (iType != -1)
             * {
             *  where = SmsPlatForm.SmsManager.ManagerType == iType;
             * }
             * if (strUserID != "")
             * {
             *  where = where && SmsPlatForm.SmsManager.ManagerID == strUserID;
             * }
             * return MyDataBase.db.Select(SmsPlatForm.SmsManager, SmsPlatForm.SmsManager.ManagerID,
             *  SmsPlatForm.SmsManager.ManagerType,
             *  SmsPlatForm.SmsManager.UserName,
             *  SmsPlatForm.SmsManager.CompanyName,
             *  SmsPlatForm.SmsManager.Address,
             *  SmsPlatForm.SmsManager.Phone,
             *  SmsPlatForm.SmsManager.ExtraInfo).SetSelectRange(iLimit, iStart, SmsPlatForm.SmsManager.ID).Where(where).ToDataSet();*/
        }
Пример #8
0
        /************************************************************************/
        /*                                                                      */
        /************************************************************************/
        public DataSet GetMapScriptList(int iStart, int iLimit, string strMapName, int iType, ref int iTotalCount)
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" where 1=1");
            if (strMapName != "")
            {
                strWhere.AppendFormat(" and MapName ='{0}'", strMapName);
            }
            if (iType != -1)
            {
                strWhere.AppendFormat(" and ScriptType={0}", iType);
            }
            string strNumSQL  = string.Format("select count(ID) from MapScript {0}", strWhere.ToString());
            string strWhereEx = string.Format(" and ID not in (select top {0} id from MapScript {1} order by id asc)", iStart, strWhere.ToString());
            string strDataSQL = string.Format("select top {0} * from MapScript {1} {2} order by id asc",
                                              iLimit,
                                              strWhere.ToString(),
                                              strWhereEx
                                              );
            int iRet = -1;

            return(SmsPlatForm.GetSelectPageData(MyDataBase.db, out iRet, strNumSQL, strDataSQL, ref iTotalCount));
        }