You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
4.6 KiB
128 lines
4.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
//Ref:
|
|
using System.Data;
|
|
|
|
using QMAPP.BoraUpgrade.DAL;
|
|
using QMAPP.BoraUpgrade.Entity;
|
|
|
|
namespace QMAPP.BoraUpgrade.BLL
|
|
{
|
|
/// <summary>
|
|
/// 宝来升级路由业务层
|
|
/// </summary>
|
|
public class BoraUpgradeRouteBLL
|
|
{
|
|
/// <summary>
|
|
/// 获取全部宝来升级路由列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static List<T_QD_BoraUpgradeRoute> GetBoraUpgradeRouteList()
|
|
{
|
|
List<T_QD_BoraUpgradeRoute> returnVal = new List<T_QD_BoraUpgradeRoute>();
|
|
|
|
DataTable dataTable = BoraUpgradeRouteDAL.GetBoraUpgradeRouteList();
|
|
|
|
if ( dataTable.Rows.Count != 0 )
|
|
{
|
|
foreach (DataRow currRow in dataTable.Rows)
|
|
{
|
|
T_QD_BoraUpgradeRoute newBoraUpgradeRoute = new T_QD_BoraUpgradeRoute();
|
|
|
|
newBoraUpgradeRoute.BoraRouteID = int.Parse( currRow["BoraRouteID"].ToString() );
|
|
|
|
newBoraUpgradeRoute.WorkCell_Code = currRow["WorkCell_Code"].ToString();
|
|
|
|
newBoraUpgradeRoute.NextWorkCell_Code = currRow["NextWorkCell_Code"].ToString();
|
|
|
|
newBoraUpgradeRoute.Machine_Code = currRow["Machine_Code"].ToString();
|
|
|
|
newBoraUpgradeRoute.RouteRegular = currRow["RouteRegular"].ToString();
|
|
|
|
newBoraUpgradeRoute.RouteDirection = int.Parse(currRow["RouteDirection"].ToString());
|
|
|
|
newBoraUpgradeRoute.IsProductCode = bool.Parse(currRow["IsProductCode"].ToString());
|
|
|
|
newBoraUpgradeRoute.IsClear = bool.Parse(currRow["IsClear"].ToString());
|
|
|
|
newBoraUpgradeRoute.IsDeleted = bool.Parse( currRow["IsDeleted"].ToString() );
|
|
|
|
newBoraUpgradeRoute.CreateTime = DateTime.Parse( currRow["CreateTime"].ToString() );
|
|
|
|
newBoraUpgradeRoute.ModeCode = currRow["ModeCode"].ToString();
|
|
|
|
if (!string.IsNullOrWhiteSpace(currRow["EmptyDAICount"].ToString()))
|
|
{
|
|
newBoraUpgradeRoute.EmptyDAICount = int.Parse(currRow["EmptyDAICount"].ToString());
|
|
}
|
|
else
|
|
{
|
|
newBoraUpgradeRoute.EmptyDAICount = -1;
|
|
}
|
|
|
|
returnVal.Add(newBoraUpgradeRoute);
|
|
}
|
|
}
|
|
|
|
return returnVal;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据工位编码获取宝来升级路由实例
|
|
/// </summary>
|
|
/// <param name="WorkCell_Code">工位编码</param>
|
|
/// <returns></returns>
|
|
public static T_QD_BoraUpgradeRoute GetBoraUpgradeRouteByWorkCell(string WorkCell_Code)
|
|
{
|
|
T_QD_BoraUpgradeRoute returnVal = new T_QD_BoraUpgradeRoute();
|
|
|
|
DataTable dataTable = BoraUpgradeRouteDAL.GetBoraUpgradeRouteByWorkCell( WorkCell_Code );
|
|
|
|
if (dataTable.Rows.Count != 0)
|
|
{
|
|
foreach (DataRow currRow in dataTable.Rows)
|
|
{
|
|
returnVal.BoraRouteID = int.Parse(currRow["BoraRouteID"].ToString());
|
|
|
|
returnVal.WorkCell_Code = currRow["WorkCell_Code"].ToString();
|
|
|
|
returnVal.NextWorkCell_Code = currRow["NextWorkCell_Code"].ToString();
|
|
|
|
returnVal.Machine_Code = currRow["Machine_Code"].ToString();
|
|
|
|
returnVal.RouteRegular = currRow["RouteRegular"].ToString();
|
|
|
|
returnVal.RouteDirection = int.Parse(currRow["RouteDirection"].ToString());
|
|
|
|
returnVal.IsProductCode = bool.Parse(currRow["IsProductCode"].ToString());
|
|
|
|
returnVal.IsClear = bool.Parse(currRow["IsClear"].ToString());
|
|
|
|
returnVal.IsDeleted = bool.Parse(currRow["IsDeleted"].ToString());
|
|
|
|
returnVal.CreateTime = DateTime.Parse(currRow["CreateTime"].ToString());
|
|
|
|
if ( string.IsNullOrWhiteSpace(currRow["EmptyDAICount"].ToString()) )
|
|
{
|
|
returnVal.EmptyDAICount = int.Parse(currRow["EmptyDAICount"].ToString());
|
|
}
|
|
else
|
|
{
|
|
returnVal.EmptyDAICount = -1;
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
returnVal = null;
|
|
}
|
|
|
|
return returnVal;
|
|
}
|
|
}
|
|
}
|
|
|