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.

251 lines
7.8 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Estsh.Web.Dal;
using Estsh.Web.Util;
using System.Collections;
using System.Data;
namespace Estsh.Core.Services
{
public class CartonDetailQueryService
{
CartonDetailQueryDal dal = new CartonDetailQueryDal(RemotingProxyProvider._remotingProxy);
public ArrayList GetVendor()
{
DataTable dt = dal.GetVendor();
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
}
public ArrayList GetPart()
{
DataTable dt = dal.GetPart();
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
}
public ArrayList GetModelType()
{
DataTable dt = dal.GetModelType();
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
}
public ArrayList GetStatus()
{
DataTable dt = dal.GetStatus();
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
}
public ArrayList GetEnabled()
{
DataTable dt = dal.GetEnabled();
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
}
public ArrayList GetLocate()
{
DataTable dt = dal.GetLocate();
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
}
/// <summary>
/// 获取菜单列表
/// </summary>
/// <param name="sqlWhere"></param>
/// <param name="orderBy"></param>
/// <returns></returns>
public List<TreeNode> getMenuList(string sqlWhere, string orderBy, String rootPath)
{
DataTable ds = dal.getList(sqlWhere, orderBy);
List<TreeNode> treeNodes = new List<TreeNode>();
for (int i = 0; i < ds.Rows.Count; i++)
{
TreeNode node = new TreeNode();
node.id = ds.Rows[i]["RUID"].ToString();
node.icon = ds.Rows[i]["MenuPicLink"].ToString();
node.name = ds.Rows[i]["MenuName"].ToString();
if (ds.Rows[i]["ParentMenuID"] == null || "0".Equals(ds.Rows[i]["ParentMenuID"].ToString().Trim()))
{
node.parentId = "0";
node.iconSkin = "diy01";
}
else
{
node.parentId = ds.Rows[i]["ParentMenuID"].ToString();
node.url = rootPath + ds.Rows[i]["MenuLink"].ToString();
node.target = "frmright";
}
treeNodes.Add(node);
}
return treeNodes;
}
/// <summary>
/// 根据分页条件获取分页菜单数据
/// </summary>
/// <param name="partNo_search"></param>
/// <param name="pager"></param>
/// <param name="direction"></param>
/// <param name="sort"></param>
/// <returns></returns>
public ArrayList getDPSListByPage(String cartonNO, String picknoTxt, String buy_no, String partNo_search,
String locate_name, String option3, String cmbVendor, String cmbCartonStatus, String cmbEnabled,
String date, String txtEndPrintTime, String updateDate,
Pager pager, String direction, String sort)
{
String strWhere = " where 1=1 ";
if (!string.IsNullOrEmpty(cartonNO))
{
strWhere += " AND s.carton_no = '" + cartonNO.Trim() + "' ";
}
if (!string.IsNullOrEmpty(cmbVendor))
{
strWhere += " AND v.vendor_name = '" + cmbVendor.Trim() + "' ";
}
if (!string.IsNullOrEmpty(partNo_search))
{
strWhere += " AND p.part_no = '" + partNo_search.Trim() + "' ";
}
if (!string.IsNullOrEmpty(option3))
{
strWhere += " AND p.option3 = '" + option3.Trim() + "' ";
}
if (!string.IsNullOrEmpty(cmbCartonStatus))
{
strWhere += " AND s.enabled = '" + cmbCartonStatus.Trim() + "' ";
}
if (!string.IsNullOrEmpty(locate_name))
{
strWhere += " AND l.locate_id = '" + locate_name.Trim() + "' ";
}
if (!string.IsNullOrEmpty(buy_no))
{
strWhere += " AND s.buy_no like '%" + buy_no.Trim() + "%' ";
}
if (!string.IsNullOrEmpty(picknoTxt))
{
strWhere += " AND s.pick_no like '%" + picknoTxt.Trim() + "%' ";
}
if (!string.IsNullOrEmpty(cmbEnabled))
{
strWhere += "and 1=1 AND s.status = '" + cmbEnabled.Trim() + "' ";
}
DataTable dt = dal.getListByPage(pager.pageSize, pager.pageNo, strWhere, sort + " " + direction);
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
}
/// <summary>
/// 获取分页总数量
/// </summary>
/// <param name="partNo_search"></param>
/// <returns></returns>
public int getMenuCount(String cartonNO, String picknoTxt, String buy_no, String partNo_search,
String locate_name, String option3, String cmbVendor, String cmbCartonStatus, String cmbEnabled,
String date, String txtEndPrintTime, String updateDate,
Pager pager, String direction, String sort)
{
//String strWhere = " ";
//if (!String.IsNullOrEmpty(partNo_search))
//{
// strWhere += " AND p.part_no = '" + partNo_search.Trim() + "'";
//}
//if (!String.IsNullOrEmpty(option3))
//{
// strWhere += " AND p.option3 =" + option3.Trim() + "";
//}
////因为select下拉框取view_board_id得到的是view_board_nameselect的名字叫view_board_id
//if (!String.IsNullOrEmpty(locate_name))
//{
// strWhere += " AND l.locate_name= '" + locate_name.Trim() + "'";
//}
//if (!String.IsNullOrEmpty(enabled_search))
//{
// strWhere += " AND s.enabled= '" + enabled_search.Trim() + "'";
//}
String strWhere = " ";
if (!string.IsNullOrEmpty(cartonNO))
{
strWhere += " AND s.carton_no = '" + cartonNO.Trim() + "' ";
}
if (!string.IsNullOrEmpty(cmbVendor))
{
strWhere += " AND v.vendor_name = '" + cmbVendor.Trim() + "' ";
}
if (!string.IsNullOrEmpty(partNo_search))
{
strWhere += " AND p.part_no = '" + partNo_search.Trim() + "' ";
}
if (!string.IsNullOrEmpty(option3))
{
strWhere += " AND p.option3 = '" + option3.Trim() + "' ";
}
if (!string.IsNullOrEmpty(cmbCartonStatus))
{
strWhere += " AND s.enabled = '" + cmbCartonStatus.Trim() + "' ";
}
if (!string.IsNullOrEmpty(locate_name))
{
strWhere += " AND l.locate_name = '" + locate_name.Trim() + "' ";
}
if (!string.IsNullOrEmpty(buy_no))
{
strWhere += " AND s.buy_no like '%" + buy_no.Trim() + "%' ";
}
if (!string.IsNullOrEmpty(picknoTxt))
{
strWhere += " AND s.pick_no like '%" + picknoTxt.Trim() + "%' ";
}
if (!string.IsNullOrEmpty(cmbEnabled))
{
strWhere += "and 1=1 AND s.status = '" + cmbEnabled.Trim() + "' ";
}
return dal.getCountWhere(strWhere);
}
public string GetServer()
{
return dal.GetServer();
}
}
}