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 CoreCmsPlanOrderBLL
|
{
|
ICoreCmsPlanOrderDAL _ICoreCmsPlanOrderDAL = null;
|
|
/// <summary>
|
/// 初始化构造
|
/// </summary>
|
public CoreCmsPlanOrderBLL()
|
{
|
//获取CoreCmsPlanOrder DAL实现
|
_ICoreCmsPlanOrderDAL = Factory.GetDALByInterfaceName(DALInterface.ICoreCmsPlanOrderDAL) as ICoreCmsPlanOrderDAL;
|
|
|
}
|
|
/// <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.CoreCmsPlanOrder m_CoreCmsPlanOrder)
|
{
|
try
|
{
|
|
return _ICoreCmsPlanOrderDAL.InserModel(m_CoreCmsPlanOrder);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 新增送货安排
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <param name="m_OA_CustomerCommunications"></param>
|
/// <param name="m_EC_AcceptWayByCustomers"></param>
|
/// <returns></returns>
|
public int InsertModelIden(CY.Model.CoreCmsPlanOrder m_CoreCmsPlanOrder)
|
{
|
try
|
{
|
|
return _ICoreCmsPlanOrderDAL.InsertModelIden(m_CoreCmsPlanOrder);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
|
|
|
/// <summary>
|
/// 修改送货安排
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool UpdateModel(CY.Model.CoreCmsPlanOrder m_CoreCmsPlanOrder)
|
{
|
try
|
{
|
return _ICoreCmsPlanOrderDAL.UpdateModel(m_CoreCmsPlanOrder);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 修改送货安排
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool UpdateModelOrderItem(CY.Model.CoreCmsPlanOrderItem m_CoreCmsPlanOrder)
|
{
|
try
|
{
|
return _ICoreCmsPlanOrderDAL.UpdateModelOrderItem(m_CoreCmsPlanOrder);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
|
/// <summary>
|
/// 修改送货安排
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool insertModelOrderItem(CY.Model.CoreCmsPlanOrderItem m_CoreCmsPlanOrder)
|
{
|
try
|
{
|
return _ICoreCmsPlanOrderDAL.insertModelOrderItem(m_CoreCmsPlanOrder);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 获取全部合作客户
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public IEnumerable<CoreCmsPlanOrder> GetModelList()
|
{
|
Query query = new Query();
|
return _ICoreCmsPlanOrderDAL.SelectAllModel(query);
|
}
|
|
|
/// <summary>
|
/// 根据formid获得信息
|
/// </summary>
|
/// <param name="Keyid">编号</param>
|
/// <returns></returns>
|
public IEnumerable<Model.CoreCmsPlanOrder> GetModelByformid(Guid formid)
|
{
|
|
return _ICoreCmsPlanOrderDAL.GetModelByformid(formid);
|
}
|
|
|
/// <summary>
|
/// 根据formid获得信息
|
/// </summary>
|
/// <param name="Keyid">编号</param>
|
/// <returns></returns>
|
public IEnumerable<Model.CoreCmsPlanOrder> GetModelByorderid(int orderid)
|
{
|
|
return _ICoreCmsPlanOrderDAL.GetModelByorderid(orderid);
|
}
|
|
/// <summary>
|
/// 根据formid获得信息
|
/// </summary>
|
/// <param name="Keyid">编号</param>
|
/// <returns></returns>
|
public IEnumerable<Model.CoreCmsPlanOrder> GetModelByids(string ids)
|
{
|
|
return _ICoreCmsPlanOrderDAL.GetModelByids(ids);
|
}
|
|
/// <summary>
|
/// 获取全部合作客户
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public CoreCmsPlanOrder GetModelByKeyid(int keyid)
|
{
|
|
return _ICoreCmsPlanOrderDAL.GetModelByKeyid(keyid);
|
}
|
|
/// <summary>
|
/// 删除合作客户
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool DeleteModel(CY.Model.CoreCmsPlanOrder rType)
|
{
|
try
|
{
|
_ICoreCmsPlanOrderDAL.DeleteModel(rType);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
|
/// <summary>
|
/// 查询合作客户分页列表
|
/// </summary>
|
/// <param name="pa"></param>
|
/// <returns></returns>
|
public IEnumerable<CoreCmsPlanOrder> SelectModelPage(Pagination pa, string orderkeyid, string status, string sheng, string shi, string quxian, string pianqu, string shipAddress, string shipName,
|
string shipMobile, string shouhuoAddress, string createTimeStart, string createTimeEnd )
|
{
|
string Condition = " and a.orderkeyid =" + orderkeyid + " ";
|
if (!string.IsNullOrEmpty(status))
|
Condition += " and a.status = '" + status + "'";
|
if (!string.IsNullOrEmpty(sheng))
|
Condition += " and a.sheng = '" + sheng + "'";
|
if (!string.IsNullOrEmpty(shi))
|
Condition += " and a.shi = '" + shi + "'";
|
if (!string.IsNullOrEmpty(quxian))
|
Condition += " and a.quxian = '" + quxian + "'";
|
if (!string.IsNullOrEmpty(pianqu))
|
Condition += " and a.pianqu like '%" + pianqu + "%'";
|
if (!string.IsNullOrEmpty(shipAddress))
|
Condition += " and a.shipAddress like '%" + shipAddress + "%'";
|
if (!string.IsNullOrEmpty(shipName))
|
Condition += " and a.shipName like '%" + shipName + "%'";
|
if (!string.IsNullOrEmpty(shipMobile))
|
Condition += " and a.shipMobile like '%" + shipMobile + "%'";
|
if (!string.IsNullOrEmpty(shouhuoAddress))
|
Condition += " and a.shouhuoAddress like '%" + shouhuoAddress + "%'";
|
|
if (!string.IsNullOrEmpty(createTimeStart))
|
Condition += " and DATEDIFF(day,a.[createTime],'" + createTimeStart + "')<=0 ";
|
|
if (!string.IsNullOrEmpty(createTimeEnd))
|
Condition += " and DATEDIFF(day,a.[createTime],'" + createTimeEnd + "')>=0 ";
|
|
|
|
Query query = new Query();
|
IList<Criterion> criterias = new List<Criterion>()
|
{
|
new Criterion("", Condition),
|
|
new Criterion("orderBy"," pianqu asc ")
|
};
|
query.Criteria = criterias;
|
return _ICoreCmsPlanOrderDAL.SelectModelPage(query, pa);
|
}
|
|
|
}
|
}
|