38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Data;
 | |
| using System.Data.SqlClient;
 | |
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using AIMSModel;
 | |
| using AIMSObjectQuery;
 | |
| namespace AIMSDAL
 | |
| {
 | |
|     internal partial class DCharges
 | |
|     {
 | |
| 
 | |
|         public static List<Charges> GetChargsListByCodes(string ids)
 | |
|         {
 | |
|             string sql = "";
 | |
|             if (ids != null && ids.Length > 0)
 | |
|             {
 | |
|                 sql = string.Format("select * from Charges where Id in({0})  order by charindex(','+rtrim(Id)+',',',{1},') ", ids, ids.Replace("'", ""));
 | |
|             }
 | |
|             else
 | |
|             {
 | |
|                 sql = string.Format("select * from Charges  where 1<>1 ");
 | |
|             }
 | |
| 
 | |
|             using (SqlConnection conn = new SqlConnection(Connection.ConnectionString))
 | |
|             {
 | |
|                 conn.Open();
 | |
|                 using (SqlCommand cmd = conn.CreateCommand())
 | |
|                 {
 | |
|                     cmd.CommandText = sql;
 | |
|                     return ExcuteSelectCommand(cmd, RecursiveType.None, 0);
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|     }
 | |
| }
 |