Пример #1
0
 public HttpResponseBase GetVendorName()
 {
     _IiplasMgr = new IplasMgr(mySqlConnectionString);
     List<Vendor> stores = new List<Vendor>();
     string json = string.Empty;
     try
     {
         Vendor query = new Vendor();
         string sql = string.Empty;
         if (!string.IsNullOrEmpty(Request.Params["type"]))
         {
             sql = "";
         }
         else
         {
             sql = " and assist = 1 ";
         }
         stores = _IiplasMgr.VendorQueryAll(query, sql);
         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,totalCount:0,data:[]}";
     }
     this.Response.Clear();
     this.Response.Write(json);
     this.Response.End();
     return this.Response;
 }
Пример #2
0
        // 廠商下拉列表
        public HttpResponseBase GetVendorName()
        {
            _IiplasMgr = new IplasMgr(mySqlConnectionString);
            List<Vendor> stores = new List<Vendor>();
            string json = string.Empty;
            try
            {
                Vendor query = new Vendor();
                stores = _IiplasMgr.VendorQueryAll(query);

                query.vendor_name_simple = "所有廠商名稱";
                stores.Insert(0, query);
                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,totalCount:0,data:[]}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;
        }