/**
* OA_BaozhengjinBLL.cs
*
* 功 能: 合作客户业务逻辑类
* 类 名: OA_BaozhengjinBLL
*
* 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_BaozhengjinBLL
{
IOA_BaozhengjinDAL _IOA_BaozhengjinDAL = null;
///
/// 初始化构造
///
public OA_BaozhengjinBLL()
{
//获取OA_Baozhengjin DAL实现
_IOA_BaozhengjinDAL = Factory.GetDALByInterfaceName(DALInterface.IOA_BaozhengjinDAL) as IOA_BaozhengjinDAL;
}
///
/// 新增送货安排
///
///
///
///
///
public bool InsertModel(CY.Model.OA_Baozhengjin m_OA_Baozhengjin)
{
try
{
return _IOA_BaozhengjinDAL.InserModel(m_OA_Baozhengjin);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 修改送货安排
///
///
///
public bool UpdateModel(CY.Model.OA_Baozhengjin m_OA_Baozhengjin)
{
try
{
return _IOA_BaozhengjinDAL.UpdateModel(m_OA_Baozhengjin);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 获取全部合作客户
///
/// 主键id
///
public IEnumerable GetModelList()
{
Query query = new Query();
return _IOA_BaozhengjinDAL.SelectAllModel(query);
}
///
/// 根据formid获得信息
///
/// 编号
///
public IEnumerable GetModelByformid(Guid formid)
{
return _IOA_BaozhengjinDAL.GetModelByformid(formid);
}
///
/// 获取全部合作客户
///
/// 主键id
///
public OA_Baozhengjin GetModelByKeyid(int keyid)
{
return _IOA_BaozhengjinDAL.GetModelByKeyid(keyid);
}
///
/// 删除合作客户
///
///
///
public bool DeleteModel(CY.Model.OA_Baozhengjin rType)
{
try
{
_IOA_BaozhengjinDAL.DeleteModel(rType);
}
catch (Exception ex)
{
throw ex;
}
return true;
}
///
/// 查询合作客户分页列表
///
///
///
public IEnumerable SelectModelPage(Pagination pa, Guid FirmId, string CreateTimeStart, string CreateTimeEnd,
string Zhanghuleixing, string Fukuanzhanghu, string Shoukuandanwei, string remark, string TuikuanStatus)
{
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(Zhanghuleixing))
Condition += " and ok.ReceiveWay = '" + Zhanghuleixing + "'";
if (!string.IsNullOrEmpty(Fukuanzhanghu))
Condition += " and ok.Account = " + Fukuanzhanghu + " ";
if (!string.IsNullOrEmpty(Shoukuandanwei))
Condition += " and ok.Shoukuandanwei like '%" + Shoukuandanwei + "%' ";
if (!string.IsNullOrEmpty(remark))
Condition += " and ok.remark like '%" + remark + "%' ";
if (!string.IsNullOrEmpty(TuikuanStatus))
Condition += " and ok.[TuikuanStatus] = '" + TuikuanStatus + "'";
Query query = new Query();
IList criterias = new List()
{
new Criterion("", Condition),
new Criterion("orderBy"," CreateTime desc ")
};
query.Criteria = criterias;
return _IOA_BaozhengjinDAL.SelectModelPage(query, pa);
}
///
/// 查询合作客户分页列表
///
///
///
public IEnumerable SelectModelPageweikaipiao(Pagination pa, Guid FirmId, string CreateTimeStart, string CreateTimeEnd,
string Creater, string SupplierName, string shifoufukuan, string selFukuanyongtu)
{
string Condition = " and ok.FirmId ='" + FirmId + "' and ok.ApprovalStatus = 1 and ok.Youwufapiao !=2 and ok.FukuanStatus = 2 ";
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(Creater))
Condition += " and ok.Creater like '%" + Creater + "%'";
if (!string.IsNullOrEmpty(SupplierName))
Condition += " and ok.SupplierName like '%" + SupplierName + "%' ";
if (!string.IsNullOrEmpty(shifoufukuan))
Condition += " and ok.FukuanStatus = '" + shifoufukuan + "'";
if (!string.IsNullOrEmpty(selFukuanyongtu))
Condition += " and ok.[Fukuanyongtu] = '" + selFukuanyongtu + "'";
Query query = new Query();
IList criterias = new List()
{
new Criterion("", Condition),
new Criterion("orderBy"," CreateTime desc ")
};
query.Criteria = criterias;
return _IOA_BaozhengjinDAL.SelectModelPage(query, pa);
}
}
}