Source

main / Source / Excel / Excel.AddIn / Excel.AddIn / Extensions / ErrorDetailExtension.cs

Full commit

using DataUp.Excel.BizLogic;

namespace DataUp.Excel.Addin
{
    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public static class ErrorDetailExtension
    {
        public static ErrorDetail SetValuesFrom(this ErrorDetail thisObject, ErrorDetailViewModel error)
        {
            if (thisObject == null)
            {
                thisObject = new ErrorDetail();
            }

            thisObject.ControlName = error.Title;
            thisObject.Error = error.Error;
            thisObject.Category = error.Category;
            thisObject.Description = error.Description;
            thisObject.Recommendation = error.Recommendation;
            thisObject.ErrorAddress = error.ErrorAddress;
            thisObject.SheetName = error.SheetName;
            thisObject.IsRemovable = error.IsRemovable;

            return thisObject;
        }
    }
}