public IList <OrderDriverInfo> getOrderDriverInfo(DateTime?StartDt = null, DateTime?EndDt = null, string OrderStatusCode = null, string VendorOrderID = null, string UserName = null, string CompanyAddressID = null) { if (string.IsNullOrEmpty(VendorOrderID) && ( ((string.IsNullOrEmpty(OrderStatusCode) || !StartDt.HasValue || !EndDt.HasValue) || (StartDt.HasValue && StartDt.Value == DateTime.MinValue) || (string.IsNullOrEmpty(CompanyAddressID)) || (EndDt.HasValue && EndDt.Value == DateTime.MinValue)) && (string.IsNullOrEmpty(UserName)) )) { throw new Exception("Invalid Parameter"); } return(_orderDataAccess.getOrderDriverInfo(StartDt.HasValue ? StartDt.Value.ToShortDateString() : string.Empty, EndDt.HasValue ? EndDt.Value.ToShortDateString() : string.Empty, OrderStatusCode, VendorOrderID, UserName, CompanyAddressID)); }