Exemplo n.º 1
0
        public FareCategoryList GetAllList()
        {
            OQL oql = new OQL(typeof(FareCategory));
             oql.OrderBy(FareCategory.Properties.CategoryName);

             return new FareCategory().GetList(oql);
        }
 public VehicleAdditionPriceSettingList GetList(int companyId, AdditionPriceType additionPriceType)
 {
     OQL oql = new OQL(typeof(VehicleAdditionPriceSetting));
      oql.AddCondition(Condition.Eq(VehicleAdditionPriceSetting.Properties.OperatorId, companyId));
      oql.AddCondition(Condition.Eq(VehicleAdditionPriceSetting.Properties.VAPSettingType, Convert.ToInt32(additionPriceType)));
      return this.GetList(oql);
 }
Exemplo n.º 3
0
 public RouteOrderList GetRouteOrderList(int bookingId)
 {
     OQL oql = new OQL(typeof(RouteOrder));
      oql.AddCondition(Condition.Eq(RouteOrder.Properties.BookingID, bookingId));
      oql.OrderBy(RouteOrder.Properties.IsPrimary);
      oql.OrderBy(RouteOrder.Properties.ID);
      return new RouteOrder().GetList(oql);
 }
Exemplo n.º 4
0
 public SubOQLCondition(OQL subOQL, SubQueryOP subQueryOP, SubQueryQuantifier subQueryQuantifier,string propertyName,object value)
 {
     _subOQL = subOQL;
     _subQueryOP = subQueryOP;
     _subQueryQuantifier = subQueryQuantifier;
     _propertyName = propertyName;
     _value = value;
 }
Exemplo n.º 5
0
 public RouteOrderDetailList GetListByRoute(int categoryId)
 {
     OQL oql = new OQL(typeof(RouteOrderDetail));
      oql.AddAssociation("FareType", "ft")
          .AddCondition(Condition.Eq("ft.CategoryId", categoryId));
      oql.AddCondition(Condition.Eq(RouteOrderDetail.Properties.RouteOrderID, this.ID));
      return new RouteOrderDetail().GetList(oql);
 }
Exemplo n.º 6
0
        public RouteList GetAllList()
        {
            OQL oql = new OQL(typeof(Route));
             oql.OrderBy(Route.Properties.OperatorId)
                 .OrderBy(Route.Properties.DeparturePortId)
                 .OrderBy(Route.Properties.ArriavlPortId);

             return new Route().GetList(oql);
        }
 public RouteOrderPassengerDetailList GetPassengerList(int bookingId)
 {
     OQL oql = new OQL(typeof(RouteOrderPassengerDetail));
      if (bookingId != 0)
          oql.AddAssociation("RouteOrder", "ro")
              .AddCondition(Condition.Eq("ro.BookingID", bookingId));
      oql.OrderBy(RouteOrderPassengerDetail.Properties.RouteOrderID);
      oql.OrderBy(RouteOrderPassengerDetail.Properties.IsLeader);
      return new RouteOrderPassengerDetail().GetList(oql);
 }
Exemplo n.º 8
0
        public FareTypeList GetFareTypeList(int operatorId, int fareCategoryId)
        {
            OQL oql = new OQL(typeof(FareType));
             if (operatorId != 0)
                 oql.AddCondition(Condition.Eq(FareType.Properties.OperatorId, operatorId));
             if (fareCategoryId != 0)
                 oql.AddCondition(Condition.Eq(FareType.Properties.CategoryId, fareCategoryId));

             return new FareType().GetList(oql);
        }
 public RouteOrderVehicleDetailList GetVehicleListByRoute(int routeOrderId)
 {
     OQL oql = new OQL(typeof(RouteOrderVehicleDetail));
      RouteOrderVehicleDetail v = new RouteOrderVehicleDetail();
      oql.AddAssociation("RouteOrderDetail", "rod")
          .AddCondition(Condition.Eq("rod.RouteOrderID", routeOrderId));
      oql.AddAssociation("RouteOrderDetail.FareType", "ft")
          .AddCondition(Condition.Eq("ft.CategoryId", 2));
      return new RouteOrderVehicleDetail().GetList(oql);
 }
Exemplo n.º 10
0
        public ScheduleList GetScheduleListForRoute(int routeId,DateTime startdate)
        {
            OQL oql = new OQL(typeof(Schedule))
               .AddAssociation("Fare","Fare")
               .AddCondition(Condition.Eq("Fare."+ Fare.Properties.RoutesID, routeId))
               .AddCondition(Condition.Ge(Schedule.Properties.SailingTime,startdate))
               .OrderBy(Schedule.Properties.SailingTime);

             return new Schedule().GetList(oql);
        }
Exemplo n.º 11
0
        public CompanyList GetCompanyList(string companyName)
        {
            OQL oql = new OQL(typeof(Company));
             if (!string.IsNullOrEmpty(companyName))
                 oql.AddCondition(Condition.Like(Company.Properties.CompanyName, companyName, LikeMode.Start));

             oql.OrderBy(Company.Properties.CompanyName);

             return new Company().GetList(oql);
        }
Exemplo n.º 12
0
 public RouteOrder GetPrimaryRouteOrder(int bookingId)
 {
     OQL oql = new OQL(typeof(RouteOrder));
      oql.AddCondition(Condition.Eq(RouteOrder.Properties.BookingID, bookingId));
      oql.AddCondition(Condition.Eq(RouteOrder.Properties.IsPrimary, true));
      RouteOrderList list = new RouteOrder().GetList(oql);
      if (list.Count >= 1)
          return list[0];
      else
          return null;
 }
Exemplo n.º 13
0
        public FareItemList GetFareItemList(int categoryId, int fareId)
        {
            OQL oql = new OQL(typeof(FareItem));
             if (categoryId != 0)
                 oql.AddAssociation("FareType", "ft")
                     .AddCondition(Condition.Eq("ft.CategoryId", categoryId));
             if (fareId != 0)
                 oql.AddCondition(Condition.Eq(FareItem.Properties.FareId, fareId));

             return new FareItem().GetList(oql);
        }
Exemplo n.º 14
0
        public BookingList GetBookingList(int statusId, DateTime startDate, DateTime endDate)
        {
            OQL oql = new OQL(typeof(Booking));
             if (statusId != 0)
                 oql.AddCondition(Condition.Eq(Booking.Properties.Status, statusId));

             oql.AddCondition(Condition.Ge(Booking.Properties.BookingDate, startDate));
             oql.AddCondition(Condition.Le(Booking.Properties.BookingDate, endDate));

             oql.OrderBy(Booking.Properties.BookingDate, OrderByDirect.Desc);

             return new Booking().GetList(oql);
        }
Exemplo n.º 15
0
 public static FareCategory GetCategoryByName(string categoryName)
 {
     OQL oql = new OQL(typeof(FareCategory));
      if (!string.IsNullOrEmpty(categoryName))
          oql.AddCondition(Condition.Eq(FareCategory.Properties.CategoryName, categoryName.Trim()));
      FareCategoryList list = new FareCategory().GetList(oql);
      if (list.Count == 1)
          return list[0];
      else if (list.Count > 1)
          throw new Exception("Duplicate Fare Category found.");
      else
          return null;
 }
 public RouteOrderPassengerDetailList GetPassengerListByRoute(int routeOrderId)
 {
     //RouteOrderPassengerDetail r = new RouteOrderPassengerDetail();
      //r.FareType.CategoryId
      OQL oql = new OQL(typeof(RouteOrderPassengerDetail));
      if (routeOrderId != 0)
          oql.AddAssociation("FareType", "ft")
              //.AddAssociation("Category", "c")
              .AddCondition(Condition.Eq("ft.CategoryId", 3));
      oql.AddCondition(Condition.Eq(RouteOrderPassengerDetail.Properties.RouteOrderID, routeOrderId));
      oql.OrderBy(RouteOrderPassengerDetail.Properties.IsLeader, OrderByDirect.Desc);
      return new RouteOrderPassengerDetail().GetList(oql);
 }
Exemplo n.º 17
0
        public static Company GetCompanyByShortName(string shortName)
        {
            OQL oql = new OQL(typeof(Company));
             if (string.IsNullOrEmpty(shortName))
                 return null;

             oql.AddCondition(Condition.Eq(Company.Properties.CompanyShortName, shortName));
             CompanyList list = new Company().GetList(oql);
             if (list.Count == 1)
                 return list[0];
             else
                 return null;
        }
Exemplo n.º 18
0
        public static Fare GetFareForSchedule(int routeId, DateTime depDateTime)
        {
            OQL oql = new OQL(typeof(Fare));
             oql.AddCondition(Condition.Eq(Fare.Properties.RoutesID, routeId));
             oql.AddCondition(Condition.Le(Fare.Properties.StartDate, depDateTime));
             oql.AddCondition(Condition.Ge(Fare.Properties.EndDate, depDateTime));

             FareList list = new Fare().GetList(oql);
             if (list.Count >= 1)
                 return list[0];
             else
                 return null;
        }
Exemplo n.º 19
0
        public ScheduleList GetScheduleList(int vesselId, int fareId, DateTime startTime, DateTime endTime)
        {
            OQL oql = new OQL(typeof(Schedule));
             if (vesselId != 0)
                 oql.AddCondition(Condition.Eq(Schedule.Properties.VesselId, vesselId));
             if (fareId!=0)
                 oql.AddCondition(Condition.Eq(Schedule.Properties.FareId, fareId));
             oql.AddCondition(Condition.Ge(Schedule.Properties.SailingTime, startTime));
             oql.AddCondition(Condition.Le(Schedule.Properties.SailingTime, endTime));

             oql.OrderBy(Schedule.Properties.SailingTime, OrderByDirect.Desc);

             return new Schedule().GetList(oql);
        }
Exemplo n.º 20
0
        public static Fare GetFareByRouteAndDateRange(int routeId, DateTime startDate, DateTime endDate)
        {
            OQL oql = new OQL(typeof(Fare));
             oql.AddCondition(Condition.Eq(Fare.Properties.RoutesID, routeId));
             oql.AddCondition(Condition.Eq(Fare.Properties.StartDate, startDate));
             oql.AddCondition(Condition.Eq(Fare.Properties.EndDate, endDate));

             FareList list = new Fare().GetList(oql);
             if (list.Count == 1)
                 return list[0];
             else if (list.Count > 1)
                 throw new Exception("Duplicate fare record found.");
             else
                 return null;
        }
Exemplo n.º 21
0
        public static Schedule GetScheduleByValues(int vesselId, int fareId, DateTime sailingTime, DateTime arrivalTime)
        {
            OQL oql = new OQL(typeof(Schedule));
             oql.AddCondition(Condition.Eq(Schedule.Properties.VesselId, vesselId));
             oql.AddCondition(Condition.Eq(Schedule.Properties.FareId, fareId));
             oql.AddCondition(Condition.Eq(Schedule.Properties.SailingTime, sailingTime));
             oql.AddCondition(Condition.Eq(Schedule.Properties.ArrivalTime, arrivalTime));

             ScheduleList list = new Schedule().GetList(oql);
             if (list.Count == 1)
                 return list[0];
             else if (list.Count > 1)
                 throw new Exception("Duplicate Schedule Found");
             else
                 return null;
        }
Exemplo n.º 22
0
        public static FareItem GetFareItemByValues(int fareTypeId, int fareId, int rangeStart, int rangeEnd, decimal amount)
        {
            OQL oql = new OQL(typeof(FareItem));
             oql.AddCondition(Condition.Eq(FareItem.Properties.FareTypeId, fareTypeId));
             oql.AddCondition(Condition.Eq(FareItem.Properties.FareId, fareId));
             oql.AddCondition(Condition.Eq(FareItem.Properties.RangeStart, rangeStart));
             oql.AddCondition(Condition.Eq(FareItem.Properties.RangeEnd, rangeEnd));
             oql.AddCondition(Condition.Eq(FareItem.Properties.Amount, amount));

             FareItemList list = new FareItem().GetList(oql);
             if (list.Count == 1)
                 return list[0];
             else if (list.Count > 1)
                 throw new Exception("Duplicate FareItem Found");
             else
                 return null;
        }
Exemplo n.º 23
0
        public static Route GetRouteByPortId(string depPortId, string arrPortId, int operatorId)
        {
            OQL oql = new OQL(typeof(Route));
             if (string.IsNullOrEmpty(depPortId) || string.IsNullOrEmpty(arrPortId) || operatorId <= 0)
                 return null;

             oql.AddCondition(Condition.Eq(Route.Properties.OperatorId, operatorId));
             oql.AddCondition(Condition.Eq(Route.Properties.DeparturePortId, depPortId));
             oql.AddCondition(Condition.Eq(Route.Properties.ArriavlPortId, arrPortId));

             RouteList list = new Route().GetList(oql);
             if (list.Count == 1)
                 return list[0];
             else if (list.Count > 1)
                 throw new Exception("Duplicate route with same operator, departure port and arrival port found.");
             else
                 return null;
        }
Exemplo n.º 24
0
        public static FareType GetFareTypeByValue(int operatorId, int categoryId, string fareTypeName, string fareTypeDesc)
        {
            OQL oql = new OQL(typeof(FareType));
             if (string.IsNullOrEmpty(fareTypeName) || string.IsNullOrEmpty(fareTypeDesc) || operatorId <= 0 || categoryId <= 0)
                 return null;

             oql.AddCondition(Condition.Eq(FareType.Properties.OperatorId, operatorId));
             oql.AddCondition(Condition.Eq(FareType.Properties.CategoryId, categoryId));
             oql.AddCondition(Condition.Eq(FareType.Properties.FareTypeName, fareTypeName));
             oql.AddCondition(Condition.Eq(FareType.Properties.FareTypeDescription, fareTypeDesc));

             FareTypeList list = new FareType().GetList(oql);
             if (list.Count == 1)
                 return list[0];
             else if (list.Count > 1)
                 throw new Exception("Duplicate Fare Type Found");
             else
                 return null;
        }
        public RouteOrderPassengerDetail GetPrimaryPassenger(int bookingId)
        {
            OQL oql = new OQL(typeof(RouteOrderPassengerDetail));
             if (bookingId != 0)
             {
                 oql.AddAssociation("RouteOrder", "ro")
                     .AddCondition(Condition.Eq("ro.BookingID", bookingId));
                 oql.AddCondition(Condition.Eq(RouteOrderPassengerDetail.Properties.IsLeader, true));
             }
             else
             {
                 return null;
             }
             RouteOrderPassengerDetailList list = new RouteOrderPassengerDetail().GetList(oql);
             if (list.Count >= 1)
                 return list[0];

             return null;
        }
 public RouteOrderVehicleDetail GetUnique(OQL oql)
 {
     return Dao.GetUnique(oql);
 }
 public RouteOrderVehicleDetailList GetList(OQL oql, int startRow, int pageSize)
 {
     return Dao.GetList(oql, startRow, pageSize);
 }
Exemplo n.º 28
0
 public VehicleType GetUnique(OQL oql)
 {
     return Dao.GetUnique(oql);
 }
 public RouteOrderVehicleDetailList GetList(OQL oql)
 {
     return Dao.GetList(oql);
 }
Exemplo n.º 30
0
 public SubOQLCondition(OQL subOQL, SubQueryOP subQueryOP, SubQueryQuantifier subQueryQuantifier)
 {
     _subOQL = subOQL;
     _subQueryOP = subQueryOP;
     _subQueryQuantifier = subQueryQuantifier;
 }