| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace GreenTree.Nachtragsmanagement.Web.Models.Appendix
- {
- public class StateDataModel
- {
- public int Id { get; set; }
- public string Description { get; set; }
- public static StateDataModel FromState(Core.Domain.Appendix.State stateEntity, bool newWhenIsNull)
- {
- if (stateEntity == null && newWhenIsNull)
- return new StateDataModel
- {
- Id = -1
- };
- if (stateEntity == null && !newWhenIsNull)
- throw new ArgumentNullException("stateEntity", "Cannot create StateDataModel from NULL state entity.");
- return new StateDataModel
- {
- Id = stateEntity.Id,
- Description = stateEntity.Description
- };
- }
- public Core.Domain.Appendix.State ToState()
- {
- return new Core.Domain.Appendix.State
- {
- Id = this.Id,
- Description = this.Description
- };
- }
- }
- }
|