1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using System;
using System.Collections.Generic;
using System.Text;
using DBUtility;
 
namespace DAL
{
    public class Cls_S_Sc_ICMOSortHisBill
    {
        private string mvarReportTitle;
        public string MvarReportTitle
        {
            get { return mvarReportTitle; }
            set { mvarReportTitle = value; }
        }
        private string mvarItemKey;
        public string MvarItemKey
        {
            get { return mvarItemKey; }
            set { mvarItemKey = value; }
        }
        frmHlpBillList oFrm = new frmHlpBillList();
        const string ViewName = "h_v_Sc_ICMOSortBillHisList_Source";
        public List<DBUtility.BillSelect> oBillSelectColl = new List<DBUtility.BillSelect>();
        //
        public Cls_S_Sc_ICMOSortHisBill()
        {
            mvarReportTitle = "生产派工单";
            mvarItemKey = "3708";
        }
        //
         
        //
 
        public bool Refresh_History(string sWhere)
        {
            string sErr = "";
            int MainIDCol, SubIDCol, BillNoCol;
            string tSQL;
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            tSQL = sWhere + " and HRelationQty<本日计划数 order by 日期,hsubid ";
            try
            {
                oFrm.sPrimaryCol = "部门";
                oFrm.Text = mvarReportTitle;
                oFrm.lblCaption.Text = mvarReportTitle;
                oFrm.tSQL = tSQL;
                oFrm.ViewName = ViewName;
                oFrm.ShowDialog();
                //返回数据到集合中
                oBillSelectColl.Clear();
                MainIDCol = oFrm.Fun_GetCol("hmainid");
                SubIDCol = oFrm.Fun_GetCol("hsubid");
                BillNoCol = oFrm.Fun_GetCol("单据号");
                int SelectCol = oFrm.Fun_GetCol("选择");
                //
                for (int i = oFrm.grdMain.FixedRows; i < oFrm.grdMain.Rows - 1; i++)
                {
                    if (DBUtility.ClsPub.isStrNull(oFrm.grdMain.get_TextMatrix(i, SelectCol)) == "*")
                    {
                        DBUtility.BillSelect oSelect = new DBUtility.BillSelect();
                        oSelect.BillNo = DBUtility.ClsPub.isStrNull(oFrm.grdMain.get_TextMatrix(i, BillNoCol));
                        oSelect.BillMainID = DBUtility.ClsPub.isLong(oFrm.grdMain.get_TextMatrix(i, MainIDCol));
                        oSelect.BillSubID = DBUtility.ClsPub.isLong(oFrm.grdMain.get_TextMatrix(i, SubIDCol));
                        oSelect.BillTitle = mvarReportTitle;
                        oSelect.BillType = mvarItemKey;
                        oBillSelectColl.Add(oSelect);
                    }
                }
                //
                if (oBillSelectColl.Count > 0)
                    return true;
                else
                    return false;
            }
            catch (Exception e)
            {
                sErr = e.Message;
            }
            return true;
        }
 
 
        
    }
}