コード例 #1
0
ファイル: MemberEventMgr.cs プロジェクト: lxh2014/gigade-net
 /// <summary>
 /// 會員等級列表
 /// </summary>
 /// <param name="ml"></param>
 /// <returns></returns>
 public DataTable GetMemberLevelList(MemberLevel ml)
 {
     try
     {
         return _MemberEventDao.GetMemberLevelList(ml);
     }
     catch (Exception ex)
     {
         throw new Exception("MemberEventMgr-->GetMemberLevelList-->" + ex.Message, ex);
     }
 }
コード例 #2
0
ファイル: MemberEventDao.cs プロジェクト: lxh2014/gigade-net
        /// <summary>
        /// 查詢會員等級列表
        /// </summary>
        /// <param name="ml"></param>
        /// <returns></returns>
        public DataTable GetMemberLevelList(MemberLevel ml)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendFormat(@"SELECT ml_code,ml_name FROM member_level WHERE 1=1 ");
            if (ml.ml_status != 0)
            {
                sql.AppendFormat(@" AND ml_status=1; ");
            }
            try
            {
                return _access.getDataTable(sql.ToString());
            }
            catch (Exception ex)
            {
                throw new Exception("MemberEventDao-->GetMemberLevelList" + ex.Message + sql.ToString(), ex);
            }

        }
コード例 #3
0
        /// <summary>
        /// 獲得會員等級數據
        /// </summary>
        /// <returns></returns>
        public HttpResponseBase GetMemberLevelDownList()
        {
            string json = string.Empty;
            MemberLevel me = new MemberLevel();
            try
            {
                _memberEvent = new MemberEventMgr(mySqlConnectionString);
                me.ml_status = 1;
                DataTable dt = _memberEvent.GetMemberLevelList(me);
                json = "{success:true,data:" + JsonConvert.SerializeObject(dt, Formatting.Indented) + "}";//返回json數據
            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                json = "{success:false,data:[]}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;

        }