// 저장-수정후 상세내역만 초기화 // ini(false) private void InputData_Save() { try { CoFAS_DevExpressManager.SetCursor(this, Cursors.WaitCursor); bool isError = false; if (CoFAS_DevExpressManager.ShowQuestionMessage(_pMSG_SAVE_QUESTION) == DialogResult.Yes) { DataTable tDataTable = _gdMAIN_VIEW.GridControl.DataSource as DataTable; //같은 없체인지 체크 string before_vend = string.Empty; int cnt = 0; for (int i = 0; i < tDataTable.Rows.Count; i++) { if (tDataTable.Rows[i]["CRUD"].ToString() == "Y") { // 저장 프로시저 isError = new PartMstDownLoadBusiness().PartMstDownLoad_Info_Save(_pPartMstDownLoadEntity); if (isError) { CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_SAVE_ERROR); return; } cnt++; } } if (cnt == 0) { CoFAS_DevExpressManager.ShowInformationMessage("품목을 선택해주세요."); return; } CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_SAVE); Form_SearchButtonClicked(null, null); } } catch (ExceptionManager pExceptionManager) { CoFAS_DevExpressManager.ShowErrorMessage(string.Format("{0}\n{1}", pExceptionManager.Exception.Message.ToString(), pExceptionManager.TargetSite.ToString())); } finally { _gdMAIN_VIEW.BestFitColumns(); CoFAS_DevExpressManager.SetCursor(this, Cursors.Default); } }
// 추가 이벤트 생성 #region ○ 메인 그리드 로우 선택 이벤트 생성 - _gdMAIN_VIEW_RowCellClick(object sender, RowCellClickEventArgs e) private void _gdMAIN_VIEW_RowCellClick(object sender, RowCellClickEventArgs e) { try { CoFAS_DevExpressManager.SetCursor(this, Cursors.WaitCursor); GridView gv = sender as GridView; int qRowIndex = gv.FocusedRowHandle; string qColumnHeader = e.Column.Caption; //if(gv.getd) bool isError = false; if (qColumnHeader == "저장(가공)") { if (CoFAS_DevExpressManager.ShowQuestionMessage(_pMSG_SAVE_QUESTION) == DialogResult.Yes) { _pPartMstDownLoadEntity.PART_CODE = gv.GetFocusedRowCellValue("ITMNO").ToString(); _pPartMstDownLoadEntity.PART_NAME = gv.GetFocusedRowCellValue("INM").ToString(); _pPartMstDownLoadEntity.PART_SIZE = gv.GetFocusedRowCellValue("ISIZE").ToString(); //_pPartMstDownLoadEntity.PRODUCT_TYPE = gv.GetFocusedRowCellValue("PRDTYPE").ToString(); _pPartMstDownLoadEntity.PRODUCT_TYPE = "1001"; // 저장 프로시저 isError = new PartMstDownLoadBusiness().PartMstDownLoad_Info_Save(_pPartMstDownLoadEntity); if (isError) { CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_SAVE_ERROR); return; } else { //update SqlConnection con; if (_pFTPIP == "192.168.123.246:8500/") { _pCONNECTION = "Data Source=192.168.123.252;Initial Catalog=DTISDB;User ID=pmo; Password=semids1357!;"; } else { _pCONNECTION = "Data Source=db3.coever.co.kr;Initial Catalog=DTISDB;User ID=sa; Password=Codb89897788@$^;"; } con = new SqlConnection(_pCONNECTION); //con = new SqlConnection("Data Source=192.168.123.252;Initial Catalog=DTISDB;User ID=pmo; Password=semids1357!;"); SqlCommand cmd; cmd = new SqlCommand(); cmd.CommandText = "usp_pop_bas001m_Sync"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; cmd.Parameters.Add(new SqlParameter("@itmno", SqlDbType.VarChar, 50)); // 값할당 cmd.Parameters["@itmno"].Value = gv.GetFocusedRowCellValue("ITMNO").ToString(); SqlDataReader dr; DataTable dt; dt = new DataTable(); con.Open(); dr = cmd.ExecuteReader(); dt.Load(dr); con.Close(); } CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_SAVE); Form_SearchButtonClicked(null, null); } } if (qColumnHeader == "저장(소재)") { if (CoFAS_DevExpressManager.ShowQuestionMessage(_pMSG_SAVE_QUESTION) == DialogResult.Yes) { _pPartMstDownLoadEntity.PART_CODE = gv.GetFocusedRowCellValue("ITMNO").ToString(); _pPartMstDownLoadEntity.PART_NAME = gv.GetFocusedRowCellValue("INM").ToString(); _pPartMstDownLoadEntity.PART_SIZE = gv.GetFocusedRowCellValue("ISIZE").ToString(); //_pPartMstDownLoadEntity.PRODUCT_TYPE = gv.GetFocusedRowCellValue("PRDTYPE").ToString(); _pPartMstDownLoadEntity.PRODUCT_TYPE = "1004"; // 저장 프로시저 isError = new PartMstDownLoadBusiness().PartMstDownLoad_Info_Save(_pPartMstDownLoadEntity); if (isError) { CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_SAVE_ERROR); return; } else { //update SqlConnection con; if (_pFTPIP == "192.168.123.246:8500/") { _pCONNECTION = "Data Source=192.168.123.252;Initial Catalog=DTISDB;User ID=pmo; Password=semids1357!;"; } else { _pCONNECTION = "Data Source=db3.coever.co.kr;Initial Catalog=DTISDB;User ID=sa; Password=Codb89897788@$^;"; } con = new SqlConnection(_pCONNECTION); //con = new SqlConnection("Data Source=192.168.123.252;Initial Catalog=DTISDB;User ID=pmo; Password=semids1357!;"); SqlCommand cmd; cmd = new SqlCommand(); cmd.CommandText = "usp_pop_bas001m_Sync"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; cmd.Parameters.Add(new SqlParameter("@itmno", SqlDbType.VarChar, 50)); // 값할당 cmd.Parameters["@itmno"].Value = gv.GetFocusedRowCellValue("ITMNO").ToString(); SqlDataReader dr; DataTable dt; dt = new DataTable(); con.Open(); dr = cmd.ExecuteReader(); dt.Load(dr); con.Close(); } CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_SAVE); Form_SearchButtonClicked(null, null); } } } catch (ExceptionManager pExceptionManager) { CoFAS_DevExpressManager.ShowErrorMessage(string.Format("{0}\n{1}", pExceptionManager.Exception.Message.ToString(), pExceptionManager.TargetSite.ToString())); } finally { _gdMAIN_VIEW.BestFitColumns(); CoFAS_DevExpressManager.SetCursor(this, Cursors.Default); } // InputData_Save(); }