using System; using AIMSDAL; using AIMSModel; using AIMSObjectQuery; using System.Collections; using System.Collections.Generic; using System.Data; using HelperDB; namespace AIMSBLL { public partial class BCharges { public static DataTable GetDrugsByIds(string ids) { if (ids != null && ids.Length > 0) { string sql = string.Format("select * from Charges where IsValid=1 and Id in({0}) order by charindex(','+rtrim(cast(id as varchar(10)))+',',',{0},')", ids);//IsValid=1 and return DBHelper.GetDataTable(sql); } else { string sql = string.Format("select * from Charges where 1<>1 "); return DBHelper.GetDataTable(sql); } } public static DataTable SelectIdName(string str) { string sql = string.Empty; if (str == "") { sql = string.Format("select Id,Name,code,price,Bill from Charges where IsValid = 1"); } else { sql = string.Format("SELECT Top 26 e.Id,e.Name,code,price,Bill FROM Charges e WHERE (Lower(Name) like '%{0}%' OR Lower(HelpCode) like '%{0}%') and IsValid = 1", str); } return DBHelper.GetDataTable(sql); } } }