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
131
132
133
134
135
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace APSM
{
    public partial class KF_LackMaterialAnalyseDetail : Form
    {
        public KF_LackMaterialAnalyseDetail()
        {
            InitializeComponent();
        }
        public DateTime BDate;
        public DateTime EDate;
        public int FixCols = 12;
        public string sWLDM;
 
        public void LoadData()
        {
            int i ;
            int c ;
            int n ;
            bool bNull; 
            for(i=grdMain.FixedRows;i<grdMain.Rows;i++)
            { 
                grdMain.set_RowHidden(i,false);
                if(DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, 0)) != sWLDM)  
                {
                    grdMain.set_RowHidden(i, true);
                }
                if(DBUtility.ClsPub.isStrNull( grdMain.get_RowData(i)) == "*" )
                {
                    grdMain.RemoveItem(i);
                }
            }
            i = 0; 
            n = 0;
            c = 0;
            for(i=grdMain.FixedRows;i<grdMain.Rows;i++)
            { 
                if( grdMain.get_RowHidden(i) == false )
                {
                    n = n + 1;
                }
            }
            if( n == 0 )
                return;
             
            //'ºÏ¼Æ
            grdMain.Rows = grdMain.Rows + 1;
            grdMain.set_RowData(grdMain.Rows - 1, "*"); 
            for(i=4;i<grdMain.Cols;i++)
            {
                if( i != 7 || i != 8 || i!= 9 || i != 10 )
                {
                    n = 0; 
                    for(c=grdMain.FixedRows;c<grdMain.Rows;c++)
                    {
                        if( grdMain.get_RowHidden(c) == false )
                        {
                            n = n + DBUtility.ClsPub.isInt(grdMain.get_TextMatrix(c, i));
                        }
                        
                    }
                    grdMain.set_TextMatrix(grdMain.Rows - 1, i, n.ToString());
                }
            }
            grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, grdMain.Rows - 1, 0, grdMain.Rows - 1, grdMain.Cols - 1 , DBUtility.ClsPub.Enum_Color.hx_Control);
        }
 
        public void initGrid()
        {
            grdMain.Rows = 2;
            grdMain.FixedRows = 2;
            grdMain.Cols = 12;
            grdMain.FixedCols = 0;
            grdMain.AllowBigSelection = true;
            grdMain.AllowSelection = true;
            grdMain.RowHeightMin = 300;
            grdMain.FixedCols = 0;
            grdMain.ScrollTrack = true;
            grdMain.AllowUserResizing = VSFlex7.AllowUserResizeSettings.flexResizeColumns;
            grdMain.set_TextMatrix(0, 0, "ÎïÁÏ´úÂë");
            grdMain.set_TextMatrix(0, 1, "ÎïÁÏÃû³Æ");
            grdMain.set_TextMatrix(0, 2, "ÎïÁÏÐͺÅ");
            grdMain.set_TextMatrix(0, 3, "ÈÎÎñµ¥");
            grdMain.set_TextMatrix(0, 4,"Ó¦·¢Êý");
            grdMain.set_TextMatrix(0, 5, "ÒÑ·¢Êý");
            grdMain.set_TextMatrix(0, 6, "²¹ÁÏÊý");
            grdMain.set_TextMatrix(0, 7, "Åɹ¤µ¥ºÅ");
            grdMain.set_TextMatrix(0, 8, "²úÆ·´úÂë");
            grdMain.set_TextMatrix(0, 9, "²úÆ·Ãû³Æ");
            grdMain.set_TextMatrix(0, 10, "»ų́ºÅ");
            grdMain.set_TextMatrix(0, 11, "ºÏ¼Æ");
            grdMain.FrozenCols = 11;
            LoadDateCol(28); 
            grdMain.set_RowHeight(0, 450);
            grdMain.set_RowHidden(1, true);
        }
 
        public void LoadDateCol(int iDates)
        {
            Sc_ICMOSortBillFun.LoadDateCol(grdMain, FixCols, iDates);
        }
 
        private void KF_LackMaterialAnalyseDetail_Load(object sender, EventArgs e)
        {
            //initGrid();
            if (sWLDM.Trim() != "")
            {
                LoadData();
            }
        }
 
        private void tc_Click(object sender, EventArgs e)
        {
            this.Visible = false;
        }
 
        private void bclk_Click(object sender, EventArgs e)
        {
            //±£´æÁпí
            Sc_ICMOSortBillFun.SaveGrid(grdMain, this.Name);
        }
 
        private void mrlk_Click(object sender, EventArgs e)
        {
            Sc_ICMOSortBillFun.DefaultGrid(grdMain);
        }
    }
}