Beispiel #1
0
        /// <summary>
        /// 将ViewModel转换成数据库存储实体
        /// </summary>
        /// <returns></returns>
        public BarSection AsBarSection()
        {
            BarSectionService barSectionService = new BarSectionService();

            BarSection barSection = null;

            if (this.SectionId > 0)
            {
                barSection = barSectionService.Get(this.SectionId);
            }
            else
            {
                barSection = BarSection.New();
                barSection.TenantTypeId = TenantTypeIds.Instance().Bar();
            }
            barSection.Name                 = this.Name;
            barSection.Description          = this.Description;
            barSection.IsEnabled            = this.IsEnabled;
            barSection.ThreadCategoryStatus = this.ThreadCategoryStatus;
            return(barSection);
        }