/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Address != null) { hashCode = hashCode * 59 + Address.GetHashCode(); } if (OrderTotal != null) { hashCode = hashCode * 59 + OrderTotal.GetHashCode(); } if (OrderDate != null) { hashCode = hashCode * 59 + OrderDate.GetHashCode(); } if (ArrivalDate != null) { hashCode = hashCode * 59 + ArrivalDate.GetHashCode(); } if (Items != null) { hashCode = hashCode * 59 + Items.GetHashCode(); } if (OrderId != null) { hashCode = hashCode * 59 + OrderId.GetHashCode(); } return(hashCode); } }
// Override function public override string ToString() { return(string.Format("{0} from agency no. {1} has created the reservation no. {2} in {3}. Arrival date: {4}. {5} for {6}. Price: {7} NIS.", ContactPerson, AgencyID, ReservationID, ReservationDate.ToString(CalendarType), ArrivalDate.ToString(CalendarType), Beds == 1 ? "One bed" : Beds + " beds", Days == 1 ? "one day" : Days + " days", Price)); }
public override string ToString() { StringBuilder returnString = new StringBuilder(); returnString.Append("Res no." + ResID.ToString().PadLeft(2)); returnString.Append(";room " + Room.RoomNumber); returnString.Append(" by" + Customer.FirstName.ToString().PadLeft(15)); returnString.Append(Customer.LastName.ToString().PadLeft(12)); returnString.Append(" from" + ArrivalDate.ToShortDateString().PadLeft(11)); returnString.Append(" to" + DepartureDate.ToShortDateString().PadLeft(11)); return(returnString.ToString()); }
public override int GetHashCode() { var hashCode = 1339834214; hashCode = hashCode * -1521134295 + IdArmor.GetHashCode(); hashCode = hashCode * -1521134295 + ArrivalDate.GetHashCode(); hashCode = hashCode * -1521134295 + DateExecution.GetHashCode(); hashCode = hashCode * -1521134295 + StatusA.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Customer); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(NameService); return(hashCode); }
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); }
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> /// Returns true if Order instances are equal /// </summary> /// <param name="other">Instance of Order to be compared</param> /// <returns>Boolean</returns> public bool Equals(Order other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( OrderTotal == other.OrderTotal || OrderTotal != null && OrderTotal.Equals(other.OrderTotal) ) && ( OrderDate == other.OrderDate || OrderDate != null && OrderDate.Equals(other.OrderDate) ) && ( ArrivalDate == other.ArrivalDate || ArrivalDate != null && ArrivalDate.Equals(other.ArrivalDate) ) && ( Items == other.Items || Items != null && Items.Equals(other.Items) ) && ( OrderId == other.OrderId || OrderId != null && OrderId.Equals(other.OrderId) )); }
private void SerchButton_Click(object sender, RoutedEventArgs e) { if (DateTime.Compare(ArrivalDate.SelectedDate.Value, LeavingDate.SelectedDate.Value) < 0) { Area_ComboBox.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource(); Type_ComboBox.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource(); Adult_Textbox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); Children_Textbox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); ArrivalDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); LeavingDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); guestRequest.Pool = ThreeStateToChoice(SwimmingPool_CheckBox); guestRequest.Jacuzzi = ThreeStateToChoice(Jacuzzi_CheckBox); guestRequest.Garden = ThreeStateToChoice(Garden_CheckBox); guestRequest.ChildrensAttractions = ThreeStateToChoice(ChildrensAttractions_CheckBox); List <HostingUnit> HostingUnitList = bl.MachUnitToRequest(guestRequest); if (HostingUnitList.Count() == 0) { MessageBox.Show("Sorry, their is no hosting unit maching to your request!!"); GuestRequest_UserControl guestRequest_UserControl = new GuestRequest_UserControl(); (this.Parent as StackPanel).Children.Add(guestRequest_UserControl); (this.Parent as StackPanel).Children.Remove(this); } else { foreach (var hu in HostingUnitList) { HostingUnit_UserControl hostingUnit_UserControl = new HostingUnit_UserControl(hu, guestRequest); (this.Parent as StackPanel).Children.Add(hostingUnit_UserControl); } (this.Parent as StackPanel).Children.Remove(this); } } else { MessageBox.Show("Leaving day cannot be before arrival day!"); } }
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); }
public override string ToString() { return($"Room {RoomIndex, 2}: {ArrivalDate.ToShortDateString(), 10} - {DepartureDate.ToShortDateString(), 10}"); }
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()); }
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 override string ToString() { var client = _hotel.GetClient(IdClient); var room = _hotel.GetRoom(IdRoom); var category = _hotel.Categories[room.IdCategory].NameCategory; return(string.Format($"{category} №{room.RoomNumber}, {client.Surname} {client.Name}, заезд c {ArrivalDate.ToShortDateString()}")); }
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; } } }
public string GetArrivalDateFormatted() { return(ArrivalDate.ToShortDateString()); }
public IActionResult OnPost() { return(RedirectToPage(new { SearchEnabled = true, ArrivalDate = ArrivalDate.ToString("yyyy-MM-dd"), DepartureDate = DepartureDate.ToString("yyyy-MM-dd"), location = location.ToString() })); }