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.
176 lines
5.7 KiB
C#
176 lines
5.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using Estsh.Web.Util;
|
|
using System.Data;
|
|
using Estsh.Web.Dal;
|
|
using System.Collections;
|
|
using Estsh.Web.Models;
|
|
using ApServerProvider;
|
|
|
|
/***************************************************************************************************
|
|
*
|
|
* 作者:王勇
|
|
*
|
|
* *************************************************************************************************/
|
|
namespace Estsh.Core.Services
|
|
{
|
|
/// <summary>
|
|
/// 菜单业务处理类
|
|
/// </summary>
|
|
public class SeedPartDefineService
|
|
{
|
|
private SeedPartDefineDal dal = new SeedPartDefineDal(RemotingProxyProvider._remotingProxy);
|
|
private RemotingProxy.RecordStatus _recordStatus
|
|
= RemotingProxy.RecordStatus.Enable;
|
|
/// <summary>
|
|
/// 根据分页条件获取分页菜单数据
|
|
/// </summary>
|
|
/// <param name="SeedPartDefineName"></param>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction"></param>
|
|
/// <param name="sort"></param>
|
|
/// <returns></returns>
|
|
public Hashtable getSeedPartDefineListByPage(String FuLingJianHao, String ZiJieLingJianHao, Pager pager, String direction, String sort)
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
String strWhere = " 1=1 ";
|
|
if (FuLingJianHao != null && !FuLingJianHao.Trim().Equals(""))
|
|
{
|
|
strWhere = " and b.part_no = '" + FuLingJianHao + "' ";
|
|
}
|
|
if (ZiJieLingJianHao != null && !ZiJieLingJianHao.Trim().Equals(""))
|
|
{
|
|
strWhere += " and c.part_no = '" + ZiJieLingJianHao + "' ";
|
|
}
|
|
String orderBy = "";
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
{
|
|
orderBy += sort + " " + direction;
|
|
}
|
|
else
|
|
{
|
|
orderBy += " b.part_no " + direction;
|
|
}
|
|
result = dal.getListByPage(_recordStatus,pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int saveSeedPartDefine(Hashtable htParams)
|
|
{
|
|
return dal.saveSeedPartDefine(htParams);
|
|
}
|
|
/// <summary>
|
|
/// 更新菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int updateSeedPartDefine(Hashtable htParams)
|
|
{
|
|
return dal.updateSeedPartDefine(htParams);
|
|
}
|
|
|
|
public DataTable GetPartMessage(string aPartNo)
|
|
{
|
|
return dal.GetPartMessage(aPartNo);
|
|
}
|
|
|
|
public bool GetPartID(string aPartID, string aSubPartID)
|
|
{
|
|
return dal.GetPartID(aPartID, aSubPartID);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查看详情
|
|
/// </summary>
|
|
/// <param name="ruid"></param>
|
|
/// <returns></returns>
|
|
public ArrayList getSeedPartDefine(String part_id)
|
|
{
|
|
part_id = "part_id = " + part_id;
|
|
DataTable dt = dal.getList(part_id, "");
|
|
ArrayList result = DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除菜单
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
public int deleteSeedPartDefine(String ids)
|
|
{
|
|
String[] idArray = ids.Split(',');
|
|
int count = 0;
|
|
foreach (String id in idArray)
|
|
{
|
|
if (!"".Equals(id))
|
|
{
|
|
count += this.dal.deleteSeedPartDefine(id);
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取下拉框中的菜单数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList getSelectSeedPartDefine()
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
|
|
DataTable dt = dal.getSelectSeedPartDefine();
|
|
|
|
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据分页条件获取分页客户订单数据
|
|
/// </summary>
|
|
/// <param name="menuName">查询条件</param>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction">排序方式</param>
|
|
/// <param name="sort">排序字段</param>
|
|
/// <returns></returns>
|
|
public DataTable getTableListByPage(String FuLingJianHao, String ZiJieLingJianHao, Pager pager, String direction, String sort, Boolean isPage)
|
|
{
|
|
DataTable result = null;
|
|
String strWhere = " 1=1 ";
|
|
int rowCount = 0;
|
|
if (FuLingJianHao != null && !FuLingJianHao.Trim().Equals(""))
|
|
{
|
|
strWhere = " and b.part_no = '" + FuLingJianHao + "' ";
|
|
}
|
|
if (ZiJieLingJianHao != null && !ZiJieLingJianHao.Trim().Equals(""))
|
|
{
|
|
strWhere += " and c.part_no = '" + ZiJieLingJianHao + "' ";
|
|
}
|
|
String orderBy = "";
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
{
|
|
orderBy += sort + " " + direction;
|
|
}
|
|
else
|
|
{
|
|
orderBy += " b.part_no " + direction;
|
|
}
|
|
if (isPage)
|
|
{
|
|
rowCount = pager.pageSize;
|
|
}
|
|
else
|
|
{
|
|
rowCount = pager.pageSize;
|
|
}
|
|
result = dal.getTableListByPage(rowCount, pager.pageNo, strWhere, sort + " " + direction);
|
|
return result;
|
|
}
|
|
}
|
|
} |