using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;

using HISClinic.DataModel;
using HISClinic.DataServices.Database;

namespace HISClinic.DataServices
{
	/// <summary>
	/// MedicineMapper 的摘要说明。
	/// </summary>
	public class MedicineMapper
	{

		public MedicineMapper()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}

		/// <summary>
		/// 获取所有的药品信息
		/// </summary>
		/// <returns></returns>
		public MedicinesEx GetMedicine()
		{
			MedicinesEx medicinesEx=new MedicinesEx();
			using(SqlConnection conn=HISDBConfig.GetNewConection())
			{
				SqlHelper.FillDataset(conn,"ut_GetMedicine",medicinesEx,new string[] {MedicinesEx.t_MedicineDataTableEx.TableName_Medicine},null);
			}
			return medicinesEx;
		}

        /// <summary>
        /// 药品用法
        /// </summary>
		public class CommonUsage
		{
			public CommonUsage()
			{

			}

			/// <summary>
			/// 获取药品用法
			/// </summary>
			/// <returns></returns>
			public CommonUsagesEx GetCommonUsage()
			{
				CommonUsagesEx  commonUsagesEx=new CommonUsagesEx();
				using(SqlConnection conn=HISDBConfig.GetNewConection())
				{
					SqlHelper.FillDataset(conn,"ut_GetCommonUsage",commonUsagesEx,new string[] {CommonUsagesEx.t_CommonUsageDataTableEx.TableName_CommonUsage},null);
				}
				return commonUsagesEx;
			}
		}
	}
}
