예제 #1
0
 private static void Vaild(string flights, string passengers, string contact, string policyType, Service.Organization.Domain.ExternalInterfaceSetting setting)
 {
     if (string.IsNullOrEmpty(flights))
     {
         InterfaceInvokeException.ThrowParameterMissException("flights");
     }
     if (string.IsNullOrEmpty(passengers))
     {
         InterfaceInvokeException.ThrowParameterMissException("passengers");
     }
     if (string.IsNullOrEmpty(policyType))
     {
         InterfaceInvokeException.ThrowParameterMissException("policyType");
     }
     if (flights.Split('|').Count() != 16)
     {
         InterfaceInvokeException.ThrowParameterErrorException("flights");
     }
     foreach (var item in passengers.Split('^'))
     {
         if (item.Split('|').Count() != 4)
         {
             InterfaceInvokeException.ThrowParameterErrorException("passengers");
         }
     }
     if (contact != "" && contact.Split('|').Count() != 3)
     {
         InterfaceInvokeException.ThrowParameterErrorException("contact");
     }
     if ((setting.PolicyTypes & PolicyType.Bargain) != (PolicyType)byte.Parse(policyType) && (setting.PolicyTypes & PolicyType.Normal) != (PolicyType)byte.Parse(policyType) && (setting.PolicyTypes & PolicyType.Team) != (PolicyType)byte.Parse(policyType) && (setting.PolicyTypes & PolicyType.Special) != (PolicyType)byte.Parse(policyType))
     {
         InterfaceInvokeException.ThrowNoAccessException();
     }
     if (policyType != "2" && policyType != "4" && policyType != "8" && policyType != "16")
     {
         InterfaceInvokeException.ThrowParameterErrorException("policyType");
     }
 }