/// <summary> /// Gets the arguements from the handler to set the progress indicator. /// </summary> /// <param name="args">The args.</param> private void ImportHandler(ImportProgressArgs args) { //ImportManager importManager = Page.Session["testimportManager"] as ImportManager; TestResultsInfo testResultInfo = GetTestResultInfo(); RadProgressContext importProgress = RadProgressContext.Current; importProgress["PrimaryPercent"] = Convert.ToString(Math.Round(Decimal.Divide(args.ProcessedCount, args.RecordCount) * 100)); importProgress["PrimaryValue"] = String.Format("({0})", args.ProcessedCount); importProgress["PrimaryTotal"] = String.Format("({0})", args.RecordCount); //importProgress["SecondaryTotal"] = String.Format("{0} Duplicates:{1}", args.ErrorCount, args.DuplicateCount); importProgress["ProcessCompleted"] = "False"; testResultInfo.TotalRecords = args.RecordCount.ToString(); testResultInfo.TotalRecordsProcessed = args.ProcessedCount.ToString(); testResultInfo.TotalDuplicates = args.DuplicateCount.ToString(); testResultInfo.TotalWarnings = args.WarningCount.ToString(); testResultInfo.TotalTotalMerged = args.MergeCount.ToString(); testResultInfo.TotalErrors = args.ErrorCount.ToString(); try { if (args.RecordCount == 0) { testResultInfo.ProjectedDuplicateRate = string.Format("{0:P}", 0); } else { testResultInfo.ProjectedDuplicateRate = string.Format("{0:P}", Decimal.Divide(args.DuplicateCount, args.RecordCount)); } } catch (Exception) { } SaveTestResultInfo(testResultInfo); LoadResults(); }
void mb_ImportProgressChanged(object sender, ImportProgressArgs e) { if (cancel) { mb.StopAllProcess(); } totalBytes = (int)e.TotalBytes; curBytes = (int)e.CurrentBytes; }
/// <summary> /// Gets the arguements from the handler to set the progress indicator. /// </summary> /// <param name="args">The args.</param> private void ImportHandler(ImportProgressArgs args) { RadProgressContext importProgress = RadProgressContext.Current; string percent; try { percent = Convert.ToString(Math.Round(Decimal.Divide(args.ProcessedCount, args.RecordCount) * 100)); importProgress["PrimaryPercent"] = percent; } catch (Exception) { percent = "0"; } if (args.ProcessedCount < 2) { if (args.ImportManager != null) { if (args.ImportManager.ImportHistory != null) { Page.Session["importHistoryId"] = args.ImportManager.ImportHistory.Id; } } } importProgress["PrimaryPercent"] = percent; importProgress["PrimaryValue"] = String.Format("({0})", args.ProcessedCount.ToString()); importProgress["PrimaryTotal"] = String.Format("({0})", args.RecordCount.ToString()); importProgress["SecondaryValue"] = args.ImportedCount.ToString(); importProgress["SecondaryTotal"] = String.Format("{0} Duplicates:{1} Merged:{2} ", args.ErrorCount, args.DuplicateCount, args.MergeCount); if (args.ErrorCount > 0) { importProgress["ProcessCompleted"] = "True"; ImportManager importManager = args.ImportManager; // Page.Session["importManager"] as ImportManager; if (importManager != null) { importManager.ImportHistory.ErrorCount = args.ErrorCount; importManager.ImportHistory.ProcessState = Enum.GetName(typeof(ImportProcessState), ImportProcessState.Completed); //importManager.ImportHistory. args.Message SetProcessState(importManager.ImportHistory.Id.ToString(), Enum.GetName(typeof(ImportProcessState), ImportProcessState.Abort), GetLocalResourceObject("AbortedMsg").ToString()); } } else { importProgress["ProcessCompleted"] = "False"; } //Thread.Sleep(10000); }
/// <summary> /// Gets the arguements from the handler to set the progress indicator. /// </summary> /// <param name="args">The args.</param> private void ImportHandler(ImportProgressArgs args) { //ImportManager importManager = Page.Session["testimportManager"] as ImportManager; TestResultsInfo testResultInfo = GetTestResultInfo(); RadProgressContext importProgress = RadProgressContext.Current; importProgress["PrimaryPercent"] = Convert.ToString(Math.Round(Decimal.Divide(args.ProcessedCount, args.RecordCount) * 100)); importProgress["PrimaryValue"] = String.Format("({0})", args.ProcessedCount.ToString()); importProgress["PrimaryTotal"] = String.Format("({0})", args.RecordCount.ToString()); //importProgress["SecondaryTotal"] = String.Format("{0} Duplicates:{1}", args.ErrorCount, args.DuplicateCount); importProgress["ProcessCompleted"] = "False"; testResultInfo.TotalRecords = args.RecordCount.ToString(); testResultInfo.TotalRecordsProcessed = args.ProcessedCount.ToString(); testResultInfo.TotalDuplicates = args.DuplicateCount.ToString(); testResultInfo.TotalWarnings = args.WarningCount.ToString(); testResultInfo.TotalTotalMerged = args.MergeCount.ToString(); testResultInfo.TotalErrors = args.ErrorCount.ToString(); try { if (args.RecordCount == 0) { testResultInfo.ProjectedDuplicateRate = string.Format("{0:P}", 0); } else { testResultInfo.ProjectedDuplicateRate = string.Format("{0:P}", Decimal.Divide(args.DuplicateCount, args.RecordCount)); } } catch (Exception) { } SaveTestResultInfo(testResultInfo); LoadResults(); }
private void mb_ImportProgressChange(object sender, ImportProgressArgs e) { mCurrentBytes = e.CurrentBytes; mTotalBytes = e.TotalBytes; bw.ReportProgress(e.PercentageCompleted); }
private void backup_ImportProgressChanged(object sender, ImportProgressArgs e) { totalBytes = (int)e.TotalBytes; curBytes = (int)e.CurrentBytes; }
/// <summary> /// Gets the arguements from the handler to set the progress indicator. /// </summary> /// <param name="args">The args.</param> private void ImportHandler(ImportProgressArgs args) { RadProgressContext importProgress = RadProgressContext.Current; string percent; try { percent = Convert.ToString(Math.Round(Decimal.Divide(args.ProcessedCount, args.RecordCount) * 100)); importProgress["PrimaryPercent"] = percent; } catch(Exception) { percent = "0"; } importProgress["PrimaryPercent"] = percent; importProgress["PrimaryValue"] = String.Format("({0})", args.ProcessedCount.ToString()); importProgress["PrimaryTotal"] = String.Format("({0})", args.RecordCount.ToString()); importProgress["SecondaryValue"] = args.ImportedCount.ToString(); importProgress["SecondaryTotal"] = String.Format("{0} Duplicates:{1} Merged:{2} ", args.ErrorCount, args.DuplicateCount, args.MergeCount); if (args.ErrorCount > 0) { importProgress["ProcessCompleted"] = "True"; ImportManager importManager = Page.Session["importManager"] as ImportManager; if (importManager != null) { importManager.ImportHistory.ErrorCount = args.ErrorCount; importManager.ImportHistory.ProcessState = Enum.GetName(typeof (ImportProcessState), ImportProcessState.Completed); //importManager.ImportHistory. args.Message SetProcessState(importManager.ImportHistory.Id.ToString(), Enum.GetName(typeof(ImportProcessState), ImportProcessState.Abort), GetLocalResourceObject("AbortedMsg").ToString()); } } else importProgress["ProcessCompleted"] = "False"; }