예제 #1
0
 //获取combobox角色类型
 public object GetRoleTypeList()
 {
     List<P_Role> list = new List<P_Role>();
     StringBuilder strSQL = new StringBuilder();
     strSQL.Append(@"select ID,Name from P_Role where IsActive = 1");
     DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, strSQL.ToString(), null);
     if (ds.Tables[0].Rows.Count > 0)
     {
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             P_Role info = new P_Role();
             info.ID = Convert.ToInt32(dr["ID"]);
             info.Name = dr["Name"].ToString();
             list.Add(info);
         }
     }
     return list;
 }
예제 #2
0
 //获取车辆分站
 public object GetStationList()
 {
     List<P_Role> list = new List<P_Role>();
     StringBuilder sb = new StringBuilder();
     sb.Append(@"select 编码,名称 from TStation where 是否有效 = 1");
     DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
     if (ds.Tables[0].Rows.Count > 0)
     {
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             P_Role info = new P_Role();
             info.ID = Convert.ToInt32(dr["编码"]);
             info.Name = dr["名称"].ToString();
             list.Add(info);
         }
     }
     return list;
 }