using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; using System.Text; using MESClassLibrary.BLL.Log; using MESClassLibrary.DAL.PunchAndWeld; namespace MESClassLibrary.BLL.PunchAndWeld { public class PunchPartBLL { PunchPartDAL da=new PunchPartDAL(); public DataTable SearchPunchPart(string deviceNo) { try { return da.SearchPunchPart(deviceNo); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } //public List> SearchForExcel(string partNo) //{ // try // { // List> list = new List>(); // string jsonStr = "[]"; // int total = 0;//总行数 // List listProduct = db.SearchAllInfo(); // if (!String.IsNullOrEmpty(stockNo)) // { // listProduct = listProduct.Where(p => p.StockNo != null && p.StockNo.Contains(stockNo)).ToList(); // } // if (!String.IsNullOrEmpty(productTypeID)) // { // listProduct = listProduct.Where(p => p.ProductTypeID.Equals(productTypeID)).ToList(); // } // if (!String.IsNullOrEmpty(productName)) // { // listProduct = listProduct.Where(p => p.ProductName != null && p.ProductName.Contains(productName)).ToList(); // } // if (!String.IsNullOrEmpty(partNo)) // { // listProduct = listProduct.Where(p => p.PartNo != null && p.PartNo.Contains(partNo)).ToList(); // } // List modelList = new List(); // #region 联查 // BasicBLL s_db = new BasicBLL(); // BasicBLL carTypeDB = new BasicBLL(); // var s_list = s_db.SearchAllInfo(); // var carTypeList = carTypeDB.SearchAllInfo(); // foreach (var item in listProduct) // { // ProductModel dm = Tool.Mapper(item); // var info = s_list.FirstOrDefault(p => p.ProductTypeID == item.ProductTypeID); // var cartype = carTypeList.FirstOrDefault(p => p.ID == item.CarTypeID); // if (info != null) // { // dm.ProductTypeName = info.ProductTypeName; // } // if (cartype != null) // { // dm.CarTypeName = cartype.CarTypeName; // } // modelList.Add(dm); // } // #endregion // if (modelList != null && modelList.Count() > 0) // { // List title_ = new List(); // title_.Add("类别名称"); // title_.Add("存货代码"); // title_.Add("车型"); // title_.Add("是否进口"); // title_.Add("产品名称"); // title_.Add("颜色名称"); // title_.Add("零件号"); // title_.Add("行数"); // title_.Add("列数"); // title_.Add("层数"); // title_.Add("描述"); // title_.Add("标准包装量"); // title_.Add("开机报废数"); // title_.Add("Q等级"); // title_.Add("可喷涂次数"); // title_.Add("客户编号"); // title_.Add("车型编号"); // title_.Add("颜色编号"); // title_.Add("打印单个标签"); // title_.Add("直供件"); // title_.Add("打印装箱单"); // title_.Add("一模多具"); // title_.Add("是否左右"); // title_.Add("喷涂"); // list.Add(title_); // List titleList = new List(); // foreach (var item in modelList) // { // List rowList = new List(); // rowList.Add(item.ProductTypeName == null ? "" : item.ProductTypeName); // rowList.Add(item.StockNo == null ? "" : item.StockNo); // rowList.Add(item.CarTypeName == null ? "" : item.CarTypeName); // rowList.Add(item.isImport == 0 ? "否" : "是"); // rowList.Add(item.ProductName == null ? "" : item.ProductName); // rowList.Add(item.ColorName == null ? "" : item.ColorName); // rowList.Add(item.PartNo == null ? "" : item.PartNo); // rowList.Add(item.Rows == null ? "0" : item.Rows.ToString()); // rowList.Add(item.Cols == null ? "0" : item.Cols.ToString()); // rowList.Add(item.Layers == null ? "0" : item.Layers.ToString()); // rowList.Add(item.Des == null ? "" : item.Des); // rowList.Add(item.PackCount == null ? "0" : item.PackCount.ToString()); // rowList.Add(item.OpenFailNum == null ? "0" : item.OpenFailNum.ToString()); // rowList.Add(item.QLevel == null ? "" : item.QLevel); // rowList.Add(item.BackPlatingNum == null ? "0" : item.BackPlatingNum.ToString()); // rowList.Add(item.CustomerNo == null ? "" : item.CustomerNo); // rowList.Add(item.CarModelCode == null ? "" : item.CarModelCode); // rowList.Add(item.ColorCodeB == null ? "" : item.ColorCodeB); // rowList.Add(item.IsPrintOneTag == "0" ? "否" : "是"); // rowList.Add(item.IsSupply == "0" ? "否" : "是"); // rowList.Add(item.IsPrintPackList == "0" ? "否" : "是"); // rowList.Add(item.IsOneMore == "0" ? "否" : "是"); // rowList.Add(item.IsSame == 0 ? "否" : "是"); // rowList.Add(item.IsPlating == "0" ? "否" : "是"); // list.Add(rowList); // } // } // return list; // } // catch (Exception ex) // { // LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); // return null; // } //} } }