Esempio n. 1
0
        /// <summary>
        /// 根据日期统计过车数据
        /// </summary>
        /// <param name="datetime"></param>
        /// <returns></returns>
        public string GetPassCarCountDay(string datetime)
        {
            string mySql = string.Empty;

            try
            {
                mySql = " select CONVERT(IFNULL(SUM(ll),'0'),DECIMAL) AS ll from t_tgs_flow_day_count  where   rq=STR_TO_DATE('" + datetime + "' , '%Y-%m-%d')";
                return(dataAccess.Get_DataString(mySql, 0));
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(mySql + ex.Message);
                return("0");
            }
        }
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public string GetUserInfo(string userName, string pwd)
        {
            string mySql = string.Empty;

            try
            {
                mySql = "select  usercode from t_ser_register where username= '******' and password='******'";
                return(dataAccess.Get_DataString(mySql, 0));
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(mySql + ex.Message);
                return("");
            }
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="fieldName"></param>
        /// <param name="fieldValue"></param>
        /// <returns></returns>
        private int GeXhExist(string tableName, string fieldName, string fieldValue)
        {
            string mySql = string.Empty;

            try
            {
                mySql = "select count(1) from   " + tableName + "   where   " + fieldName + "  ='" + fieldValue + "'";
                return(int.Parse(dataAccess.Get_DataString(mySql, 0)));
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(mySql + ex.Message);
                return(-1);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// 执行获得stringSQL操作
 /// </summary>
 /// <param name="mySql"></param>
 /// <returns></returns>
 public string GetString(string mySql)
 {
     try
     {
         return(dataAccess.Get_DataString(mySql));
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex.Message);
         return(null);
     }
 }
Esempio n. 5
0
        /// <summary>
        /// 判断该车辆是否存在
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <returns></returns>
        private int GeHphmExist(string tableName, string hphm, string hpzl)
        {
            string mySql = string.Empty;

            try
            {
                mySql = "select count(1) from   " + tableName + "   where  hphm  ='" + hphm + "' and hpzl= '" + hpzl + "'";
                return(int.Parse(dataAccess.Get_DataString(mySql, 0)));
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(mySql + ex.Message);
                return(-1);
            }
        }
Esempio n. 6
0
        public bool Exists(string roadid)
        {
            StringBuilder strSql = new StringBuilder();

            try
            {
                strSql.Append("select count(1) from t_gis_road");
                strSql.Append(" where roadid='" + roadid + "' ");
                int res = int.Parse(dataAccess.Get_DataString(strSql.ToString(), 0));
                if (res > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(strSql.ToString() + ex.Message);
                return(false);
            }
        }