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 { /// /// 菜单业务处理类 /// public class XTShipShiftDefineService { private XTShipShiftDefineDal dal = new XTShipShiftDefineDal(RemotingProxyProvider._remotingProxy); /// /// 根据分页条件获取分页菜单数据 /// /// /// /// /// /// public Hashtable getXTShipShiftDefineListByPage( Pager pager, String direction, String sort, string cbModelName, string SN,String txtStartTime, String txtEndTime, string status) { Hashtable result = new Hashtable(); string strWhere = " 1=1 "; String orderBy = "part_id"; result = dal.getListByPage(pager.pageSize, pager.pageNo, orderBy, strWhere); return result; } /// /// 配置集合 /// /// 数据集 public ArrayList GetModelName() { return dal.GetModelName(); } /// /// 查看详情 /// /// /// public ArrayList getXTShipShiftDefine(String part_id) { part_id = "part_id = " + part_id; DataTable dt = dal.getList(part_id, ""); ArrayList result = DataTypeConvert.NewObject.DataTableToArrayList(dt); return result; } /// /// 根据分页条件获取分页菜单数据 /// /// 查询条件 /// /// 排序方式 /// 排序字段 /// public DataTable getTableListByPage(Pager pager, String direction, String sort, Boolean isPage, string cbModelName, string SN, String txtStartTime, String txtEndTime, string status) { DataTable result = null; string strWhere = " 1=1 "; if (!string.IsNullOrEmpty(SN)) { strWhere += " and a.serial_number = '" + SN + "' "; } if (!string.IsNullOrEmpty(cbModelName)) { strWhere += " and b.model_id = '" + cbModelName + "' "; } if (!string.IsNullOrEmpty(txtStartTime)) { strWhere += " and a.create_ymd >= '" + txtStartTime + "' "; } if (!string.IsNullOrEmpty(txtEndTime)) { strWhere += " and a.create_ymd <= '" + txtEndTime + "' "; } String orderBy = " a.create_ymd,a.create_hms desc "; if (status == "2") { strWhere += " and a.status = " + status + " "; result = dal.getNoPlanedgetexport(pager.pageSize, pager.pageNo, orderBy, strWhere); } else if (!string.IsNullOrEmpty(status)) { strWhere += " and a.status = '" + status + "' "; result = dal.getListByPageexport(pager.pageSize, pager.pageNo, orderBy, strWhere); } else { result = dal.getListByPageexport(pager.pageSize, pager.pageNo, orderBy, strWhere); } return result; } } }