|
/**
|
* OA_KaipiaonewBLL.cs
|
*
|
* 功 能: 合作客户业务逻辑类
|
* 类 名: OA_KaipiaonewBLL
|
*
|
* 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 OA_KaipiaonewBLL
|
{
|
IOA_KaipiaonewDAL _IOA_KaipiaonewDAL = null;
|
|
/// <summary>
|
/// 初始化构造
|
/// </summary>
|
public OA_KaipiaonewBLL()
|
{
|
//获取OA_Kaipiaonew DAL实现
|
_IOA_KaipiaonewDAL = Factory.GetDALByInterfaceName(DALInterface.IOA_KaipiaonewDAL) as IOA_KaipiaonewDAL;
|
|
|
}
|
|
/// <summary>
|
/// 新增送货安排
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <param name="m_OA_CustomerCommunications"></param>
|
/// <param name="m_EC_AcceptWayByCustomers"></param>
|
/// <returns></returns>
|
public bool InsertModel(CY.Model.OA_Kaipiaonew m_OA_Kaipiaonew)
|
{
|
try
|
{
|
|
return _IOA_KaipiaonewDAL.InserModel(m_OA_Kaipiaonew);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 修改送货安排
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool UpdateModel(CY.Model.OA_Kaipiaonew m_OA_Kaipiaonew)
|
{
|
try
|
{
|
return _IOA_KaipiaonewDAL.UpdateModel(m_OA_Kaipiaonew);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 获取全部合作客户
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public IEnumerable<OA_Kaipiaonew> GetModelList()
|
{
|
Query query = new Query();
|
return _IOA_KaipiaonewDAL.SelectAllModel(query);
|
}
|
|
|
/// <summary>
|
/// 根据SellerOrderId获得信息
|
/// </summary>
|
/// <param name="SellerOrderId">编号</param>
|
/// <returns></returns>
|
public IEnumerable<Model.OA_Kaipiaonew> GetModelBySellerOrderId(int SellerOrderId)
|
{
|
|
return _IOA_KaipiaonewDAL.GetModelBySellerOrderId(SellerOrderId);
|
}
|
|
/// <summary>
|
/// 获取全部合作客户
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public OA_Kaipiaonew GetModelByKeyid(int keyid)
|
{
|
|
return _IOA_KaipiaonewDAL.GetModelByKeyid(keyid);
|
}
|
|
/// <summary>
|
/// 删除合作客户
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool DeleteModel(CY.Model.OA_Kaipiaonew rType)
|
{
|
try
|
{
|
_IOA_KaipiaonewDAL.DeleteModel(rType);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
|
/// <summary>
|
/// 查询合作客户分页列表
|
/// </summary>
|
/// <param name="pa"></param>
|
/// <returns></returns>
|
public IEnumerable<OA_Kaipiaonew> SelectModelPage(Pagination pa, Guid FirmId, string CreateTimeStart, string CreateTimeEnd,
|
string Kaipiaoshenqing, string Kehuqianshou, string BusinessManagerId, string CustormerName, string Chexiaozhuangtai,string shifouyuqi)
|
{
|
string Condition = " and ok.FirmId ='" + FirmId + "' ";
|
|
if (!string.IsNullOrEmpty(CreateTimeStart))
|
Condition += " and DATEDIFF(day,ok.[CreateTime],'" + CreateTimeStart + "')<=0 ";
|
|
if (!string.IsNullOrEmpty(CreateTimeEnd))
|
Condition += " and DATEDIFF(day,ok.[CreateTime],'" + CreateTimeEnd + "')>=0 ";
|
if (!string.IsNullOrEmpty(CustormerName))
|
Condition += " and oe.CompanyName like '%" + CustormerName + "%'";
|
if (!string.IsNullOrEmpty(BusinessManagerId))
|
Condition += " and ok.BusinessManagerId = '" + BusinessManagerId + "'";
|
if (!string.IsNullOrEmpty(Kaipiaoshenqing))
|
Condition += " and ok.Kaipiaoshenqing = '" + Kaipiaoshenqing + "'";
|
|
if (!string.IsNullOrEmpty(Chexiaozhuangtai))
|
Condition += " and ok.Chexiaozhuangtai = '" + Chexiaozhuangtai + "'";
|
|
if (!string.IsNullOrEmpty(Kehuqianshou))
|
Condition += " and ok.Kehuqianshou = '" + Kehuqianshou + "'";
|
|
|
if (!string.IsNullOrEmpty(shifouyuqi))
|
{
|
if(shifouyuqi == "1")
|
{
|
Condition += " DATEDIFF(month,[CreateTime], '"+DateTime.Now.ToString("yyyy-MM-dd")+"')=0 ";
|
}
|
else if(shifouyuqi == "2")
|
{
|
Condition += " DATEDIFF(month,[CreateTime], '" + DateTime.Now.ToString("yyyy-MM-dd") + "')>0 ";
|
}
|
}
|
|
|
|
Query query = new Query();
|
IList<Criterion> criterias = new List<Criterion>()
|
{
|
new Criterion("", Condition),
|
|
new Criterion("orderBy"," CreateTime desc ")
|
};
|
query.Criteria = criterias;
|
return _IOA_KaipiaonewDAL.SelectModelPage(query, pa);
|
}
|
|
}
|
}
|