protected void btnProcess_Click(object sender, EventArgs e) { try { int idImport = default(int); Int32.TryParse(ProcessIdHdn.Value.ToString(), out idImport); ImportRevisedBudget revisedBudgetUpload = new ImportRevisedBudget(SessionManager.GetSessionValueNoRedirect(this.Page, SessionStrings.CONNECTION_MANAGER)); string cleanFileName = RevisedBudgetFileName; if (cleanFileName != null && !FilesWithSkipExistRevisedBudgetError.Contains(cleanFileName) && ExistsInProgressRevisedBudget()) { FilesWithSkipExistRevisedBudgetError.Add(cleanFileName); revisedBudgetUpload.SkipExistRevisedBudgetError = false; throw new IndException("There is a revised budget in-progress. Do you want to process to the replacement?"); } else { if (FilesWithSkipExistRevisedBudgetError.Contains(cleanFileName)) { FilesWithSkipExistRevisedBudgetError.Remove(cleanFileName); revisedBudgetUpload.SkipExistRevisedBudgetError = true; } } try { int retVal = revisedBudgetUpload.InsertToRevisedBudgetTable(idImport); if (retVal >= 0) { this.ShowError(new IndException(string.Format(ApplicationMessages.IMPORT_FILE_PROCESSED, idImport.ToString()))); bool isFake; string versionNo; RevisedBudget revBudget = new RevisedBudget(SessionManager.GetConnectionManager(this.Page)); revBudget.IdProject = currentProject.Id; versionNo = revBudget.GetVersionNumber(out isFake); if (!string.IsNullOrEmpty(versionNo)) { currentProject.IdVersion = int.Parse(versionNo); } TrackingActivityLog tkl = new TrackingActivityLog(SessionManager.GetConnectionManager(this)); tkl.InsertTrackingActivityLog(currentProject, currentUser, ETrackingActivity.UploadedRevisedBudget); } } catch (Exception ex) { this.ShowError(new IndException(ex.Message.ToString())); } } catch (Exception ex) { ShowError(new IndException(ex)); return; } }