yusijie
2023-12-29 d0d12fb5d0df58a0b9b3887f737551d17d5aeac8
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
using System;
using System.Collections.Generic;
using System.Text;
 
namespace BLL
{
    public class Cls_S_KF_ICInventoryList_IF
    {
        private string mvarReportTitle;
        public string MvarReportTitle
        {
            get { return mvarReportTitle; }
            set { mvarReportTitle = value; }
        }
        private string mvarItemKey;
        public string MvarItemKey
        {
            get { return mvarItemKey; }
            set { mvarItemKey = value; }
        }
        KF_ICInventoryList_IF oFrm = new KF_ICInventoryList_IF();
        const string ViewName = "h_v_KF_ICInventoryList_IF";
        public List<DBUtility.BillSelect> oBillSelectColl = new List<DBUtility.BillSelect>();
        //
        public Cls_S_KF_ICInventoryList_IF()
        {
            mvarReportTitle = "即时库存";
            mvarItemKey = "JSKC";
        }
        //
        public bool Refresh(string sWhere)
        {
            string sErr = "";
            int MainIDCol, SubIDCol, SPIDCol, BatchNoCol, AuxPropIDCol, MTONoCol, HProduceDateCol, HExpiryDateCol;
            string stmp;
            string tSQL;
            try
            {
                oFrm.sDlgWhere = sWhere;
                oFrm.ShowDialog();
                //返回数据到集合中
                oBillSelectColl.Clear();
                MainIDCol = oFrm.Fun_GetCol("hmaterid");
                SubIDCol = oFrm.Fun_GetCol("hwhid");
                SPIDCol = oFrm.Fun_GetCol("hspid");
                BatchNoCol = oFrm.Fun_GetCol("批次");
                AuxPropIDCol = oFrm.Fun_GetCol("HAuxPropID");
                MTONoCol = oFrm.Fun_GetCol("计划跟踪号");
                HProduceDateCol = oFrm.Fun_GetCol("生产日期");
                HExpiryDateCol = oFrm.Fun_GetCol("有效期至");
                //
                //循环 选中行
                if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
                {
                    for (int i = 0; i < oFrm.grdMain.SelectedRows.Count; i++)
                    {
                        DBUtility.BillSelect oSelect = new DBUtility.BillSelect();
                        oSelect.BillMainID = DBUtility.ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
                        oSelect.BillSubID = DBUtility.ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SubIDCol].Value);
                        oSelect.SPID = DBUtility.ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SPIDCol].Value);
                        oSelect.BatchNo = DBUtility.ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[BatchNoCol].Value);
                        oSelect.HAuxPropID = DBUtility.ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[AuxPropIDCol].Value);
                        oSelect.BillNo = DBUtility.ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[MTONoCol].Value);
                        oSelect.HProduceDate = DBUtility.ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[HProduceDateCol].Value);
                        oSelect.HExpiryDate = DBUtility.ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[HExpiryDateCol].Value);
                        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;
        }
 
        public bool Refresh()
        {
            string sErr = "";
            int MainIDCol, SubIDCol, SPIDCol, BatchNoCol;
            string stmp;
            string tSQL;
            try
            {
                oFrm.ShowDialog();
                //返回数据到集合中
                oBillSelectColl.Clear();
                MainIDCol = oFrm.Fun_GetCol("hmaterid");
                SubIDCol = oFrm.Fun_GetCol("hwhid");
                SPIDCol = oFrm.Fun_GetCol("hspid");
                BatchNoCol = oFrm.Fun_GetCol("批次");
                //
                //循环 选中行
                if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
                {
                    for (int i = 0; i < oFrm.grdMain.SelectedRows.Count; i++)
                    {
                        DBUtility.BillSelect oSelect = new DBUtility.BillSelect();
                        oSelect.BillMainID = DBUtility.ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
                        oSelect.BillSubID = DBUtility.ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SubIDCol].Value);
                        oSelect.SPID = DBUtility.ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SPIDCol].Value);
                        oSelect.BatchNo = DBUtility.ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[BatchNoCol].Value);
                        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;
        }
 
 
    }
}