File name
Commit message
Commit date
File name
Commit message
Commit date
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
2022-03-31
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
·using ClientLib;
using ClientLib.CommonService;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.BandedGrid;
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Nodes;
using PublicLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HANMI_STD
{
    public partial class CurrentMoneyManager : CommonMDI
    {
        DataView m_Group_View;
        DataView m_Code_View;
        DataView m_Code_Type;
        string m_Item_CD = "";
        string m_new_Grp_CD = "";
        public CurrentMoneyManager()
        {
            InitializeComponent();
            this.Shown += (sender, e) =>
            {
                SerializedSqlParam[] aParam = new SerializedSqlParam[] {
                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                    ClientClass.CreateSqlParameter("ITEM_CD", SqlDbType.NVarChar, "")
                };
                ResultData result = ClientClass.GetData("U3GetCurrentMoney", aParam);
                if (result.isError)
                {
                    throw new Exception(result.ResultValue);
                }
                textEdit_Search.Text = m_Item_CD;
                gridControl_Main.DataSource = result.DataList.Tables[0];
                DataRow row = bandedGridView_Main.GetFocusedDataRow();
                m_Item_CD = row["ITEM_CD"].ToString();
                searchProc();
            };
            gridControl_Main.DoubleClick += (sender, e) =>
            {
                DataRow row = bandedGridView_Main.GetFocusedDataRow();
                m_Item_CD = row["ITEM_CD"].ToString();
                if (row != null)
                {
                        searchProc();
                }
            };
            gridControl_Main.KeyPress += (sender, e) =>
            {
                DataRow row = bandedGridView_Main.GetFocusedDataRow();
                m_Item_CD = row["ITEM_CD"].ToString();
                if (e.KeyChar == '\r')
                 {
                     searchProc();
                 }
             };
            simpleButton_AddMoney.Click += (sender, e) =>
            {
                bandedGridView_Code.AddNewRow();
                bandedGridView_Code.GetFocusedDataRow()["COMP_CD"] = ConstClass._COMP_CD;
                bandedGridView_Code.GetFocusedDataRow()["ITEM_CD"] = m_Item_CD;
            };
            simpleButton_AddGroup.Click += (sender, e) =>
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    SerializedSqlParam[] aParam = new SerializedSqlParam[] {
                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                    ClientClass.CreateSqlParameter("ITEM_CD", SqlDbType.NVarChar, m_Item_CD),
                    ClientClass.CreateSqlParameter("RUN_RESULT", SqlDbType.NVarChar, "", ParameterDirection.Output, 1000)
                };
                    ResultData result = ClientClass.GetData("U3GetMaxCurrentMoneyGroup", aParam);
                    if (result.isError)
                    {
                        throw new Exception(result.ResultValue);
                    }
                    if(result!=null && result.TableData.Rows.Count==1 && result.TableData.Rows[0].ItemArray.Length ==1 && m_new_Grp_CD != result.TableData.Rows[0].ItemArray[0].ToString())
                    {
                        bandedGridView_Group.AddNewRow();
                        bandedGridView_Group.GetFocusedDataRow()["COMP_CD"] = ConstClass._COMP_CD;
                        bandedGridView_Group.GetFocusedDataRow()["ITEM_CD"] = m_Item_CD;
                        bandedGridView_Group.GetFocusedDataRow()["GRP_CD"] = result.TableData.Rows[0].ItemArray[0].ToString();
                        m_new_Grp_CD = result.TableData.Rows[0].ItemArray[0].ToString();
                        bandedGridView_Group.Focus();
                    }
                    bandedGridView_Group.Focus();
                    this.Cursor = Cursors.Arrow;
                }
                catch (Exception ex)
                {
                    this.Cursor = Cursors.Arrow;
                    XtraMessageBox.Show(ex.Message);
                }
            };
            simpleButton_DeleteGroup.Click += (sender, e) =>
            {
                DataRow row = bandedGridView_Group.GetFocusedDataRow();
                if (XtraMessageBox.Show(this,"[" + row["GRP_CD"].ToString() + "]\r\n   .\r\n  ?","Delete", MessageBoxButtons.YesNo) != DialogResult.Yes)
                {
                    return;
                }
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    DataTable aData = new DataTable();
                    ResultData[] dataList = null;
                    ResultData data1 = new ResultData();
                    SerializedSqlParam[] aParam = new SerializedSqlParam[]
                    {
                                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                                    ClientClass.CreateSqlParameter("ITEM_CD", SqlDbType.NVarChar, m_Item_CD),
                                    ClientClass.CreateSqlParameter("GRP_CD", SqlDbType.NVarChar, row["GRP_CD"].ToString()),
                                    ClientClass.CreateSqlParameter("RUN_RESULT", SqlDbType.NVarChar, "", ParameterDirection.Output, 1000)
                    };
                    ResultData result = ClientClass.SetTableData("U3DeleteCurrentMoney", dataList, aParam);
                    if (result.isError || !UtilClass.isNull(result.ResultValue))
                    {
                        throw new Exception(result.ResultValue);
                    }
                    searchProc();
                    this.Cursor = Cursors.Arrow;
                }
                catch (Exception ex)
                {
                    this.Cursor = Cursors.Arrow;
                    XtraMessageBox.Show(ex.Message);
                }
            };
            repositoryItemButtonEdit1.ButtonClick += (sender, e) =>
            {
                DataRow row = bandedGridView_Group.GetFocusedDataRow();
                if (row["ITEM_GRP"].ToString() == "")
                {
                    XtraMessageBox.Show("  .");
                    return;
                }
                SelectCurrentMoneyGroupForm scmgf = new SelectCurrentMoneyGroupForm("", row["GRP_CD"].ToString(), row["ITEM_CD"].ToString());
               if(scmgf.ShowDialog() != DialogResult.No)
                {
                    searchProc();
                }
            };
            bandedGridView_Group.CellValueChanged += (sender, e) =>
            {
                DataRow row = bandedGridView_Group.GetFocusedDataRow();
                try
                {
                    if (row != null)
                    {
                        if (bandedGridView_Group.FocusedColumn.FieldName == "ITEM_GRP" && row["ITEM_GRP"].ToString() != "")
                        {
                            try
                            {
                                this.Cursor = Cursors.WaitCursor;
                                DataTable aData = new DataTable();
                                ResultData[] dataList = null;
                                ResultData data1 = new ResultData();
                                SerializedSqlParam[] aParam = new SerializedSqlParam[]
                                {
                                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                                    ClientClass.CreateSqlParameter("ITEM_CD", SqlDbType.NVarChar, m_Item_CD),
                                    ClientClass.CreateSqlParameter("GRP_CD", SqlDbType.NVarChar, row["GRP_CD"].ToString()),
                                    ClientClass.CreateSqlParameter("ITEM_GRP", SqlDbType.NVarChar,row["ITEM_GRP"].ToString()),
                                    ClientClass.CreateSqlParameter("RUN_RESULT", SqlDbType.NVarChar, "", ParameterDirection.Output, 1000)
                                };
                                ResultData result = ClientClass.SetTableData("U3SaveCurrentMoneyGroup", dataList, aParam);
                                if (result.isError || !UtilClass.isNull(result.ResultValue))
                                {
                                    throw new Exception(result.ResultValue);
                                }
                                this.Cursor = Cursors.Arrow;
                            }
                            catch (Exception ex)
                            {
                                this.Cursor = Cursors.Arrow;
                                XtraMessageBox.Show(ex.Message);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            };
            bandedGridView_Code.CellValueChanged += (sender, e) =>
            {
                DataRow row = bandedGridView_Code.GetFocusedDataRow();
                try
                {
                    if (row != null)
                    {
                        if (row[bandedGridView_Code.FocusedColumn.FieldName].ToString() != row["ITEM_QTY"].ToString() && row["ITEM_QTY"]!= null && row["ITEM_QTY"].ToString() != "" && row["ITEM_QTY"].ToString() != "0")
                        {
                            try
                            {
                                this.Cursor = Cursors.WaitCursor;
                                DataTable aData = new DataTable();
                                ResultData[] dataList = null;
                                ResultData data1 = new ResultData();
                                string sfield = "";
                                if (bandedGridView_Code.FocusedColumn.FieldName == "STANDARD")
                                {
                                    sfield = "";
                                }else
                                {
                                    sfield = bandedGridView_Code.FocusedColumn.FieldName;
                                }
                                
                                SerializedSqlParam[] aParam = new SerializedSqlParam[]
                                {
                                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                                    ClientClass.CreateSqlParameter("ITEM_CD", SqlDbType.NVarChar, m_Item_CD),
                                    ClientClass.CreateSqlParameter("ITEM_GRP", SqlDbType.NVarChar, sfield),
                                    ClientClass.CreateSqlParameter("ITEM_QTY", SqlDbType.Int, row["ITEM_QTY"].ToString()),
                                    ClientClass.CreateSqlParameter("ITEM_MY", SqlDbType.Int, row[bandedGridView_Code.FocusedColumn.FieldName].ToString()),
                                    ClientClass.CreateSqlParameter("RESULT_STR", SqlDbType.NVarChar, "", ParameterDirection.Output, 1000)
                                };
                                ResultData result = ClientClass.SetTableData("U3SaveCurrentmoney", dataList, aParam);
                                if (result.isError || !UtilClass.isNull(result.ResultValue))
                                {
                                    throw new Exception(result.ResultValue);
                                }
                                this.Cursor = Cursors.Arrow;
                            }
                            catch (Exception ex)
                            {
                                this.Cursor = Cursors.Arrow;
                                XtraMessageBox.Show(ex.Message);
                            }
                            //MessageBox.Show(row[bandedGridView_Code.FocusedColumn.Caption].ToString());
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            };
        }
        public override void searchProc()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                m_new_Grp_CD = "";
                SerializedSqlParam[] aParam = new SerializedSqlParam[] {
                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                    ClientClass.CreateSqlParameter("ITEM_CD", SqlDbType.NVarChar, m_Item_CD)
                };
                ResultData result = ClientClass.GetData("U3GetCurrentMoney", aParam);
                if (result.isError)
                {
                    throw new Exception(result.ResultValue);
                }
                textEdit_Search.Text = m_Item_CD;
                gridControl_Main.DataSource = result.DataList.Tables[0];
                m_Group_View = new DataView(result.DataList.Tables[1]);
                m_Code_Type = new DataView(result.DataList.Tables[2]);
                m_Code_View = new DataView(result.DataList.Tables[3]);
                if (result.DataList.Tables[0].Rows.Count > 0)
                {
                    m_Group_View.RowFilter = " ITEM_CD like '%" + m_Item_CD + "%'";
                }
                gridControl_Group.DataSource = m_Group_View;
                gridBand3.Columns.Clear();
                bandedGridView_Code.Columns.Clear();
                gridBand3.Columns.Add(GetGridColumn("grid_view_COMP_CD", "COMP_CD", "", false,true,100));
                gridBand3.Columns.Add(GetGridColumn("grid_view_ITEM_CD", "ITEM_CD", "", false, true,100));
                gridBand3.Columns.Add(GetGridColumn("grid_view_PrevITEM_QTY", "PrevITEM_QTY", "~", true,true,30));
                gridBand3.Columns.Add(GetGridColumn("grid_view_ITEM_QTY", "ITEM_QTY", "~", true,false,30));
                gridBand3.Columns.Add(GetGridColumn("grid_view_ITEM_STANDARD", "STANDARD", "", true,false,50));
                if (m_Code_Type != null && m_Code_Type.Count > 0)
                {
                    for (int i = 0; i < m_Code_Type.Table.Rows.Count; i++)
                    {
                        gridBand3.Columns.Add(GetGridColumn("grid_view_"+ m_Code_Type.Table.Rows[i].ItemArray[0].ToString(), m_Code_Type.Table.Rows[i].ItemArray[0].ToString(), m_Code_Type.Table.Rows[i].ItemArray[0].ToString(), true,false,50));
                    }
                }
                gridControl_Code.DataSource = m_Code_View;
                this.Cursor = Cursors.Arrow;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                XtraMessageBox.Show(ex.Message);
            }
        }
             private BandedGridColumn GetGridColumn(string name, string fieldName, string caption, bool visible, bool bReadonly, int width)
            {
                 BandedGridColumn column = new BandedGridColumn();
                 column.Name = name;
                 column.FieldName = fieldName;
                 column.Caption = caption;
                 column.Visible = visible;
                 column.OptionsColumn.ReadOnly = bReadonly;
                 column.OptionsColumn.AllowEdit = !bReadonly;
                 column.Width = width;
                 return column;
            }
        public override void newProc()
        {
        }
        public override void deleteProc()
        {
        }
        public override void saveProc()
        {
        }
    }
}
X