Пример #1
0
 public void resetStaticVars()
 {
     SelectedIssue = -1;
     SelectedPartNumberPartName = new DGVPARTNUMNAMEITEM {
         PartNumber = "", PartName = "", PartSeries = ""
     };
     SelectedRPNumber = new DGVMULTIPLERP {
         RPNumber = "", LineNumber = -1, CustInfo = new CustomerInformation()
     };
     LogHandler.resetLog();
 }
Пример #2
0
        private void LoadRPView()
        {
            string        query = "SELECT * FROM CustomerRepairOrderFromJDE WHERE OrderNumber = '" + sOrderNumber + "'";
            SqlConnection conn  = new SqlConnection(holder.RepairConnectionString);
            SqlCommand    cmd   = new SqlCommand(query, conn);

            try
            {
                conn.Open();
                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        DGVMULTIPLERP dmpr = new DGVMULTIPLERP
                        {
                            RPNumber       = reader["ItemNumber"].ToString().TrimEnd(),
                            LineNumber     = Convert.ToDouble(reader["LineNumber"]),
                            CustomerNumber = reader["CustomerNumber"].ToString(),
                            CustomerName   = reader["CustomerName"].ToString(),
                            CustInfo       = new CustomerInformation()
                            {
                                CustomerNumber      = reader["CustomerNumber"].ToString(),
                                CustomerName        = reader["CustomerName"].ToString(),
                                CustomerAddy1       = reader["CustomerAddressLine1"].ToString(),
                                CustomerAddy2       = reader["CustomerAddressLine2"].ToString(),
                                CustomerAddy3       = reader["CustomerAddressLine3"].ToString(),
                                CustomerAddy4       = reader["CustomerAddressLine4"].ToString(),
                                CustomerCity        = reader["CustomerCity"].ToString(),
                                CustomerState       = reader["CustomerState"].ToString(),
                                CustomerPostalCode  = reader["CustomerPostalCode"].ToString(),
                                CustomerCountryCode = reader["CustomerCountryCode"].ToString()
                            }
                        };
                        dgItemInfo.Items.Add(dmpr);
                    }
                }
                conn.Close();
            }
            catch (Exception ex)
            {
                if (conn != null)
                {
                    conn.Close();
                }

                MessageBox.Show("There was an issue loading the Customer Information.\nError Message: " + ex.Message, "loadDGView()", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }