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.
210 lines
6.4 KiB
210 lines
6.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
using ICSSoft.Frame.Data.DAL;
|
|
using ICSSoft.Frame.Data.Entity;
|
|
namespace ICSSoft.Frame.Data.BLL
|
|
{
|
|
public class ICSITEM2ROUTEBLL
|
|
{
|
|
|
|
#region 新增和修改List
|
|
public static string AddList(List<FormICSITEM2ROUTEUIModel> InfoList, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
if (string.IsNullOrWhiteSpace(dsconn))
|
|
{
|
|
throw new Exception("数据库连接字符串错误");
|
|
}
|
|
|
|
return ICSITEM2ROUTEDAL.AddList(InfoList, dsconn);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
public static DataTable SearchItemInfoList(string dsconn, string invcode)
|
|
{
|
|
try
|
|
{
|
|
DataTable returndt = new DataTable();
|
|
returndt.Columns.Add("guid", typeof(string));
|
|
returndt.Columns.Add("存货编码", typeof(string));
|
|
returndt.Columns.Add("存货名称", typeof(string));
|
|
returndt.Columns.Add("规格型号", typeof(string));
|
|
List<FormICSINVENTORYUIModel> returndal = ICSITEM2ROUTEDAL.SearchItemInfoList(dsconn, invcode);
|
|
foreach (FormICSINVENTORYUIModel returntype in returndal)
|
|
{
|
|
DataRow dr = returndt.NewRow();
|
|
dr["guid"] = returntype.ID;
|
|
dr["存货编码"] = returntype.INVCODE;
|
|
dr["存货名称"] = returntype.INVNAME;
|
|
dr["规格型号"] = returntype.INVDESC;
|
|
returndt.Rows.Add(dr);
|
|
}
|
|
return returndt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public static DataTable SearchRouteInfoList(string dsconn)
|
|
{
|
|
try
|
|
{
|
|
DataTable returndt = new DataTable();
|
|
returndt.Columns.Add("guid", typeof(string));
|
|
returndt.Columns.Add("途程代码", typeof(string));
|
|
returndt.Columns.Add("途程描述", typeof(string));
|
|
List<FormICSROUTEUIModel> returndal = ICSITEM2ROUTEDAL.SearchRouteInfoList(dsconn);
|
|
foreach (FormICSROUTEUIModel returntype in returndal)
|
|
{
|
|
DataRow dr = returndt.NewRow();
|
|
dr["guid"] = returntype.ID;
|
|
dr["途程代码"] = returntype.ROUTECODE;
|
|
dr["途程描述"] = returntype.ROUTEDESC;
|
|
returndt.Rows.Add(dr);
|
|
}
|
|
return returndt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
#region 新增和修改
|
|
public static void Add(FormICSITEM2ROUTEUIModel Info,bool add, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
if (string.IsNullOrWhiteSpace(dsconn))
|
|
{
|
|
throw new Exception("数据库连接字符串错误");
|
|
}
|
|
List<FormICSITEM2ROUTEUIModel> InfoList = new List<FormICSITEM2ROUTEUIModel>() { Info };
|
|
ICSITEM2ROUTEDAL.Add(InfoList,add, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 代码是否存在
|
|
public static bool IsIncluding(string itemCODE,string routeCODE, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
return ICSITEM2ROUTEDAL.IsIncluding(itemCODE, routeCODE, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
//#region 产品是否有使用的途程
|
|
//public static bool IsIncludingISREF(List<string> itemcodeList, List<string> routecodeList, string dsconn)
|
|
//{
|
|
// try
|
|
// {
|
|
// return ICSITEM2ROUTEDAL.IsIncludingISREF(itemcodeList, routecodeList, dsconn);
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// throw ex;
|
|
// }
|
|
|
|
//}
|
|
//#endregion
|
|
|
|
#region 通过存货编码和途程代码查询
|
|
public static FormICSITEM2ROUTEUIModel SearchInfoByCode(string itemCode, string routeCode, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
List<FormICSITEM2ROUTEUIModel> returnlist = ICSITEM2ROUTEDAL.SearchInfoByCode(itemCode, routeCode, dsconn);
|
|
return returnlist[0];
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 信息
|
|
public static DataTable GetDetail(String itemcode, String routecode, String Appconstr)
|
|
{
|
|
try
|
|
{
|
|
return ICSITEM2ROUTEDAL.GetDetail(itemcode, routecode, Appconstr);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 产品是否有使用的途程
|
|
public static bool IsIncludingISREF(string itemCODE, string routeCODE, string dsconn, out string defaultRouteCODE)
|
|
{
|
|
return ICSITEM2ROUTEDAL.IsIncludingISREF(itemCODE, routeCODE, dsconn, out defaultRouteCODE);
|
|
}
|
|
#endregion
|
|
|
|
#region 产品途程是否绑定工艺
|
|
public static bool CheckOP(string ROUTECODE, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
DataTable dt = ICSITEM2ROUTEDAL.CheckOP(ROUTECODE, dsconn);
|
|
if (dt.Rows.Count > 0 && dt != null)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 删除
|
|
public static void deleteInfo(string itemcode,string routecode, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
ICSITEM2ROUTEDAL.deleteInfo(itemcode, routecode, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
|
|
}
|
|
#endregion
|
|
}
|
|
}
|