Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = AlertID;
         hashCode = (hashCode * 397) ^ Code;
         hashCode = (hashCode * 397) ^ (Source != null ? Source.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Severity != null ? Severity.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Created.GetHashCode();
         hashCode = (hashCode * 397) ^ SnoozedEndDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (ThresholdValue1 != null ? ThresholdValue1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue2 != null ? ThresholdValue2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue3 != null ? ThresholdValue3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue4 != null ? ThresholdValue4.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue5 != null ? ThresholdValue5.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DeviceGuid != null ? DeviceGuid.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AdditionalInfo != null ? AdditionalInfo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AlertCategoryID != null ? AlertCategoryID.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Archived.GetHashCode();
         hashCode = (hashCode * 397) ^ ArchivedDate.GetHashCode();
         hashCode = (hashCode * 397) ^ TicketID.GetHashCode();
         hashCode = (hashCode * 397) ^ (AlertMessage != null ? AlertMessage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DeviceName != null ? DeviceName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomerID;
         hashCode = (hashCode * 397) ^ (CustomerName != null ? CustomerName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MessageTemplate != null ? MessageTemplate.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ FolderID.GetHashCode();
         hashCode = (hashCode * 397) ^ PollingCyclesCount.GetHashCode();
         return(hashCode);
     }
 }
 /// <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 (TicketID != null)
             hashCode = hashCode * 59 + TicketID.GetHashCode();
         if (TicketEventDateID != null)
             hashCode = hashCode * 59 + TicketEventDateID.GetHashCode();
         return hashCode;
     }
 }
        protected void bindTicketList()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            ITicketService      service = new TicketService();
            var       lst = service.Lists().Select(x => new { Name = x.Number + " " + x.Price, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                TicketID.DataSource     = dt;
                TicketID.DataTextField  = "Name";
                TicketID.DataValueField = "ID";
                TicketID.DataBind();
            }
            else
            {
                TicketID.DataBind();
            }
        }
        /// <summary>
        /// Returns true if Ticket instances are equal
        /// </summary>
        /// <param name="other">Instance of Ticket to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Ticket other)
        {
            if (ReferenceEquals(null, other))
                return false;
            if (ReferenceEquals(this, other))
                return true;

            return
                (
                    TicketID == other.TicketID ||
                    TicketID != null &&
                    TicketID.Equals(other.TicketID)
                ) &&
                (
                    TicketEventDateID == other.TicketEventDateID ||
                    TicketEventDateID != null &&
                    TicketEventDateID.Equals(other.TicketEventDateID)
                );
        }
Exemplo n.º 5
0
        /// <summary>
        /// Returns true if Ticket instances are equal
        /// </summary>
        /// <param name="other">Instance of Ticket to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(FullTicket other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TicketID == other.TicketID ||
                     TicketID != null &&
                     TicketID.Equals(other.TicketID)
                     ) &&
                 (
                     EventDate == other.EventDate ||
                     EventDate != null &&
                     EventDate.Equals(other.EventDate)
                 ));
        }
Exemplo n.º 6
0
    //对系统返回的票信息进行处理
    private void ConcentrationNotice(string TransMessage)
    {
        System.Xml.XmlDocument XmlDoc = new XmlDocument();
        XmlDoc.Load(new StringReader(TransMessage));

        System.Xml.XmlNodeList nodesMessengerID = XmlDoc.GetElementsByTagName("messengerID");
        System.Xml.XmlNodeList nodes            = XmlDoc.GetElementsByTagName("ticket");

        string TicketID;
        string DealTime;
        string Status;
        string Message;

        if (nodes != null)
        {
            for (int j = 0; j < nodes.Count; j++)
            {
                TicketID = nodes[j].Attributes["id"].Value;
                DealTime = nodes[j].Attributes["dealTime"].Value;
                Status   = nodes[j].Attributes["status"].Value;
                Message  = nodes[j].Attributes["message"].Value;

                int ReturnValue = 0;
                //string ReturnDescription = "";

                int Result = 0;

                //if (Status == "0000")
                //{
                //    Result = DAL.Procedures.P_SchemesSendToCenterHandle(TicketID, DealTime, 1, "", 101, ref ReturnValue, ref ReturnDescription);
                //}
                //else
                //{
                //    Result = DAL.Procedures.P_SchemesSendToCenterHandle(TicketID, DealTime, -1, Message, 101, ref ReturnValue, ref ReturnDescription);
                //}

                if (Result < 0)
                {
                    PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "ElectronTicket_HPCQ_Receive");

                    return;
                }

                if (ReturnValue < 0)
                {
                    new Log("ElectronTicket\\HPCQ").Write("对恒朋-重庆电子票网所发送的电子票数据处理出错:部分票写入错误。票号:" + TicketID.ToString());

                    continue;
                }
            }

            ReNotice(GetFromXPath(TransMessage, "message/header/messengerID"), "504");
        }
    }
Exemplo n.º 7
0
        private void addbutton_Click(object sender, EventArgs e)
        {
            SqlConnection con   = new SqlConnection("Data Source=AHMED\\SQLEXPRESS;Initial Catalog=Our_Project;Integrated Security=True");
            int           count = 0;

            try
            {
                con.Open();

                string UpdateSting = @"update Ticket set Reservation_Date = @resrvationDate ,
                                     Trip_Date = @tripDate , From_Destination = @fromDestination ,
                                     To_Destination = @toDestination , Arrival_Time = @arrivalTime , leave_Time = @leaveTime , 
                                     Trip_Duration = @tripDuration ,Seat_Number=@seatNum ,Trip_cost=@tripCost  where ID =@id_ticket ";

                SqlCommand cmd = new SqlCommand(UpdateSting, con);

                SqlParameter paramidTicket = new SqlParameter("@id_ticket", TicketID.Text);
                cmd.Parameters.Add(paramidTicket);

                SqlParameter paramres_date = new SqlParameter("@resrvationDate", dateTimePicker1.Text);
                cmd.Parameters.Add(paramres_date);

                SqlParameter paramtripdate = new SqlParameter("@tripDate", dateTimePicker2.Text);
                cmd.Parameters.Add(paramtripdate);

                SqlParameter paramfromdes = new SqlParameter("@fromDestination", t3.Text);
                cmd.Parameters.Add(paramfromdes);

                SqlParameter paramTodes = new SqlParameter("@toDestination", t4.Text);
                cmd.Parameters.Add(paramTodes);

                SqlParameter paramarrivaltime = new SqlParameter("@arrivalTime", dateTimePicker3.Text);
                cmd.Parameters.Add(paramarrivaltime);

                SqlParameter paramleavetime = new SqlParameter("@leaveTime", dateTimePicker4.Text);
                cmd.Parameters.Add(paramleavetime);

                SqlParameter paramtripdur = new SqlParameter("@tripDuration", t7.Text);
                cmd.Parameters.Add(paramtripdur);

                SqlParameter paramseatnum = new SqlParameter("@seatNum", t8.Text);
                cmd.Parameters.Add(paramseatnum);

                SqlParameter paramtripcost = new SqlParameter("@tripCost", t9.Text);
                cmd.Parameters.Add(paramtripcost);


                cmd.ExecuteNonQuery();
                //con.Close();
                MessageBox.Show("Updated");
                dateTimePicker1.Text = "";
                dateTimePicker2.Text = "";
                t3.Clear();
                t4.Clear();
                dateTimePicker3.Text = "";
                dateTimePicker4.Text = "";
                t7.Clear();
                t8.Clear();
                t9.Clear();
                TicketID.Clear();
                con.Close();
            }
            catch (Exception exep)
            {
                count++;
                //t1.Clear();
                //t2.Clear();
                //t3.Clear();
                //t4.Clear();
                //t5.Clear();
                //t6.Clear();
                //t7.Clear();
                //t8.Clear();
                //t9.Clear();
                //TicketID.Clear();
                if (count == 1 || count == 2)
                {
                    MessageBox.Show(string.Format("An error occurred while Updating try again:", exep.Message));
                }
                else
                {
                    MessageBox.Show(string.Format(" da anta 7omar b2a :", exep.Message));
                }
            }
        }