public Dictionary <string, string> GetParameterKeyValuePairs()
        {
            var result = new Dictionary <string, string>();

            result["originLocationCode"]      = OriginIATACode;
            result["destinationLocationCode"] = DestinationIATACode;
            result["departureDate"]           = DepartureDate.ToString("yyyy-MM-dd");
            result["adults"] = Adults.ToString();
            if (ReturnDate.HasValue)
            {
                result["returnDate"] = ReturnDate.Value.ToString("yyyy-MM-dd");
            }
            if (Children.HasValue)
            {
                result["children"] = Children.ToString();
            }
            if (Infants.HasValue)
            {
                result["infants"] = Infants.ToString();
            }
            if (TravelClass.HasValue)
            {
                result["travelClass"] = TravelClass.ToString();
            }
            if (DirectFlightsOnly)
            {
                result["nonStop"] = DirectFlightsOnly.ToString().ToLower();
            }
            if (CurrencyCode != null)
            {
                result["currencyCode"] = CurrencyCode;
            }

            return(result);
        }
Ejemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((DepartureDate.GetHashCode() * 397) ^ ReturnDate.GetHashCode());
     }
 }
Ejemplo n.º 3
0
        void AutoRenameTitle()
        {
            if (!Name.IsNullOrEmpty() && Name != "新建查询" && Name.IndexOf("->") == -1)
            {
                return;
            }

            Name = (Resign ? "【改签】" : "") + DepartureDate.ToString("MM-dd") + " " + FromStationName.DefaultForEmpty("(未选)") + "->" + ToStationName.DefaultForEmpty("(未选)");
        }
 protected bool Equals(Flight other)
 {
     return(DepartureDate.Equals(other.DepartureDate) &&
            DepartureDateUtc.Equals(other.DepartureDateUtc) &&
            DepartureDateLocal.Equals(other.DepartureDateLocal) &&
            DepartureDateOffset.Equals(other.DepartureDateOffset) &&
            DepartureDateOffsetZero.Equals(other.DepartureDateOffsetZero) &&
            DepartureDateOffsetNonLocal.Equals(other.DepartureDateOffsetNonLocal));
 }
 public SampleArguments()
 {
     Id = 1;
     DepartureAirport = new Airport(1, "IST", "TR", "IST");
     DepartureDate    = DateTime.Today;
     ArrivalAirport   = new Airport(2, "AMS", "NL", "AMS");
     ArrivalDate      = DepartureDate.AddHours(3);
     Carrier          = new Airline(1, "TK", "THY", "ISTANBUL");
     FlightNumber     = "TK1953";
     Price            = 99;
 }
Ejemplo n.º 6
0
 public Ticket GetTicket()
 {
     return(new Ticket {
         StartingPointId = StartingPointId.ToString(),
         DestinationPointId = DestinationPointId.ToString(),
         StartingPointName = StartingPointName,
         DestinationPointName = DestinationPointName,
         DepartureDate = DepartureDate.ToString("dd.MM.yyy"),
         FirstName = FirstName,
         LastName = LastName
     });
 }
Ejemplo n.º 7
0
 public IEnumerable <NavigationParameter> ToParameterList()
 {
     return(new List <NavigationParameter>
     {
         new NavigationParameter(PropName.DepartureDate, DepartureDate.ToString(CultureInfo.InvariantCulture)),
         new NavigationParameter(PropName.DepartureCode, DepartureCode.ToString(CultureInfo.InvariantCulture)),
         new NavigationParameter(PropName.ArrivalCode, ArrivalCode.ToString(CultureInfo.InvariantCulture)),
         new NavigationParameter(PropName.FullPassengersCount, FullPassengersCount.ToString(CultureInfo.InvariantCulture)),
         new NavigationParameter(PropName.ChildPassengersCount, ChildPassengersCount.ToString(CultureInfo.InvariantCulture)),
         new NavigationParameter(PropName.ServiceClass, ServiceClass.ToString(CultureInfo.InvariantCulture)),
     });
 }
Ejemplo n.º 8
0
        public bool Equals(ReturnFlightDates other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(DepartureDate.Equals(other.DepartureDate) && ReturnDate.Equals(other.ReturnDate));
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = DepartureDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureDateUtc.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureDateLocal.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureDateOffset.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureDateOffsetZero.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureDateOffsetNonLocal.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 10
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Company != null ? Company.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (From != null ? From.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (To != null ? To.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ RequestedDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureDate.GetHashCode();
         hashCode = (hashCode * 397) ^ ArrivalDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ArrivalTime.GetHashCode();
         hashCode = (hashCode * 397) ^ Price.GetHashCode();
         return(hashCode);
     }
 }
        /// <summary>
        /// 获得上市公司高管信息字符串
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            string str = $"[{CodeTS}]{Name}\n";

            str += $"公告日期: {AnnouncementDate?.ToString("yyyy-MM-dd")}\n";
            str += $"性别: {Enum.GetName(typeof(Gender), Gender)}\n";
            str += $"职务:{Position}({PositionType})\n";
            str += $"学历: {Education}\n";
            str += $"国籍: {Nationality}\n";
            str += $"出生年月: {Birthday?.ToString("yyyy-MM")}({(int)((DateTime.Today - (Birthday??DateTime.Now)).TotalDays / 365)})\n";
            str += $"上任日期: {AppointmentDate?.ToString("yyyy-MM-dd")}\n";
            str += $"离任日期: {DepartureDate?.ToString("yyyy-MM-dd")}\n";
            str += $"个人简历: {Resume}\n";

            return(str);
        }
Ejemplo n.º 12
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DepartureDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ArrivalDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Shipper?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Carrier?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CurrentStatus?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ItemDescription?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Conditions?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AggregateVolume?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Priority?.GetHashCode() ?? 0);
            return(hashCode);
        }
Ejemplo n.º 13
0
        public override string ToString()
        {
            var resultString = new StringBuilder();

            resultString.Append($"Flight id: {Id}\r\n");
            resultString.Append("Flight target points (cities):\r\n");
            resultString.Append($"From: {From.Name}(id: {From.Id})\r\n");
            resultString.Append($"To: {To.Name}(id: {To.Id})\r\n");
            resultString.Append($"Departure date: {DepartureDate.ToString("dd-MM-yyyy")}, Arrival date: {ArrivalDate.ToString("dd-MM-yyyy")}\r\n");
            resultString.Append($"Flight status: {Status.ToString()}\r\n");
            resultString.Append("Aircrew:\r\n");
            foreach (var member in Aircrew)
            {
                resultString.Append($"{member.FirstName} {member.SecondName}(Id: {member.Id})\r\n");
            }

            return(resultString.ToString());
        }
Ejemplo n.º 14
0
 public IEnumerable <CalendarBookingDay> ExpandDays()
 {
     for (DateTime date = ArrivalDate; date < DepartureDate.AddDays(1); date = date.AddDays(1))
     {
         if (!OnlySelectedWeekdays)
         {
             yield return(new CalendarBookingDay {
                 Date = date, Booking = this
             });
         }
         else if (SelectedWeekdays != null)
         {
             // Use %7 to get sunday=0
             WeekdayType wd = (WeekdayType)((int)date.DayOfWeek % 7);
             if (SelectedWeekdays.Contains(wd))
             {
                 yield return new CalendarBookingDay {
                            Date = date, Booking = this
                 }
             }
             ;
         }
     }
 }
Ejemplo n.º 15
0
        public bool Equals(Flight other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(string.Equals(Company, other.Company) && string.Equals(From, other.From) && string.Equals(To, other.To) && RequestedDate.Equals(other.RequestedDate) && DepartureDate.Equals(other.DepartureDate) && ArrivalDate.Equals(other.ArrivalDate) && DepartureTime.Equals(other.DepartureTime) && ArrivalTime.Equals(other.ArrivalTime) && Price.Equals(other.Price));
        }
 public void MergeFrom(ReservationSummaryLite other)
 {
     if (other == null)
     {
         return;
     }
     if (other.entityId_ != null)
     {
         if (entityId_ == null)
         {
             entityId_ = new global::HOLMS.Types.Booking.Indicators.ReservationIndicator();
         }
         EntityId.MergeFrom(other.EntityId);
     }
     if (other.State != 0)
     {
         State = other.State;
     }
     if (other.BookingNumber != 0L)
     {
         BookingNumber = other.BookingNumber;
     }
     if (other.BookingPrefix.Length != 0)
     {
         BookingPrefix = other.BookingPrefix;
     }
     if (other.CurrentOccupiedRoomNumber.Length != 0)
     {
         CurrentOccupiedRoomNumber = other.CurrentOccupiedRoomNumber;
     }
     if (other.TerminalOccupiedRoomNumber.Length != 0)
     {
         TerminalOccupiedRoomNumber = other.TerminalOccupiedRoomNumber;
     }
     if (other.FirstNightAssignedRoomNumber.Length != 0)
     {
         FirstNightAssignedRoomNumber = other.FirstNightAssignedRoomNumber;
     }
     if (other.VehiclePlateInformation.Length != 0)
     {
         VehiclePlateInformation = other.VehiclePlateInformation;
     }
     if (other.arrivalDate_ != null)
     {
         if (arrivalDate_ == null)
         {
             arrivalDate_ = new global::HOLMS.Types.Primitive.PbLocalDate();
         }
         ArrivalDate.MergeFrom(other.ArrivalDate);
     }
     if (other.departureDate_ != null)
     {
         if (departureDate_ == null)
         {
             departureDate_ = new global::HOLMS.Types.Primitive.PbLocalDate();
         }
         DepartureDate.MergeFrom(other.DepartureDate);
     }
     if (other.RoomTypeName.Length != 0)
     {
         RoomTypeName = other.RoomTypeName;
     }
     if (other.OTANumber.Length != 0)
     {
         OTANumber = other.OTANumber;
     }
     if (other.GuestText.Length != 0)
     {
         GuestText = other.GuestText;
     }
     if (other.MasterFolioText.Length != 0)
     {
         MasterFolioText = other.MasterFolioText;
     }
     if (other.IsGroupAssociated != false)
     {
         IsGroupAssociated = other.IsGroupAssociated;
     }
     if (other.currentDueFromGuest_ != null)
     {
         if (currentDueFromGuest_ == null)
         {
             currentDueFromGuest_ = new global::HOLMS.Types.Primitive.MonetaryAmount();
         }
         CurrentDueFromGuest.MergeFrom(other.CurrentDueFromGuest);
     }
     if (other.GuaranteeStatus != 0)
     {
         GuaranteeStatus = other.GuaranteeStatus;
     }
     if (other.ReservationSource.Length != 0)
     {
         ReservationSource = other.ReservationSource;
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (entityId_ != null)
            {
                hash ^= EntityId.GetHashCode();
            }
            if (State != 0)
            {
                hash ^= State.GetHashCode();
            }
            if (BookingNumber != 0L)
            {
                hash ^= BookingNumber.GetHashCode();
            }
            if (BookingPrefix.Length != 0)
            {
                hash ^= BookingPrefix.GetHashCode();
            }
            if (CurrentOccupiedRoomNumber.Length != 0)
            {
                hash ^= CurrentOccupiedRoomNumber.GetHashCode();
            }
            if (TerminalOccupiedRoomNumber.Length != 0)
            {
                hash ^= TerminalOccupiedRoomNumber.GetHashCode();
            }
            if (FirstNightAssignedRoomNumber.Length != 0)
            {
                hash ^= FirstNightAssignedRoomNumber.GetHashCode();
            }
            if (VehiclePlateInformation.Length != 0)
            {
                hash ^= VehiclePlateInformation.GetHashCode();
            }
            if (arrivalDate_ != null)
            {
                hash ^= ArrivalDate.GetHashCode();
            }
            if (departureDate_ != null)
            {
                hash ^= DepartureDate.GetHashCode();
            }
            if (RoomTypeName.Length != 0)
            {
                hash ^= RoomTypeName.GetHashCode();
            }
            if (OTANumber.Length != 0)
            {
                hash ^= OTANumber.GetHashCode();
            }
            if (GuestText.Length != 0)
            {
                hash ^= GuestText.GetHashCode();
            }
            if (MasterFolioText.Length != 0)
            {
                hash ^= MasterFolioText.GetHashCode();
            }
            if (IsGroupAssociated != false)
            {
                hash ^= IsGroupAssociated.GetHashCode();
            }
            if (currentDueFromGuest_ != null)
            {
                hash ^= CurrentDueFromGuest.GetHashCode();
            }
            if (GuaranteeStatus != 0)
            {
                hash ^= GuaranteeStatus.GetHashCode();
            }
            if (ReservationSource.Length != 0)
            {
                hash ^= ReservationSource.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 18
0
 public override string ToString()
 {
     return($"Room {RoomIndex, 2}: {ArrivalDate.ToShortDateString(), 10} - {DepartureDate.ToShortDateString(), 10}");
 }
Ejemplo n.º 19
0
 public DepartureEdit()
 {
     DepartureDate = DateTime.Today;
     ReturnDate    = DepartureDate.AddDays(3);
 }
Ejemplo n.º 20
0
 // A convenience method to return the exact timestamp
 // a scheduled flight departs by taking the departure date
 // and adding the base flight's departure time to it.
 public DateTime GetDepartureTimestamp()
 {
     return(DepartureDate.Add(Flight.DepartureTime));
 }
Ejemplo n.º 21
0
 public IActionResult OnPost()
 {
     return(RedirectToPage(new { SearchEnabled = true, ArrivalDate = ArrivalDate.ToString("yyyy-MM-dd"), DepartureDate = DepartureDate.ToString("yyyy-MM-dd"), location = location.ToString() }));
 }
 public string GetDepartureDateFormatted()
 {
     return(DepartureDate.ToShortDateString());
 }
Ejemplo n.º 23
0
    public void FillPortCall()
    {
        int       Port_Call_Id = UDFLib.ConvertToInteger(Request.QueryString["StatusID"].ToString());
        DataTable dt           = objPortCall.Get_PortCall_List(Port_Call_Id, UDFLib.ConvertToInteger(ddlVessel.SelectedValue));

        //if(Port_Call_Id == 0)
        //    chkAutoDate.Enabled=false;
        if (dt.Rows.Count > 0)
        {
            tr1.Visible = true;
            ViewState["ReturnPortCallID"] = Request.QueryString["StatusID"].ToString();
            char[]   delimiterChars = { ' ', ',', '.', ':', '\t' };
            string   ArrivalDate, BerthingDate, DepartureDate;
            string[] ADate, BDate, DDate;
            string   Arrhr, Arrmin, Brhr, BrMin, DHr, DMin;

            if (dt.Rows[0]["Arrival"].ToString() != "")
            {
                ArrivalDate = dt.Rows[0]["Arrival"].ToString();
                DateTime dtArr = Convert.ToDateTime(dt.Rows[0]["Arrival"].ToString());
                ADate = ArrivalDate.Split(delimiterChars);
                //This change has been done to change the date format as per user selection
                dtpArrival.Text          = UDFLib.ConvertUserDateFormat(Convert.ToString(dtArr));
                Arrhr                    = ADate[1].ToString();
                Arrmin                   = ADate[2].ToString();
                ddlArrHour.SelectedValue = Arrhr.ToString();
                ddlArrMin.SelectedValue  = Arrmin.ToString();
            }
            else
            {
                if (ViewState["dtpArrival"] != null)
                {
                    //This change has been done to change the date format as per user selection
                    dtpArrival.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(ViewState["dtpArrival"]));

                    ddlArrHour.SelectedValue = ViewState["ddlArrHour"].ToString();
                    ddlArrMin.SelectedValue  = ViewState["ddlArrMin"].ToString();
                }
            }
            if (dt.Rows[0]["Berthing"].ToString() != "")
            {
                BerthingDate = dt.Rows[0]["Berthing"].ToString();
                DateTime dtBer = Convert.ToDateTime(dt.Rows[0]["Berthing"].ToString());
                BDate = BerthingDate.Split(delimiterChars);
                //This change has been done to change the date format as per user selection
                dtpBerthing.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dtBer));

                Brhr  = BDate[1].ToString();
                BrMin = BDate[2].ToString();
                ddlBerthingHour.SelectedValue = Brhr.ToString();
                ddlBerthingMin.SelectedValue  = BrMin.ToString();
            }
            if (dt.Rows[0]["Departure"].ToString() != "")
            {
                DepartureDate = dt.Rows[0]["Departure"].ToString();
                DateTime dtDep = Convert.ToDateTime(dt.Rows[0]["Departure"].ToString());
                DDate = DepartureDate.Split(delimiterChars);
                //This change has been done to change the date format as per user selection
                dtpDeparture.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dtDep));
                DHr  = DDate[1].ToString();
                DMin = DDate[2].ToString();
                ddlDepHr.SelectedValue  = DHr.ToString();
                ddlDepmin.SelectedValue = DMin.ToString();
            }
            else
            {
                if (ViewState["dtpDeparture"] != null)
                {
                    //This change has been done to change the date format as per user selection
                    dtpDeparture.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(ViewState["dtpDeparture"]));

                    ddlDepHr.SelectedValue  = ViewState["ddlDepHr"].ToString();
                    ddlDepmin.SelectedValue = ViewState["ddlDepmin"].ToString();
                }
            }
            DDLPort.SelectedValue = dt.Rows[0]["Port_ID"].ToString();
            if (dt.Rows[0]["Port_ID"].ToString() == "0")
            {
                txtlocation.Text       = dt.Rows[0]["Port_Name"].ToString();
                txtlocation.Visible    = true;
                chkNewLocation.Checked = true;
                DDLPort.Visible        = false;
            }
            else
            {
                txtlocation.Visible = false;
                DDLPort.Visible     = true;
                //DDLPort.Enabled = false;
            }

            //chkNewLocation.Visible = false;
            ddlCharterAgent.SelectedValue = dt.Rows[0]["Charterers_Agent"].ToString();
            ddlOwnersAgent.SelectedValue  = dt.Rows[0]["Owners_ID"].ToString();
            int warrisk   = Convert.ToInt16(dt.Rows[0]["IsWarRisk"].ToString());
            int ShipCrane = Convert.ToInt16(dt.Rows[0]["IsShipCraneReq1"].ToString());
            if (warrisk == 1)
            {
                chkWarRisk.Checked = true;
            }
            if (ShipCrane == 1)
            {
                chkShipCrane.Checked = true;
            }
            string Port_Call_Status = Convert.ToString(dt.Rows[0]["Port_Call_Status"].ToString());
            if (Port_Call_Status == "OMITTED")
            {
                chkPortCallStatus.Checked = true;
            }
            txtPortRemark.Text = dt.Rows[0]["Port_Remarks"].ToString();


            if (dt.Rows[0]["Auto_Date"].ToString() == "Y")
            {
                chkAutoDate.Checked     = true;
                dtpArrival.Enabled      = false;
                dtpBerthing.Enabled     = false;
                dtpDeparture.Enabled    = false;
                ddlArrHour.Enabled      = false;
                ddlArrMin.Enabled       = false;
                ddlBerthingHour.Enabled = false;
                ddlBerthingMin.Enabled  = false;
                ddlDepHr.Enabled        = false;
                ddlDepmin.Enabled       = false;
            }
            else
            {
                chkAutoDate.Checked     = false;
                dtpArrival.Enabled      = true;
                dtpBerthing.Enabled     = true;
                dtpDeparture.Enabled    = true;
                ddlArrHour.Enabled      = true;
                ddlArrMin.Enabled       = true;
                ddlBerthingHour.Enabled = true;
                ddlBerthingMin.Enabled  = true;
                ddlDepHr.Enabled        = true;
                ddlDepmin.Enabled       = true;
            }
        }
    }