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
·using ClientLib;
using ClientLib.CommonService;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraReports.UI;
using PublicLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HANMI_J_SALE
{
    public partial class CreditSalesList : PublicLib.CommonMDI
    {
        private string m_YYMM;
        public CreditSalesList()
        {
            InitializeComponent();
            gridControl_Main.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Flat;
            gridControl_Main.LookAndFeel.UseDefaultLookAndFeel = false;
            gridView_Main.Appearance.HeaderPanel.BackColor = Color.FromArgb(170, 204, 255);
            gridControl_Det.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Flat;
            gridControl_Det.LookAndFeel.UseDefaultLookAndFeel = false;
            gridView_Det.Appearance.HeaderPanel.BackColor = Color.FromArgb(170, 204, 255);
            m_YYMM = "";
            spinEdit_YY.Value = DateTime.Now.Year;
            spinEdit_MM.Value = DateTime.Now.Month;
            spinEdit_MM.Spin += (sender, e) =>
            {
                if (e.IsSpinUp)
                {
                    if (spinEdit_MM.Value >= 12)
                    {
                        spinEdit_YY.Value++;
                        spinEdit_MM.Value = 1;
                        e.Handled = true;
                    }
                }
                else
                {
                    if (spinEdit_MM.Value <= 1)
                    {
                        spinEdit_YY.Value--;
                        spinEdit_MM.Value = 12;
                        e.Handled = true;
                    }
                }
            };
            panelControl_Det.Visible = splitterControl_Det.Visible = false;
            checkEdit_YearList.CheckedChanged += (sender, e) =>
            {
                panelControl_Det.Visible = splitterControl_Det.Visible = checkEdit_YearList.Checked;
                if (checkEdit_YearList.Checked)
                {
                    splitterControl_Det.BringToFront();
                    gridSplitContainer_Main.BringToFront();
                    ShowDetail();
                }
            };
            gridView_Main.FocusedRowChanged += (sender, e) =>
            {
                ShowDetail();
            };
            this.Shown += (sender, e) =>
            {
                try
                {
                    SerializedSqlParam[] aParam = new SerializedSqlParam[] {
                        ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD)
                    };
                    ResultData resultData = ClientClass.GetData("GetCreditSalesListForLookup", aParam);
                    if (resultData.isError)
                    {
                        throw new Exception(resultData.ResultValue);
                    }
                    DataRow row;
                    row = resultData.DataList.Tables[0].NewRow();
                    row["USR_ID"] = "";
                    row["EMP_NO"] = "";
                    row["USR_NM"] = "";
                    resultData.DataList.Tables[0].Rows.InsertAt(row, 0);
                    UtilClass.SetLookup(lookUpEdit_SALES_USER, resultData.DataList.Tables[0], "EMP_NO", "USR_NM", true);
                    row = resultData.DataList.Tables[1].NewRow();
                    row["MST_DEPT_CD"] = "";
                    row["DEPT_CD"] = "";
                    row["DEPT_NM"] = "";
                    resultData.DataList.Tables[1].Rows.InsertAt(row, 0);
                    UtilClass.SetLookup(lookUpEdit_DEPT, resultData.DataList.Tables[1], "MST_DEPT_CD", "DEPT_NM", true);
                    DataView c17 = new DataView(ConstClass._DATA);
                    c17.RowFilter = "CATE_CD = 'C' and GRP_CD = 'C17'";
                    DataTable c17Data = c17.ToTable();
                    row = c17Data.NewRow();
                    row["NO_CD"] = "";
                    row["NO_CD_NM"] = "";
                    c17Data.Rows.InsertAt(row, 0);
                    UtilClass.SetLookup(lookUpEdit_AREA_CD, c17Data, "NO_CD", "NO_CD_NM", true);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    this.Close();
                }
            };
        }
        public override void searchProc()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                gridControl_Main.DataSource = null;
                SerializedSqlParam[] aParam = new SerializedSqlParam[] {
                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                    ClientClass.CreateSqlParameter("YYMM", SqlDbType.NVarChar, spinEdit_YY.Value.ToString("0000") + "." + spinEdit_MM.Value.ToString("00")),
                    ClientClass.CreateSqlParameter("SEARCH_CONDITION", SqlDbType.Int, comboBoxEdit_SEARCH_CONDITION.SelectedIndex),
                    ClientClass.CreateSqlParameter("REMARK_CONDITION", SqlDbType.Int, comboBoxEdit_REMARK_CONDITION.SelectedIndex),
                    ClientClass.CreateSqlParameter("MST_DEPT_CD", SqlDbType.NVarChar, lookUpEdit_DEPT.EditValue),
                    ClientClass.CreateSqlParameter("SALES_USR_ID", SqlDbType.NVarChar, lookUpEdit_SALES_USER.EditValue),
                    ClientClass.CreateSqlParameter("AREA_CD", SqlDbType.NVarChar, lookUpEdit_AREA_CD.EditValue),
                    ClientClass.CreateSqlParameter("DEAL_CONDITION", SqlDbType.Int, comboBoxEdit_DEAL_CONDITION.SelectedIndex)
                };
                ResultData resultData = ClientClass.GetData("GetCreditSaleList", aParam);
                if (resultData.isError)
                {
                    throw new Exception(resultData.ResultValue);
                }
                m_YYMM = spinEdit_YY.Value.ToString("0000") + "." + spinEdit_MM.Value.ToString("00");
                gridControl_Main.DataSource = resultData.TableData;
                this.Cursor = Cursors.Arrow;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                MessageBox.Show(ex.Message);
            }
        }
        private void ShowDetail()
        {
            try
            {
                DataRow row = gridView_Main.GetFocusedDataRow();
                gridControl_Det.DataSource = null;
                textEdit_REMAIN_MY.Text = "";
                if (row == null || !gridControl_Det.Visible)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                SerializedSqlParam[] aParam = new SerializedSqlParam[] {
                    ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD),
                    ClientClass.CreateSqlParameter("YY", SqlDbType.NVarChar, spinEdit_YY.Value.ToString("0000")),
                    ClientClass.CreateSqlParameter("CUST_CD", SqlDbType.NVarChar, row["CUST_CD"])
                };
                ResultData resultData = ClientClass.GetData("GetCreditSaleListDetail", aParam);
                if (resultData.isError)
                {
                    throw new Exception(resultData.ResultValue);
                }
                int remain_my = UtilClass.toInt(resultData.DataList.Tables[1].Rows[0]["REMAIN_MY"]);
                textEdit_REMAIN_MY.EditValue = remain_my;
                int order_my, col_my;
                for (int i = 0; i < resultData.DataList.Tables[0].Rows.Count; i++)
                {
                    order_my = UtilClass.toInt(resultData.DataList.Tables[0].Rows[i]["ORDER_MY"]);
                    col_my = UtilClass.toInt(resultData.DataList.Tables[0].Rows[i]["COL_MY"]);
                    remain_my = remain_my + order_my - col_my;
                    resultData.DataList.Tables[0].Rows[i]["REMAIN_MY"] = remain_my;
                }
                resultData.DataList.Tables[0].AcceptChanges();
                gridControl_Det.DataSource = resultData.DataList.Tables[0];
                this.Cursor = Cursors.Arrow;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                MessageBox.Show(ex.Message);
            }
        }
        public override void printProc()
        {
            if (gridControl_Main.DataSource == null)
            {
                return;
            }
            DataTable data = gridControl_Main.DataSource as DataTable;
            if (data.Rows.Count < 1)
            {
                return;
            }
            CreditSalesReport report = new CreditSalesReport();
            report.setDataBinding(data, m_YYMM);
            CommonPreview preview = new CommonPreview(" ", true, false);
            preview.SetH1Report(report);
            preview.ShowDialog();
        }
        public override void excelProc()
        {
            this.ExportExcelGrid(gridControl_Main);
        }
    }
}
X