private void editBox1_ButtonClick(object sender, EventArgs e) { if (fileBrowser == null) { fileBrowser = new fBrowse(AtMng, 0, false, false, false, true); } //tag stores value for AccessAllowed to target file //JLL 2010-08-23 added: //&& FileId.GetType()!=typeof(System.DBNull) //as FileId was set to DBNull in admin Issues screen if (FileId != null && FileId.GetType() != typeof(System.DBNull) && (bool)editBox1.Tag) { fileBrowser.FindFile((int)FileId); } if (fileBrowser.ShowDialog() == DialogResult.OK) { if (fileBrowser.SelectedFile != null) { isChanged = true; FileId = fileBrowser.FileId; } } }
private void DoMove() { fWait fProgress = new fWait(); try { if (fileBrowser == null) { fileBrowser = new fBrowse(myFM.AtMng, 0, false, false, false, true); } fileBrowser.FindFile(myFM.CurrentFileId); if (fileBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Cursor.Current = Cursors.WaitCursor; //make dict of rows Dictionary <int, appDB.EFileSearchRow> FilesToMove = new Dictionary <int, appDB.EFileSearchRow>(); foreach (Janus.Windows.GridEX.GridEXSelectedItem gsi in eFileSearchGridEX.SelectedItems) { appDB.EFileSearchRow efsr1 = (appDB.EFileSearchRow)((DataRowView)gsi.GetRow().DataRow).Row; FilesToMove.Add(efsr1.FileId, efsr1); } try { foreach (appDB.EFileSearchRow efsr in FilesToMove.Values) { fProgress.setMessageText("Moving: " + efsr.Name); fProgress.Show(); fProgress.Refresh(); FileManager filetomove1 = myFM.AtMng.GetFile(efsr.FileId); //filetomove1.EFile.Move(filetomove1.CurrentFile, f.SelectedFile.FileId, true); UIHelper.MoveFile(filetomove1, fileBrowser.SelectedFile.FileId); atLogic.BusinessProcess bp = myFM.AtMng.GetBP(); bp.AddForUpdate(filetomove1.GetFileXRef()); bp.AddForUpdate(filetomove1.EFile); bp.Update(); } } catch (Exception x) { myFM.DB.FileXRef.RejectChanges(); myFM.DB.EFile.RejectChanges(); Cursor.Current = Cursors.Default; fProgress.Close(); UIHelper.HandleUIException(x); } Cursor.Current = Cursors.Default; fProgress.Close(); } LoadChildren(myFM); } catch (Exception x1) { fProgress.Close(); throw x1; } }