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

namespace AVC.Passport
{
	public class CompanyInfoBiz
	{
		public static void AddCompanyInfo(CompanyInfo objCompanyInfo)
		{
			CompanyInfoInsert objCompanyInfoDAL = new CompanyInfoInsert();
			objCompanyInfoDAL.ReceiveParameter(objCompanyInfo);
			objCompanyInfoDAL.ExecuteNonQuery();
			objCompanyInfo.CompanyID = objCompanyInfoDAL.CompanyID;
		}

		public static DataTable GetAllCompanyInfo()
		{
			CompanyInfoSelectAll objCompanyInfoDAL = new CompanyInfoSelectAll();
			return objCompanyInfoDAL.ExecuteDataTable();
		}

		public static void UpdateCompanyInfo(CompanyInfo objCompanyInfo)
		{
			CompanyInfoUpdate objCompanyInfoDAL = new CompanyInfoUpdate();
			objCompanyInfoDAL.ReceiveParameter(objCompanyInfo);
			objCompanyInfoDAL.ExecuteNonQuery();
		}

		public static void DeleteCompanyInfo(System.Int32 CompanyID)
		{
			CompanyInfoDelete objCompanyInfoDAL = new CompanyInfoDelete();
			objCompanyInfoDAL.CompanyID = CompanyID;
			objCompanyInfoDAL.ExecuteNonQuery();
		}

		public static CompanyInfo GetCompanyInfo(System.Int32 CompanyID)
		{
			CompanyInfoSelectByPk objCompanyInfoDAL = new CompanyInfoSelectByPk();
			CompanyInfo objCompanyInfo = new CompanyInfo();
			objCompanyInfoDAL.CompanyID = CompanyID;
			objCompanyInfo.SetMetaDataTable(objCompanyInfoDAL.ExecuteDataTable());
			return objCompanyInfo;
		}
	}
}