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.
310 lines
8.1 KiB
310 lines
8.1 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
using ICSSoft.Frame.Data.Entity;
|
|
using ICSSoft.Frame.Data.DAL;
|
|
|
|
namespace ICSSoft.Frame.Data.BLL
|
|
{
|
|
public class ICSPickingBLL
|
|
{
|
|
public static DataTable SearchStorageInfoList(string dsconn)
|
|
{
|
|
try
|
|
{
|
|
DataTable returndt = new DataTable();
|
|
returndt.Columns.Add("Serial", typeof(string));
|
|
returndt.Columns.Add("库别代码", typeof(string));
|
|
returndt.Columns.Add("库别名称", typeof(string));
|
|
List<FormICSStorageUIModel> returndal = ICSPickingDAL.SearchStorageInfoList(dsconn);
|
|
foreach (FormICSStorageUIModel returns in returndal)
|
|
{
|
|
DataRow dr = returndt.NewRow();
|
|
dr["Serial"] = returns.Serial;
|
|
dr["库别代码"] = returns.StorageCode;
|
|
dr["库别名称"] = returns.StorageName;
|
|
returndt.Rows.Add(dr);
|
|
|
|
}
|
|
return returndt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
}
|
|
public static DataTable SearchVendorInfoList(string dsconn)
|
|
{
|
|
try
|
|
{
|
|
DataTable returndt = new DataTable();
|
|
returndt.Columns.Add("ID", typeof(string));
|
|
returndt.Columns.Add("厂商代码", typeof(string));
|
|
returndt.Columns.Add("厂商名称", typeof(string));
|
|
List<FormICSVendorUIModel> returndal = ICSPickingDAL.SearchVendorInfoList(dsconn);
|
|
foreach (FormICSVendorUIModel returnv in returndal)
|
|
{
|
|
DataRow dr = returndt.NewRow();
|
|
dr["ID"] = returnv.ID;
|
|
dr["厂商代码"] = returnv.VendorCode;
|
|
dr["厂商名称"] = returnv.VendorName;
|
|
returndt.Rows.Add(dr);
|
|
|
|
}
|
|
return returndt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
}
|
|
#region 新增和修改
|
|
public static string Add(FormICSPickingModel Info, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
if (string.IsNullOrWhiteSpace(dsconn))
|
|
{
|
|
throw new Exception("数据库连接字符串错误");
|
|
}
|
|
List<FormICSPickingModel> InfoList = new List<FormICSPickingModel>() { Info };
|
|
return ICSPickingDAL.Add(InfoList, dsconn);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增入库单明细
|
|
/// </summary>
|
|
/// <param name="Picking"></param>
|
|
/// <param name="dsconn"></param>
|
|
/// <returns></returns>
|
|
public static string AddAndEditDetail(FormICSPickingModel Picking, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
if (string.IsNullOrWhiteSpace(dsconn))
|
|
{
|
|
throw new Exception("数据库连接字符串错误");
|
|
}
|
|
return ICSPickingDAL.AddAndEditDetail(Picking, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public static string GetOutInNo(string dsconn)
|
|
{
|
|
try
|
|
{
|
|
if (string.IsNullOrWhiteSpace(dsconn))
|
|
{
|
|
throw new Exception("数据库连接字符串错误");
|
|
}
|
|
return ICSPickingDAL.GetOutInNo(dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
public static string GetPickingRowNo(string pickingId, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
if (string.IsNullOrWhiteSpace(dsconn))
|
|
{
|
|
throw new Exception("数据库连接字符串错误");
|
|
}
|
|
return ICSPickingDAL.GetPickingRowNo(pickingId, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 通过入库guid查询
|
|
public static FormICSPickingModel SearchInfoByID(string Rguid, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
List<FormICSPickingModel> returnlist = ICSPickingDAL.SearchInfoByID(Rguid, dsconn);
|
|
return returnlist[0];
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 删除
|
|
public static void deleteInfo(List<ICSMaterial> item2routeList, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
ICSPickingDAL.deleteInfo(item2routeList, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public static void deleteDetailInfo(List<string> RIDList, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
ICSPickingDAL.deleteDetailInfo(RIDList, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 入库代码是否存在
|
|
public static bool IsIncluding(string noCODE, string workpoint, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
return ICSPickingDAL.IsIncluding(noCODE, workpoint, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
public static bool IsIncludingDetail(List<string> RIDList, string dsconn)
|
|
{
|
|
|
|
try
|
|
{
|
|
return ICSPickingDAL.IsIncludingDetail(RIDList, dsconn);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
#region 子件资料信息
|
|
public static DataTable GetDetail(string Sql)
|
|
{
|
|
try
|
|
{
|
|
return ICSPickingDAL.GetDetail(Sql);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public static DataTable GetDetailList(string VouchCode)
|
|
{
|
|
try
|
|
{
|
|
return ICSPickingDAL.GetDetailList(VouchCode);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public static DataTable GetDetailInfo(string id)
|
|
{
|
|
try
|
|
{
|
|
return ICSPickingDAL.GetDetailInfo(id);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region 部门审核
|
|
public static void Check(string id, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
ICSPickingDAL.Check(id, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 弃审
|
|
public static void DiscardedTrialCheck(string id, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
ICSPickingDAL.DiscardedTrialCheck(id, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 弃审
|
|
public static void RefuseCheck(string id, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
ICSPickingDAL.RefuseCheck(id, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 通过ID查询
|
|
public static DataTable searchInfoByID(string ID, string dsconn)
|
|
{
|
|
try
|
|
{
|
|
return ICSPickingDAL.searchInfoByID(ID, dsconn);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|