示例#1
0
        public static PreparedTransferSettings Create(IPreparedTransferSettings contractObject)
        {
            if (null == contractObject)
            {
                return(null);
            }

            if (contractObject is PreparedTransferSettings businessObject)
            {
                return(businessObject);
            }

            return(Mapper.Map <PreparedTransferSettings>(contractObject));
        }
示例#2
0
        private static GridRowContent BuildGridRowContent(IPreparedTransfer transfer, IPreparedTransferSettings transferSettings)
        {
            var gridRowContent = new GridRowContent(transfer.Id.ToString(), transfer);

            switch (transfer.State)
            {
            case PreparedTransferState.Failed:
                gridRowContent.BackColor          = transferSettings.FailedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.FailedColor);
                break;

            case PreparedTransferState.Registered:
                gridRowContent.BackColor          = Color.White;
                gridRowContent.SelectionBackColor = transferSettings.SelectionColor;
                break;

            case PreparedTransferState.Pended:
                gridRowContent.BackColor          = transferSettings.PendedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.PendedColor);
                break;

            case PreparedTransferState.Processed:
                gridRowContent.BackColor          = transferSettings.ProcessedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.ProcessedColor);
                break;

            case PreparedTransferState.Interrupted:
                gridRowContent.BackColor          = transferSettings.InterruptedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.InterruptedColor);
                break;

            case PreparedTransferState.Completed:
                gridRowContent.BackColor          = transferSettings.CompletedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.CompletedColor);
                break;
            }

            return(gridRowContent);
        }