/**
* Adm_zhanghaomimaBLL.cs
*
* 功 能: 合作客户业务逻辑类
* 类 名: Adm_zhanghaomimaBLL
*
* Ver 变更日期 负责人 变更内容
* ───────────────────────────────────
* V0.01 2013-4-2 15:11 吴辉 初版
* V0.02 2013-5-29 17:43 吴崎均 增加转换在线会员为厂商客户方法
*
*
*
*
*
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CY.IDAL;
using CY.Model;
using AbstractFactory;
using CY.IBaseDAL;
using CY.Infrastructure.DESEncrypt;
using CY.Infrastructure.Query;
namespace CY.BLL
{
public class Adm_zhanghaomimaBLL
{
IAdm_zhanghaomimaDAL _IAdm_zhanghaomimaDAL = null;
///
/// 初始化构造
///
public Adm_zhanghaomimaBLL()
{
//获取Adm_zhanghaomima DAL实现
_IAdm_zhanghaomimaDAL = Factory.GetDALByInterfaceName(DALInterface.IAdm_zhanghaomimaDAL) as IAdm_zhanghaomimaDAL;
}
///
/// 新增送货安排
///
///
///
///
///
public bool InsertModel(CY.Model.Adm_zhanghaomima m_Adm_zhanghaomima)
{
try
{
return _IAdm_zhanghaomimaDAL.InserModel(m_Adm_zhanghaomima);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 修改送货安排
///
///
///
public bool UpdateModel(CY.Model.Adm_zhanghaomima m_Adm_zhanghaomima)
{
try
{
return _IAdm_zhanghaomimaDAL.UpdateModel(m_Adm_zhanghaomima);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 获取全部合作客户
///
/// 主键id
///
public IEnumerable GetModelList()
{
Query query = new Query();
return _IAdm_zhanghaomimaDAL.SelectAllModel(query);
}
///
/// 根据formid获得信息
///
/// 编号
///
public IEnumerable GetModelByformid(Guid formid)
{
return _IAdm_zhanghaomimaDAL.GetModelByformid(formid);
}
///
/// 获取全部合作客户
///
/// 主键id
///
public Adm_zhanghaomima GetModelByKeyid(int keyid)
{
return _IAdm_zhanghaomimaDAL.GetModelByKeyid(keyid);
}
///
/// 删除合作客户
///
///
///
public bool DeleteModel(CY.Model.Adm_zhanghaomima rType)
{
try
{
_IAdm_zhanghaomimaDAL.DeleteModel(rType);
}
catch (Exception ex)
{
throw ex;
}
return true;
}
///
/// 查询合作客户分页列表
///
///
///
public IEnumerable SelectModelPage(Pagination pa, Guid FirmId, string type_id, string chanpinxiangmu)
{
string Condition = " and ok.FirmId ='" + FirmId + "' and ok.rec_status = 'A' ";
if (!string.IsNullOrEmpty(type_id))
{
Condition += " and ok.type_id = " + type_id + "";
}
if (!string.IsNullOrEmpty(chanpinxiangmu))
{
Condition += " and ok.chanpinxiangmu like '%" + chanpinxiangmu + "%'";
}
Query query = new Query();
IList criterias = new List()
{
new Criterion("", Condition),
new Criterion("orderBy"," createtime desc ")
};
query.Criteria = criterias;
return _IAdm_zhanghaomimaDAL.SelectModelPage(query, pa);
}
}
}