/// <summary>
        /// Update
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static ReportColumnModel Update(ReportColumnModel model)
        {
            var entity = new ReportColumn();

            // check validate parent column
            if (!ValidateUpdateColumn(model.Id, model.Width, model.ParentId))
            {
                return(null);
            }
            // fill entity
            model.FillEntity(ref entity);

            return(new ReportColumnModel(ReportColumnServices.Update(entity)));
        }
        /// <summary>
        /// populate child menu
        /// </summary>
        /// <param name="allReportColumns"></param>
        /// <param name="reportColumn"></param>
        /// <param name="level"></param>
        /// <param name="treeReportColumns"></param>
        private static void PopulateChildReportColumn(List <ReportColumnModel> allReportColumns, ReportColumnModel reportColumn, int level, ref List <ReportColumnModel> treeReportColumns)
        {
            // init prefix
            var prefix = string.Empty;

            // set prefix value
            for (var levelCount = 1; levelCount <= level; levelCount++)
            {
                prefix += "+---";
            }

            // set display name
            reportColumn.ConfigName = "{0}{1}".FormatWith(prefix, reportColumn.Name);

            // set level
            reportColumn.Level = level;

            // add into menu tree
            treeReportColumns.Add(reportColumn);

            // get child
            var childReportColumns = allReportColumns.Where(m => m.ParentId == reportColumn.Id).OrderBy(m => m.Order);

            // loop
            foreach (var childReportColumn in childReportColumns)
            {
                PopulateChildReportColumn(allReportColumns, childReportColumn, level + 1, ref treeReportColumns);
            }
        }