| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace GreenTree.Nachtragsmanagement.Web.Models.Deviation
- {
- public class StatusDataModel
- {
- public int Id { get; set; }
- public string Description { get; set; }
- public static StatusDataModel FromStatus(Core.Domain.Deviation.Status statusEntity, bool newWhenIsNull)
- {
- if (statusEntity == null && newWhenIsNull)
- return new StatusDataModel
- {
- Id = -1
- };
- if (statusEntity == null && !newWhenIsNull)
- throw new ArgumentNullException("statusEntity", "Cannot create StatusDataModel from NULL status entity.");
- return new StatusDataModel
- {
- Id = statusEntity.Id,
- Description = statusEntity.Description
- };
- }
- public Core.Domain.Deviation.Status ToStatus()
- {
- return new Core.Domain.Deviation.Status
- {
- Id = this.Id,
- Description = this.Description
- };
- }
- }
- }
|