public void Save(AssetStatusViewModel aStatusVM)
 {
      AssetStatus aStatus = new AssetStatus(aStatusVM.Id)
      {
          Name=aStatusVM.Name,
          Description=aStatusVM.Description,                
      };
      _assetStatusRepository.Save(aStatus);
  }
 AssetStatusViewModel Map(AssetStatus assetStatus)
 {
     return new AssetStatusViewModel
     {
         Name=assetStatus.Name,           
         Id=assetStatus.Id,
          IsActive = assetStatus._Status==EntityStatus.Active?true:false  ,    
         Description=assetStatus.Description
     };
 }
 public AssetStatusDTO Map(AssetStatus status)
 {
     if (status == null)
         return null;
     return Mapper.Map<AssetStatus, AssetStatusDTO>(status);
 }
示例#4
0
 protected Guid AddAssetStatus(string name, string description)
 {
     AssetStatus cType = new AssetStatus(Guid.NewGuid())
     {
         Name = name,
      
         Description = description
     };
     cType._SetStatus(EntityStatus.Active);
     return _assetStatusRepository.Save(cType);
 }