Beispiel #1
0
        public static string GetType(int menuId)
        {
            string query  = string.Format("select Type from vw_Menu where Id = {0}", menuId);
            var    result = DataAccessHelpers.ExecuteScalar(query);

            if (result.Code < 0)
            {
                LogHelpers.Log.Error(result.ErrorMessage);
            }

            return(result.Data == null ? "" : result.Data.ToString());
        }
Beispiel #2
0
        public static ResultBOL <object> GetMenuName(int menuId)
        {
            string query = string.Format("select Name_VN from vw_Menu where Id = {0}", menuId);

            if (Utilities.IsLangueEN())
            {
                query = string.Format("select Name_EN from vw_Menu where Id = {0}", menuId);
            }

            var result = DataAccessHelpers.ExecuteScalar(query);

            return(result);
        }
Beispiel #3
0
        public static int GetId(string type)
        {
#if DEBUG
            _log.Debug("type: {0}", type);
#endif
            string             query  = string.Format("select Id from Menu where [Type] like '{0}' and (ParentId is null or ParentId < 1)", type);
            ResultBOL <object> result = DataAccessHelpers.ExecuteScalar(query);
            if (result.Code < 0)
            {
                _log.Error(result.ErrorMessage);
            }
            else if (result.Data != null)
            {
                return(int.Parse(result.Data.ToString()));
            }

            return(int.MinValue);
        }