Ejemplo n.º 1
0
 public ItemType VHasUniqueName(ItemType itemType, IItemTypeService _itemTypeService)
 {
     if (String.IsNullOrEmpty(itemType.Name) || itemType.Name.Trim() == "")
     {
         itemType.Errors.Add("Name", "Tidak boleh kosong");
     }
     if (_itemTypeService.IsNameDuplicated(itemType))
     {
         itemType.Errors.Add("Name", "Tidak boleh diduplikasi");
     }
     return(itemType);
 }
Ejemplo n.º 2
0
 public ItemType VName(ItemType itemType, IItemTypeService _itemTypeService)
 {
     if (String.IsNullOrEmpty(itemType.Name) || itemType.Name.Trim() == "")
     {
         itemType.Errors.Add("Name", "Tidak boleh kosong");
     }
     if (_itemTypeService.IsNameDuplicated(itemType))
     {
         itemType.Errors.Add("Name", "Tidak boleh diduplikasi");
     }
     return itemType;
 }