Example #1
0
 public static void PrepareEventMessage(ExcelResult result, string eventName, bool isCancel)
 {
     if (isCancel)
     {
         result.ExcelMessages.Add(GenerateEvent(string.Format("在事件{0}中被取消", eventName), true));
         result.Result = ExcelResultType.Canceled;
     }
 }
Example #2
0
        public static void PrepareAreaMessage(ExcelResult result, string sheetName, AreaStatus areaStatus, string eventName)
        {
            switch (areaStatus)
            {
            case AreaStatus.Canceled:
                result.ExcelMessages.Add(ExcelMessageFactory.GenerateEvent(
                                             string.Format("工作表:{0}在事件{1}中被取消", sheetName, eventName), true));
                result.Result = ExcelResultType.Canceled;
                break;

            case AreaStatus.Skip:
                result.ExcelMessages.Add(ExcelMessageFactory.GenerateEvent(
                                             string.Format("工作表:{0}在事件{1}中被跳过", sheetName, eventName), false));
                break;
            }
        }
Example #3
0
        public static bool PrepareCellMessage(ExcelResult result, int iLoopRow, int jLoopCol, CellStatus cellStatus, string eventName)
        {
            bool breakFromIngore = false;

            switch (cellStatus)
            {
            case CellStatus.Canceled:
                result.ExcelMessages.Add(GenerateEvent(
                                             string.Format("第 {0} 行第 {1} 列在事件{2}中被取消", iLoopRow, jLoopCol, eventName), true));
                result.Result = ExcelResultType.Canceled;
                break;

            case CellStatus.IngoreRow:
                result.ExcelMessages.Add(GenerateEvent(
                                             string.Format("第 {0} 行第 {1} 列在事件{2}中被忽略", iLoopRow, jLoopCol, eventName), false));
                breakFromIngore = true;
                break;
            }
            return(breakFromIngore);
        }
Example #4
0
        public static void PrepareRowMessage(ExcelResult result, int iLoopRow, RowStatus rowStatus, string eventName)
        {
            switch (rowStatus)
            {
            case RowStatus.Canceled:
                result.ExcelMessages.Add(GenerateEvent(
                                             string.Format("第 {0} 行在事件{1}中被取消", iLoopRow, eventName), true));
                result.Result = ExcelResultType.Canceled;
                break;

            case RowStatus.Finish:
                result.ExcelMessages.Add(GenerateEvent(
                                             string.Format("第 {0} 行在事件{1}中被完成", iLoopRow, eventName), false));
                break;

            case RowStatus.Skip:
                result.ExcelMessages.Add(GenerateEvent(
                                             string.Format("第 {0} 行在事件{1}中被跳过", iLoopRow, eventName), false));
                break;
            }
        }