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 { /// /// 宝来升级路由业务层 /// public class BoraUpgradeRouteBLL { /// /// 获取全部宝来升级路由列表 /// /// public static List GetBoraUpgradeRouteList() { List returnVal = new List(); 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; } /// /// 根据工位编码获取宝来升级路由实例 /// /// 工位编码 /// 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; } } }