Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="appTypeGuid"></param>
        /// <returns></returns>
        //		private static string GetClassByGuid(string appTypeGuid)
        //		{
        //			string strClass = string.Empty;
        //			string strSql = "SELECT LEFT(CLASS, 8) FROM APP_OPERATION_TYPE  WHERE APP_GUID = " + TSqlBuilder.Instance.CheckQuotationMark(appTypeGuid);
        //
        //			DataAccess da = new DataAccess(HGLogDefine.C_CONN_STRING);
        //
        //			using (da.dBContextInfo)
        //			{
        //				da.dBContextInfo.OpenConnection();
        //
        //				object obj = da.SqlDBHelper.ExecuteScalar(da.dBContextInfo.Context, CommandType.Text, strSql);
        //
        //				if(false==(obj is DBNull))
        //					strClass = (string)obj;
        //			}
        //
        //			return strClass;
        //		}

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static string GetClassForApp()
        {
            string strSql = "SELECT ISNULL(MAX(CLASS + 1), 1) FROM APP_LOG_TYPE WHERE LEN(CLASS) = 8";

            string strTemp = "00000000" + InnerCommon.ExecuteScalar(strSql).ToString();

            return(strTemp.Substring(strTemp.Length - 8, 8));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="appTypeGuid"></param>
        /// <param name="strSort"></param>
        /// <returns></returns>
        public static string GetNewClassValue(string appTypeGuid, string strSort)
        {
            string strSql = "SELECT ISNULL(MAX(CLASS + 1), 1) FROM APP_OPERATION_TYPE WHERE APP_GUID = "
                            + TSqlBuilder.Instance.CheckQuotationMark(appTypeGuid, true);

            string strTemp = "0000" + InnerCommon.ExecuteScalar(strSql).ToString();

            return(strSort + strTemp.Substring(strTemp.Length - 4, 4));
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="displayName"></param>
        /// <param name="strTableName"></param>
        /// <returns></returns>
        public static string GetGuidByDisplayName(string displayName, string strTableName)
        {
            string strGuid = string.Empty;
            string strSql  = "SELECT GUID FROM " + strTableName + " WHERE DISPLAYNAME = "
                             + TSqlBuilder.Instance.CheckQuotationMark(displayName, true);

            object obj = InnerCommon.ExecuteScalar(strSql);

            if (false == (obj is DBNull))
            {
                strGuid = (string)obj;
            }

            return(strGuid);
        }