public HttpResponseBase GetShopClass()
        {
            List<ShopClass> stores = new List<ShopClass>();
            string json = string.Empty;
            try
            {

                IShopClassImplMgr _shopClassMgr = new ShopClassMgr(connectionString);

                stores = _shopClassMgr.QueryStore();
                ShopClass Dmodel = new ShopClass();
                Dmodel.class_name = "不分";
                stores.Insert(0, Dmodel);
                json = "{success:true,data:" + JsonConvert.SerializeObject(stores) + "}";//返回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:true,data:[]}";
            }


            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;

        }
Exemple #2
0
 public List<ShopClass> QueryAll(ShopClass query)
 {
     return _shopClassDao.QueryAll(query);
 }