using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CY.IDAL;
using CY.Model;
using System.Collections;
using System.Transactions;
using System.Data;
namespace CY.BLL
{
public class OA_SuppliersOtherQualificationBLL
{
IOA_SuppliersOtherQualificationDAL SuppliersOtherQualificationDAL = null;
public OA_SuppliersOtherQualificationBLL()
{
SuppliersOtherQualificationDAL = AbstractFactory.Factory.GetDALByInterfaceName(AbstractFactory.DALInterface.IOA_SuppliersOtherQualificationDAL) as IOA_SuppliersOtherQualificationDAL;
}
///
/// 插入一个其他资质
///
///
///
public bool InsertModel(OA_SuppliersOtherQualification model)
{
return SuppliersOtherQualificationDAL.InserModel(model);
}
///
/// 删除对应供应商的全部资质
///
///
///
public int DeleteAllModel(string SupplierId)
{
return SuppliersOtherQualificationDAL.DeleteAll(SupplierId);
}
///
/// 批量插入其他资质
///
///
///
///
public bool InsertModelList(ArrayList arry,string SupplierId)
{
DeleteAllModel(SupplierId);
bool isSuccess = true;
using (TransactionScope scope = new TransactionScope())
{
for (int i = 0; i < arry.Count; i++)
{
isSuccess = InsertModel(arry[i] as OA_SuppliersOtherQualification);
if (!isSuccess)
{
break;
}
}
if (isSuccess)
{
scope.Complete();
}
}
return isSuccess;
}
///
/// 返回供应商对应的其他资质
///
///
///
public DataTable selectOtherQuBySuppliersId(string SupplierId)
{
return SuppliersOtherQualificationDAL.selectOtherQuBySuppliersId(SupplierId);
}
}
}