You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
4.7 KiB
C#
156 lines
4.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using Estsh.Web.Dal;
|
|
using Estsh.Web.Util;
|
|
using System.Collections;
|
|
using System.Data;
|
|
|
|
|
|
namespace Estsh.Core.Services
|
|
{
|
|
public class EDIRelationshipDefineService
|
|
{
|
|
EDIRelationshipDefineDal dal = new EDIRelationshipDefineDal(RemotingProxyProvider._remotingProxy);
|
|
|
|
|
|
/// <summary>
|
|
/// 获取配置名称
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList GetModelName()
|
|
{
|
|
return dal.GetModelName();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 根据分页条件获取分页菜单数据
|
|
/// </summary>
|
|
/// <param name="PartMasterName"></param>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction"></param>
|
|
/// <param name="sort"></param>
|
|
/// <returns></returns>
|
|
public Hashtable getEDIRelationshipListByPage( String model_name, String edi_model_name, Pager pager, String direction, String sort)
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
String strWhere = " 1=1 ";
|
|
|
|
if (model_name != null && !model_name.Trim().Equals(""))
|
|
{
|
|
strWhere += " and b.model_name like '%" + model_name.Trim() + "%'";
|
|
}
|
|
|
|
if (edi_model_name != null && !edi_model_name.Trim().Equals(""))
|
|
{
|
|
strWhere += " and a.edi_model_name like '%" + edi_model_name.Trim() + "%'";
|
|
}
|
|
String orderBy = "";
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
{
|
|
orderBy += sort + " " + direction;
|
|
}
|
|
else
|
|
{
|
|
orderBy += " a.ruid " + direction;
|
|
}
|
|
result = dal.getEDIRelationshipListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int saveModelType(Hashtable htParams)
|
|
{
|
|
return dal.saveModelType(htParams);
|
|
}
|
|
/// <summary>
|
|
/// 更新菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int updateModelType(Hashtable htParams)
|
|
{
|
|
return dal.updateModelType(htParams);
|
|
}
|
|
/// <summary>
|
|
/// 删除菜单
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
public int deleteModelType(String ids)
|
|
{
|
|
String[] idArray = ids.Split(',');
|
|
int count = 0;
|
|
foreach (String id in idArray)
|
|
{
|
|
if (!"".Equals(id))
|
|
{
|
|
count += this.dal.deleteModelType(id);
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
|
|
public int GetModelID(string model_name)
|
|
{
|
|
return dal.GetModelID(model_name);
|
|
}
|
|
|
|
public Hashtable getModelTypeDetail(String ruid)
|
|
{
|
|
ruid = " ruid = " + ruid;
|
|
DataTable dt = dal.getList(ruid, "");
|
|
Hashtable result = new Hashtable();
|
|
|
|
result.Add("ruid", dt.Rows[0]["ruid"]);
|
|
result.Add("model_name", dt.Rows[0]["model_name"]);
|
|
result.Add("edi_model_name", dt.Rows[0]["edi_model_name"]);
|
|
return result;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 根据分页条件获取分页菜单数据(导出时使用)
|
|
/// </summary>
|
|
/// <param name="ModelPartName"></param>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction"></param>
|
|
/// <param name="sort"></param>
|
|
/// <returns></returns>
|
|
public DataTable getShippingExport( String model_name, String edi_model_name, Pager pager, String direction, String sort)
|
|
{
|
|
DataTable result = null;
|
|
string strWhere = " 1=1 ";
|
|
if (model_name != null && !model_name.Trim().Equals(""))
|
|
{
|
|
strWhere += " and b.model_name like '%" + model_name.Trim() + "%'";
|
|
}
|
|
|
|
if (edi_model_name != null && !edi_model_name.Trim().Equals(""))
|
|
{
|
|
strWhere += " and a.edi_model_name like '%" + edi_model_name.Trim() + "%'";
|
|
}
|
|
|
|
String orderBy = "";
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
{
|
|
orderBy += sort + " " + direction;
|
|
}
|
|
else
|
|
{
|
|
orderBy += " f.cust_pdline_name " + direction;
|
|
}
|
|
result = dal.getShippingExport(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
}
|