private void searchBtn_Click(object sender, RoutedEventArgs e) { try { var selected = (dynamic)commandLst.SelectedItems[0]; var orderNumber = selected.Col1; var receiveNumber = selected.Col2; var recordDate = selected.Col3; var finishDate = selected.Col4; var customerName = selected.Col5; var productName = selected.Col6; List <String> cardData = new List <String>(); cardData.Add(orderNumber); cardData.Add(receiveNumber); cardData.Add(recordDate); cardData.Add(finishDate); cardData.Add(customerName); cardData.Add(productName); CultureInfo ci = new CultureInfo("en-US"); CheckStateDB(); String[] order = cardData[0].Split('-'); String getCardData = "SELECT cardCode, customerId, cardDetail, productId, produceAmount, requiredAmount FROM command_card" + " WHERE rowid = @id AND year = @year"; cmd = new MySqlCommand(getCardData, conn); cmd.Parameters.AddWithValue("@id", order[1].TrimStart('0')); cmd.Parameters.AddWithValue("@year", order[0]); reader = cmd.ExecuteReader(); reader.Read(); String[] allCode = reader.GetString("cardCode").Split(','); String[] allDetail = reader.GetString("cardDetail").Split(','); List <Object> allData = new List <Object>(); allData.Add(cardData[0]); allData.Add(allCode[0]); allData.Add(allCode[1]); allData.Add(allCode[2]); allData.Add(allCode[3]); allData.Add(reader.GetString("customerId")); allData.Add(reader.GetString("productId")); allData.Add(cardData[4]); allData.Add(cardData[5]); allData.Add(cardData[3]); allData.Add(cardData[1]); allData.Add(reader.GetString("requiredAmount")); allData.Add(reader.GetString("produceAmount")); allData.Add(allDetail[0]); allData.Add(allDetail[1]); allData.Add(allDetail[2]); Application.Current.Properties["cardExportData"] = allData; reader.Close(); CommandEdit ses = new CommandEdit(); ses.Show(); this.Close(); } catch (Exception ex) { ErrorLogCreate(ex); } }
private void MenuItem_Click_9(object sender, RoutedEventArgs e) { CommandEdit ses = new CommandEdit(); ses.Show(); }
private void searchBtn_Click(object sender, RoutedEventArgs e) { try { var selected = (dynamic)commandLst.SelectedItems[0]; var orderNumber = selected.Col1; var receiveNumber = selected.Col2; var recordDate = selected.Col3; var finishDate = selected.Col4; var customerName = selected.Col5; var productName = selected.Col6; List<String> cardData = new List<String>(); cardData.Add(orderNumber); cardData.Add(receiveNumber); cardData.Add(recordDate); cardData.Add(finishDate); cardData.Add(customerName); cardData.Add(productName); CultureInfo ci = new CultureInfo("en-US"); CheckStateDB(); String[] order = cardData[0].Split('-'); String getCardData = "SELECT cardCode, customerId, cardDetail, productId, produceAmount, requiredAmount FROM command_card" + " WHERE rowid = @id AND year = @year"; cmd = new MySqlCommand(getCardData, conn); cmd.Parameters.AddWithValue("@id", order[1].TrimStart('0')); cmd.Parameters.AddWithValue("@year", order[0]); reader = cmd.ExecuteReader(); reader.Read(); String[] allCode = reader.GetString("cardCode").Split(','); String[] allDetail = reader.GetString("cardDetail").Split(','); List<Object> allData = new List<Object>(); allData.Add(cardData[0]); allData.Add(allCode[0]); allData.Add(allCode[1]); allData.Add(allCode[2]); allData.Add(allCode[3]); allData.Add(reader.GetString("customerId")); allData.Add(reader.GetString("productId")); allData.Add(cardData[4]); allData.Add(cardData[5]); allData.Add(cardData[3]); allData.Add(cardData[1]); allData.Add(reader.GetString("requiredAmount")); allData.Add(reader.GetString("produceAmount")); allData.Add(allDetail[0]); allData.Add(allDetail[1]); allData.Add(allDetail[2]); Application.Current.Properties["cardExportData"] = allData; reader.Close(); CommandEdit ses = new CommandEdit(); ses.Show(); this.Close(); } catch (Exception ex) { ErrorLogCreate(ex); } }