ComProdKeyBll.cs 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using CoreFS.CA06;
  7. using System.ComponentModel;
  8. using System.Drawing;
  9. using System.Windows.Forms;
  10. using Infragistics.Win.UltraWinGrid;
  11. using System.Collections;
  12. namespace Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.BaseData
  13. {
  14. public class ComProdKeyBll : SaleBusinessMgt.BllBase.BaseBll
  15. {
  16. private const string QUERY = @"select psc ,
  17. production_name ,
  18. standard_no_code ,
  19. steelcode ,
  20. ord_use_cd ,
  21. thk_min ,
  22. thk_max ,
  23. wth_min ,
  24. wth_max ,
  25. dev_spec_cd ,
  26. dev_dgr_cd ,
  27. lsteelcode ,
  28. sms_std_no ,
  29. mill_std_no ,
  30. ndt_std_no ,
  31. auto_process_tp ,
  32. used_tp ,
  33. reg_pgm_id ,
  34. reg_id ,
  35. reg_dtime ,
  36. mod_pgm_id ,
  37. mod_id ,
  38. mod_dtime from com_prod_key where 1 = 1 {0} ";
  39. public ComProdKeyBll(OpeBase ob)
  40. : base(ob)
  41. {
  42. }
  43. private DataSet GetComProdKey(string sqlCondition)
  44. {
  45. string sqlStr = string.Format(QUERY, sqlCondition);
  46. return base.ExecuteQuery(sqlStr, base.GetDaoName_Qlty());
  47. }
  48. /// <summary>
  49. /// 获取所有有效key
  50. /// </summary>
  51. /// <returns></returns>
  52. public DataSet GetComProdKeyUsed()
  53. {
  54. return Util.UtilDataSet.GetDataSetWithRowFilter(GetComProdKey(""), "USED_TP", "Y");
  55. }
  56. public DataSet GetComProdKeyUsedByProductionName(string productname)
  57. {
  58. string sqlcondion = string.Format(" and production_name = '{0}' and used_tp = 'Y' ", productname);
  59. return GetComProdKey(sqlcondion);
  60. }
  61. /// <summary>
  62. /// 通过牌号查询
  63. /// </summary>
  64. /// <param name="steelcode"></param>
  65. /// <returns></returns>
  66. public DataSet GetComProdKeyUsedBySteelCode(string steelcode)
  67. {
  68. string sqlcondion = string.Format(" and steelcode = '{0}' and used_tp = 'Y' ", steelcode);
  69. return GetComProdKey(sqlcondion);
  70. }
  71. public DataSet GetComProdKeyUsedByStandardNoCode(string standardnocode)
  72. {
  73. string sqlcondion = string.Format(" and standard_no_code = '{0}' and used_tp = 'Y' ", standardnocode);
  74. return GetComProdKey(sqlcondion);
  75. }
  76. }
  77. }