Exemple #1
0
         public List<TFGroup> QueryAll(TFGroup m)
         {
             StringBuilder sbSql = new StringBuilder();
             StringBuilder sbKeySql = new StringBuilder();
             sbSql.AppendFormat(@"select rowid,groupName,groupCode,remark,kuser,kdate from t_fgroup");


             return _access.getDataTableForObj<TFGroup>(sbSql.ToString() + sbKeySql.ToString());
         }
Exemple #2
0
  public List<TFGroup> QueryAll(TFGroup m)
 {
     try
     {
         return _tfgroupDao.QueryAll(m);
     }
     catch (Exception ex)
     {
         throw new Exception("UserConditionMgr-->Add-->" + ex.Message, ex);
     }
 }
        /// <summary>
                     /// 获取群组列表+TFGroupList() 绑定下拉框
        /// </summary>
        /// <returns></returns>
          public HttpResponseBase TFGroupList() 
            {

                List<TFGroup> stores = new List<TFGroup>();

                string json = string.Empty;
                try
                {
                    TFGroup query = new TFGroup();

                    _tfgroup = new TFGroupMgr(mySqlConnectionString);
                    stores = _tfgroup.QueryAll(query);
                    IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();
                    //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式     
                    timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                    json = "{success:true,data:"+ JsonConvert.SerializeObject(stores, Formatting.Indented, timeConverter) + "}";//返回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,totalCount:0,data:[]}";
                }
                this.Response.Clear();
                this.Response.Write(json);
                this.Response.End();
                return this.Response;

            }