Esempio n. 1
0
        public static String GetUserPreference(int userID, int siteID, int programID, string preferenceType)
        {
            String _result = string.Empty;

            using (var db = new Data.DBMEdition01Context())
            {
                ExceptionLogServices exceptionLog = new ExceptionLogServices();
                try
                {
                    var _ret = db.ApiGetUserPreference(userID, siteID, programID, preferenceType);

                    if (_ret.Count > 0)
                    {
                        _result = _ret.FirstOrDefault().PreferenceValue;
                    }
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiMobileSaveTracerResponse(" + userID + "," + siteID + "," + programID + "," + preferenceType + ")";
                    string methodName = "JCRAPI/Business/UserServices/MenuStateInit";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, userID, siteID, sqlParam, string.Empty);

                    return(null);
                }
            }

            return(_result);
        }