public void AddBranch(Branch b) { if ((b.Phone).Length > 10 || b.Phone.Length < 9) { throw new Exception("the phone number is wrong!"); } if (b.Employees < 1) { throw new Exception("the employees number is wrong!"); } dal.AddBranch(b); }