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; /*************************************************************************************************** * * 作者:王勇 * * *************************************************************************************************/ namespace Estsh.Core.Services { /// /// 菜单业务处理类 /// public class FGSerchService { private FGSerchDal dal = new FGSerchDal(RemotingProxyProvider._remotingProxy); /// /// 根据分页条件获取分页菜单数据 /// /// /// /// /// /// public Hashtable getFGSerchListByPage(String order_no, String shift_name, String car_no, String type_id, String Date, Pager pager, String direction, String sort) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (order_no != null && !order_no.Trim().Equals("")) { strWhere = " and order_no='" + order_no + "' "; } if (shift_name != null && !shift_name.Trim().Equals("")) { strWhere += " and shift_name='" + shift_name + "'"; } if (car_no != null && !car_no.Trim().Equals("")) { strWhere += " and car_no='" + car_no + "'"; } if (type_id != null && !type_id.Trim().Equals("")) { strWhere += " and model_name='" + type_id + "'"; } if (Date != null && !Date.Trim().Equals("")) { strWhere += " and shift_name='" + Date + "'"; } String orderBy = ""; if (sort != null && !"".Equals(sort.Trim())) { orderBy += sort + " " + direction; } else { orderBy += " order_no " + direction; } result = dal.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy); return result; } /// /// 保存菜单数据 /// /// /// public int saveFGSerch(Hashtable htParams) { return dal.saveFGSerch(htParams); } /// /// 更新菜单数据 /// /// /// public int updateFGSerch(Hashtable htParams) { return dal.updateFGSerch(htParams); } /// /// 查看详情 /// /// /// public ArrayList getFGSerch(String part_id) { part_id = "part_id = " + part_id; DataTable dt = dal.getList(part_id, ""); ArrayList result = DataTypeConvert.NewObject.DataTableToArrayList(dt); return result; } /// /// 删除菜单 /// /// /// public int deleteFGSerch(String ids) { String[] idArray = ids.Split(','); int count = 0; foreach (String id in idArray) { if (!"".Equals(id)) { count += this.dal.deleteFGSerch(id); } } return count; } /// /// 获取下拉框中的菜单数据 /// /// public ArrayList getSelectFGSerch() { Hashtable result = new Hashtable(); DataTable dt = dal.getSelectFGSerch(); return DataTypeConvert.NewObject.DataTableToArrayList(dt); } /// /// 获取下拉框中的菜单数据 /// /// public ArrayList getSelectFGSerch_model_name() { Hashtable result = new Hashtable(); DataTable dt = dal.getSelectFGSerch_model_name(); return DataTypeConvert.NewObject.DataTableToArrayList(dt); } /// /// 根据分页条件获取分页客户订单数据 /// /// 查询条件 /// /// 排序方式 /// 排序字段 /// public DataTable getTableListByPage(String part_no, String cust_order, Pager pager, String direction, String sort, Boolean isPage) { DataTable result = null; String strWhere = " 1=1 "; int rowCount = 0; if (part_no != null && !part_no.Trim().Equals("")) { strWhere = " b.part_no like '%" + part_no.Trim() + "%' "; } if (cust_order != null && !cust_order.Trim().Equals("")) { strWhere += " AND a.cust_order like '%" + cust_order.Trim() + "%'"; } String orderBy = ""; if (sort != null && !"".Equals(sort.Trim())) { orderBy += sort + " " + direction; } else { orderBy += " a.part_id " + direction; } if (isPage) { rowCount = pager.pageSize; } else { rowCount = pager.pageSize; } result = dal.getTableListByPage(rowCount, pager.pageNo, strWhere, sort + " " + direction); return result; } } }