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); }
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; }