/// <summary> /// File Append /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FileAdd_Click(object sender, MouseButtonEventArgs e) { try { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == true) { EmsAppdFile aF = new EmsAppdFile() { APPD_FILE_NM = openFileDialog.FileName, APPD_FILE_DEV_CD = "D", APPD_FILE_GROUP_CD = "BB_" + CurrentChkID.ToString(), APPD_FILE_GUID = Guid.NewGuid().ToString(), IsNew = true }; ChkFileList.Add(aF); gridFile.Focus(); gridFile.CurrentColumn = gridFile.Columns.First(); gridFile.View.FocusedRowHandle = ChkFileList.Count - 1; } } catch (Exception err) { this.BaseClass.Error(err); } }
/// <summary> /// 화일 삭제 함수 /// </summary> private void DelAttachList() { var _delItems = ChkFileList.Where(f => f.IsChecked).ToList(); if (0 < _delItems.Count) { var _USER_ID = this.BaseClass.UserID; string _SUCCESS_CODE = "100"; using (BaseDataAccess da = new BaseDataAccess()) { try { da.BeginTransaction(); foreach (var item in _delItems) { if (item.IsNew != true) { var param = new Dictionary <string, object> { { "P_CENTER_CD", this.BaseClass.CenterCD }, { "P_APPD_FILE_GUID", item.APPD_FILE_GUID }, { "P_USER_ID", _USER_ID } }; var strOutParam = new[] { "P_RESULT" }; string callProc = "PK_EMS_COM001.SP_EMS_COM_APPD_FILE_DELETE"; var outData = da.GetSpDataSet( callProc // 호출 프로시저 , param // Input 파라메터 , strOutParam // Output 파라메터 ); if (outData.Tables[0].Rows.Count > 0) { if (outData.Tables[0].Rows[0]["CODE"].ToString() != _SUCCESS_CODE) { _SUCCESS_CODE = "0"; da.RollbackTransaction(); BaseClass.MsgInfo(outData.Tables[0].Rows[0]["MSG"].ToString(), BaseEnumClass.CodeMessage.MESSAGE); break; } } else { _SUCCESS_CODE = "0"; da.RollbackTransaction(); this.BaseClass.MsgError("ERR_INPUT_TYPE"); break; } } } if (_SUCCESS_CODE == "100") { da.CommitTransaction(); foreach (var item in _delItems) { //if (item.IsNew != true) ChkFileList.Remove(item); } gridFile.RefreshData(); //this.ChangeStatusLabelEvent(HelperClass.GetMessageByCountryCode("CMPT_DELETE")); } } catch (Exception ex) { da.RollbackTransaction(); this.BaseClass.MsgError(ex.Message, BaseEnumClass.CodeMessage.MESSAGE); } } } }