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.
119 lines
3.6 KiB
C#
119 lines
3.6 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;
|
|
|
|
|
|
namespace Estsh.Core.Services
|
|
{
|
|
public class CustProductDefineService
|
|
{
|
|
/***************************************************************************
|
|
*
|
|
* 客户产线定义
|
|
* Noah
|
|
*
|
|
*****************************************************************************/
|
|
private CustProductDefineDal dal = new CustProductDefineDal(RemotingProxyProvider._remotingProxy);
|
|
|
|
public Hashtable getCustProdutionListByPage(String cust_pdline_name, Pager pager, String direction, String sort)
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
|
|
string strWhere = " 1=1 ";
|
|
if (!string.IsNullOrEmpty(cust_pdline_name))
|
|
{
|
|
strWhere = " cust_pdline_name LIKE '%" + cust_pdline_name.Trim() + "%' ";
|
|
}
|
|
|
|
String orderBy = "";
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
{
|
|
orderBy += sort + " ";
|
|
}
|
|
else
|
|
{
|
|
orderBy += " seq ";
|
|
}
|
|
result = dal.getCustProdutionListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取分页总数量
|
|
/// </summary>
|
|
/// <param name="menuName"></param>
|
|
/// <returns></returns>
|
|
public int getMenuCount(String menuName)
|
|
{
|
|
if (menuName != null && !menuName.Trim().Equals(""))
|
|
{
|
|
menuName = " cust_pdline_name like '%" + menuName.Trim() + "%'";
|
|
}
|
|
else
|
|
{
|
|
menuName = "";
|
|
}
|
|
return dal.getCountWhere(menuName);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int saveCustProduct(Hashtable htParams)
|
|
{
|
|
return dal.saveCustProduct(htParams);
|
|
}
|
|
/// <summary>
|
|
/// 更新菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int updateCustProduct(Hashtable htParams)
|
|
{
|
|
return dal.updateCustProduct(htParams);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查看菜单详情
|
|
/// </summary>
|
|
/// <param name="ruid"></param>
|
|
/// <returns></returns>
|
|
public Hashtable getCustProductDetail(String cust_pdline_id)
|
|
{
|
|
cust_pdline_id = " cust_pdline_id = " + cust_pdline_id;
|
|
DataTable dt = dal.getCustProductDetail(cust_pdline_id, "");
|
|
Hashtable result = new Hashtable();
|
|
result.Add("cust_pdline_id", dt.Rows[0]["cust_pdline_id"]);
|
|
result.Add("cust_pdline_name", dt.Rows[0]["cust_pdline_name"]);
|
|
result.Add("cust_pdline_desc", dt.Rows[0]["cust_pdline_desc"]);
|
|
result.Add("enabled", dt.Rows[0]["enabled"]);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除菜单
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
public int deleteMenu(String ids)
|
|
{
|
|
String[] idArray = ids.Split(',');
|
|
int count = 0;
|
|
foreach (String id in idArray)
|
|
{
|
|
if (!"".Equals(id))
|
|
{
|
|
count += this.dal.deleteMenu(id);
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
}
|
|
} |