using System;
using System.Data;
using AVC.DataEntity;
using AVC.DataAccess;

namespace AVC.Business
{
	public class CarIllegalBiz
	{
		public static void AddCarIllegal(CarIllegal objCarIllegal)
		{
			CarIllegalInsert objCarIllegalDAL = new CarIllegalInsert();
			objCarIllegalDAL.ReceiveParameter(objCarIllegal);
			objCarIllegalDAL.ExecuteNonQuery();
			objCarIllegal.ID = objCarIllegalDAL.ID;
		}

		public static DataTable GetAllCarIllegal()
		{
			CarIllegalSelectAll objCarIllegalDAL = new CarIllegalSelectAll();
			return objCarIllegalDAL.ExecuteDataTable();
	    }
		
	    public static DataTable GetCarIllegalSelectAllPaged(int CurrentPage, out int TotalPage, out int TotalRecord, int PageSize, string SortBy)
	    {
	        CarIllegalSelectAllPaged objCarIllegalDAL = new CarIllegalSelectAllPaged();
	        objCarIllegalDAL.CurrentPage = CurrentPage;
	        objCarIllegalDAL.PageSize = PageSize;
	        objCarIllegalDAL.SortBy = SortBy;
	        DataTable CarIllegalTable =  objCarIllegalDAL.ExecuteDataTable();
	        TotalPage = objCarIllegalDAL.TotalPage;
	        TotalRecord = objCarIllegalDAL.TotalRecord;
	        return CarIllegalTable;
	     }

		public static void UpdateCarIllegal(CarIllegal objCarIllegal)
		{
			CarIllegalUpdate objCarIllegalDAL = new CarIllegalUpdate();
			objCarIllegalDAL.ReceiveParameter(objCarIllegal);
			objCarIllegalDAL.ExecuteNonQuery();
		}

		public static void DeleteCarIllegal(System.Int32 ID)
		{
			CarIllegalDelete objCarIllegalDAL = new CarIllegalDelete();
			objCarIllegalDAL.ID = ID;
			objCarIllegalDAL.ExecuteNonQuery();
		}

		public static CarIllegal GetCarIllegal(System.Int32 ID)
		{
			CarIllegalSelectByPk objCarIllegalDAL = new CarIllegalSelectByPk();
			CarIllegal objCarIllegal = new CarIllegal();
			objCarIllegalDAL.ID = ID;
			objCarIllegal.SetMetaDataTable(objCarIllegalDAL.ExecuteDataTable());
			return objCarIllegal;
		}
	}
}