using ClientLib; using ClientLib.CommonService2; using DevExpress.XtraEditors; using DevExpress.XtraGrid.Views.Grid.ViewInfo; using PublicLib; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Net; using System.Text; using System.Windows.Forms; using System.Xml; namespace HANMI_J_SALE { partial class WorkManagerPopup : XtraForm { private DataTable m_Data; public WorkManagerPopup(DataTable data) { InitializeComponent(); this.Icon = ConstClass._MAIN.Icon; m_Data = data.Copy(); dateEdit_DATE.DateTime = DateTime.Now; this.simpleButton_CANCEL.Click += (sender, e) => { this.DialogResult = DialogResult.Cancel; this.Close(); }; this.simpleButton_YES.Click += (sender, e) => { saveProc(); }; this.Shown += (sender, e) => { gridControl_Main.DataSource = m_Data; }; } private void searchProc() { } private void saveProc() { try { this.Cursor = Cursors.WaitCursor; gridView_Main.PostEditor(); gridView_Main.UpdateCurrentRow(); Application.DoEvents(); DataTable aData = gridControl_Main.DataSource as DataTable; DataTable dtData = UtilClass.GetDataTable(aData, false, "COMP_CD", "FACT_CD", "ORDER_NO", "WORK_PRN" ); if (dtData.Rows.Count < 1) { throw new Exception("변경된 데이터가 없습니다."); } dtData.TableName = "ADATA"; ResultData data1 = new ResultData(); data1.TableData = dtData; ResultData[] dataList = new ResultData[] { data1 }; SerializedSqlParam[] aParam = new SerializedSqlParam[] { ClientClass.CreateSqlParameter("WORK_DATE", SqlDbType.NVarChar, dateEdit_DATE.DateTime.ToString("yyyy.MM.dd")), ClientClass.CreateSqlParameter("REG_ID", SqlDbType.NVarChar, ConstClass._USR_ID) }; ResultData resultData = ClientClass.SetTableData("SaveWorkManagerPopup", dataList, aParam); if (resultData.isError) { throw new Exception(resultData.ResultValue); } this.Cursor = Cursors.Arrow; MessageBox.Show("정상적으로 저장하였습니다."); this.DialogResult = DialogResult.Yes; this.Close(); } catch (Exception ex) { this.Cursor = Cursors.Arrow; MessageBox.Show(ex.Message); } } } }