Пример #1
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 17;
                hash = hash * 23 + CustomerTypeID.GetHashCode();

                return(hash);
            }
        }
Пример #2
0
        private void GetCustomerDetails()
        {
            int CustomerTypeID;

            SqlConnection sqlcon = new SqlConnection(Globals.ConnectionString);

            sqlcon.Open();
            string        cmd    = "SELECT CustomerID, OrderID FROM Orders WHERE OrderID ='" + listBox1.Text.ToString() + "'";
            SqlCommand    sqlcom = new SqlCommand(cmd, sqlcon);
            SqlDataReader dr     = sqlcom.ExecuteReader();

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    CustomerID = Convert.ToInt32((dr["CustomerID"]));
                    OrderID    = Convert.ToInt32((dr["OrderID"]));

                    SqlConnection sqlcon2 = new SqlConnection(Globals.ConnectionString);
                    sqlcon2.Open();
                    string        cmd2    = "SELECT * FROM Customer WHERE CustomerID ='" + CustomerID.ToString() + "'";
                    SqlCommand    sqlcom2 = new SqlCommand(cmd2, sqlcon2);
                    SqlDataReader dr2     = sqlcom2.ExecuteReader();
                    if (dr2.HasRows)
                    {
                        while (dr2.Read())
                        {
                            txtCustomerName.Text = (dr2["CustomerName"].ToString());
                            txtPhoneNumber.Text  = (dr2["CustomerPhoneNumber"].ToString());
                            CustomerTypeID       = Convert.ToInt32((dr2["CustomerTypeID"]));

                            SqlConnection sqlcon3 = new SqlConnection(Globals.ConnectionString);
                            sqlcon3.Open();
                            string        cmd3    = "SELECT Description FROM CustomerType WHERE CustomerTypeID ='" + CustomerTypeID.ToString() + "'";
                            SqlCommand    sqlcom3 = new SqlCommand(cmd3, sqlcon3);
                            SqlDataReader dr3     = sqlcom3.ExecuteReader();
                            if (dr3.HasRows)
                            {
                                while (dr3.Read())
                                {
                                    txtCustomerType.Text = (dr3["Description"].ToString());
                                }
                            }
                            dr3.Close();
                            sqlcon3.Close();
                        }
                    }
                    dr2.Close();
                    sqlcon2.Close();
                }
            }
            dr.Close();
            sqlcon.Close();
        }
 public void Dispose()
 {
     _AllList.Remove(this);
     _AllByPrimaryKey.Remove(CustomerID.ToString() + "_" + CustomerTypeID.ToString());
 }
Пример #4
0
 public override string ToString()
 {
     return CustomerID.ToString() + "," + CustomerName + "," + CustomerTypeID.ToString();
 }