using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using CoreFS.CA06;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Infragistics.Win.UltraWinGrid;
using System.Collections;
namespace Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.BaseData
{
public class ComProdKeyBll : SaleBusinessMgt.BllBase.BaseBll
{
private const string QUERY = @"select psc ,
production_name ,
standard_no_code ,
steelcode ,
ord_use_cd ,
thk_min ,
thk_max ,
wth_min ,
wth_max ,
dev_spec_cd ,
dev_dgr_cd ,
lsteelcode ,
sms_std_no ,
mill_std_no ,
ndt_std_no ,
auto_process_tp ,
used_tp ,
reg_pgm_id ,
reg_id ,
reg_dtime ,
mod_pgm_id ,
mod_id ,
mod_dtime from com_prod_key where 1 = 1 {0} ";
public ComProdKeyBll(OpeBase ob)
: base(ob)
{
}
private DataSet GetComProdKey(string sqlCondition)
{
string sqlStr = string.Format(QUERY, sqlCondition);
return base.ExecuteQuery(sqlStr, base.GetDaoName_Qlty());
}
///
/// 获取所有有效key
///
///
public DataSet GetComProdKeyUsed()
{
return Util.UtilDataSet.GetDataSetWithRowFilter(GetComProdKey(""), "USED_TP", "Y");
}
public DataSet GetComProdKeyUsedByProductionName(string productname)
{
string sqlcondion = string.Format(" and production_name = '{0}' and used_tp = 'Y' ", productname);
return GetComProdKey(sqlcondion);
}
///
/// 通过牌号查询
///
///
///
public DataSet GetComProdKeyUsedBySteelCode(string steelcode)
{
string sqlcondion = string.Format(" and steelcode = '{0}' and used_tp = 'Y' ", steelcode);
return GetComProdKey(sqlcondion);
}
public DataSet GetComProdKeyUsedByStandardNoCode(string standardnocode)
{
string sqlcondion = string.Format(" and standard_no_code = '{0}' and used_tp = 'Y' ", standardnocode);
return GetComProdKey(sqlcondion);
}
}
}