private void BindEntityType() { int entityTypeId = Request.QueryString["EntityTypeId"].ToInt(); if (entityTypeId > 0) { EntityType entityTypeLookup = EntityTypeDAL.GetItem(entityTypeId); if (entityTypeLookup != null) { lblEntityTypeId.Text = entityTypeLookup.EntityTypeId.ToString(); lblEntityId.Text = entityTypeLookup.EntityId.ToString(); lblEntityTypeName.Text = entityTypeLookup.EntityTypeName; lblDisplayName.Text = entityTypeLookup.DisplayName; lblDescription.Text = entityTypeLookup.Description; } else { lblMessage.Text = "EntityType could not be found."; } } else { lblMessage.Text = "Invalid ID. EntityType record could not be found."; } }
public static EntityType GetItem(int entityTypeId) { BrokenRuleCollection saveBrokenRules = new BrokenRuleCollection(); if (entityTypeId <= 0) { saveBrokenRules.Add("Entity Type", "Invalid Id" + entityTypeId.ToString()); throw new BLLException("There was an error saving Email", saveBrokenRules); } EntityType item = EntityTypeDAL.GetItem(entityTypeId); if (item == null) { saveBrokenRules.Add("EntityType", "Could not retrieve record with ID:" + entityTypeId.ToString()); // Validation successful - call data access layer to save throw new BLLException("Error : No record found ", saveBrokenRules); } else { return(item); } }
private void BindEntityType() { int entityTypeId = Request.QueryString["EntityTypeId"].ToInt(); if (entityTypeId > 0) { EntityType entityTypeLookup = EntityTypeDAL.GetItem(entityTypeId); if (entityTypeLookup != null) { lblEntityTypeId.Text = entityTypeLookup.EntityTypeId.ToString(); lblEntityId.Text = entityTypeLookup.EntityId.ToString(); lblEntityTypeName.Text = entityTypeLookup.EntityTypeName.ToString(); } else { lblMessage.Text = "Instructor could not be found."; } } else { lblMessage.Text = "Invalid Id. Instructor record could not be found."; } }