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.
171 lines
5.2 KiB
C#
171 lines
5.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using Estsh.Web.Dal;
|
|
using System.Collections;
|
|
using Estsh.Web.Util;
|
|
using System.Data;
|
|
using ApServerProvider;
|
|
|
|
|
|
|
|
namespace Estsh.Core.Services
|
|
{
|
|
public class HourService
|
|
{
|
|
private HourDal dal = new HourDal(RemotingProxyProvider._remotingProxy);
|
|
|
|
/// <summary>
|
|
/// 获取产线名称
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList GetPdlineName()
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
|
|
DataTable dt = dal.GetPdlineName();
|
|
|
|
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 删除数据
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
public int deleteHour(String ids)
|
|
{
|
|
String[] idArray = ids.Split(',');
|
|
int count = 0;
|
|
foreach (String id in idArray)
|
|
{
|
|
if (!"".Equals(id))
|
|
{
|
|
count += this.dal.deleteHour(id);
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 修改数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int updateHour(Hashtable htParams)
|
|
{
|
|
return dal.updateHour(htParams);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 添加数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int insertHour(Hashtable htParams)
|
|
{
|
|
return dal.insertHour(htParams);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 查看菜单详情
|
|
/// </summary>
|
|
/// <param name="pdline_id"></param>
|
|
/// <returns></returns>
|
|
public Hashtable getHourDetail(String ruid)
|
|
{
|
|
ruid = "a.ruid = " + ruid;
|
|
DataTable dt = dal.getList(ruid, "");
|
|
Hashtable result = new Hashtable();
|
|
|
|
result.Add("pdline_id", dt.Rows[0]["pdline_id"]);
|
|
result.Add("shift_id", dt.Rows[0]["shift_id"]);
|
|
result.Add("stop_line_working_hours_name", dt.Rows[0]["stop_line_working_hours_name"]);
|
|
result.Add("stop_line_length", dt.Rows[0]["stop_line_length"]);
|
|
result.Add("ruid", dt.Rows[0]["ruid"]);
|
|
result.Add("hour", dt.Rows[0]["hour"]);
|
|
return result;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取列表数据
|
|
/// </summary>
|
|
/// <param name="pdline_id"></param>
|
|
/// <param name="stop_line_length"></param>
|
|
/// <param name="hour"></param>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction"></param>
|
|
/// <param name="sort"></param>
|
|
/// <returns></returns>
|
|
//public Hashtable getHourListByPage( String ruid,String shift_id,String pdline_id, String stop_line_working_hours_name, String stop_line_length, String hour, Pager pager, String direction, String sort)
|
|
//{
|
|
// Hashtable result = new Hashtable();
|
|
// String strWhere = " 1=1 ";
|
|
|
|
// if (pdline_id != null && !pdline_id.Trim().Equals(""))
|
|
// {
|
|
// strWhere = " a.pdline_id like '%" + pdline_id.Trim() + "%' ";
|
|
// }
|
|
|
|
// if (shift_id != null && !shift_id.Trim().Equals(""))
|
|
// {
|
|
// strWhere = " shift_id like '%" + shift_id.Trim() + "%' ";
|
|
// }
|
|
|
|
// if (stop_line_working_hours_name != null && !stop_line_working_hours_name.Trim().Equals(""))
|
|
// {
|
|
// strWhere = " stop_line_working_hours_name like '%" + stop_line_working_hours_name.Trim() + "%' ";
|
|
// }
|
|
|
|
// if (stop_line_length != null && !stop_line_length.Trim().Equals(""))
|
|
// {
|
|
// strWhere += " AND stop_line_length like '%" + stop_line_length.Trim() + "%'";
|
|
// }
|
|
// if (hour != null && !hour.Trim().Equals(""))
|
|
// {
|
|
// strWhere += " AND hour like '%" + hour.Trim() + "%'";
|
|
// }
|
|
|
|
// String orderBy = "";
|
|
// if (sort != null && !"".Equals(sort.Trim()))
|
|
// {
|
|
// orderBy += sort + " " + direction;
|
|
// }
|
|
// else
|
|
// {
|
|
// orderBy += " ruid " + direction;
|
|
// }
|
|
// result = dal.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
// return result;
|
|
//}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取列表数据
|
|
/// </summary>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction"></param>
|
|
/// <param name="sort"></param>
|
|
/// <param name="cbPDLine"></param>
|
|
/// <returns></returns>
|
|
public Hashtable getHourListByPage(Pager pager, String direction, String sort, string cbPDLine)
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
|
|
String strWhere = " a.pdline_id='" + cbPDLine.ToString() + "' AND b.enabled='Y' ";
|
|
|
|
String orderBy = " a.ruid ";
|
|
result = dal.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
return result;
|
|
}
|
|
|
|
}
|
|
}
|