private void SearchHistry_Load(object sender, EventArgs e) { cr = new csvReader(@filepath, encode); for (int i = 0; i < cr.table.GetLength(0); i++) { dataGridView1.Rows.Add(cr.table[i, 0], cr.table[i, 1], cr.table[i, 2], cr.table[i, 3], cr.table[i, 4], cr.table[i, 5], cr.table[i, 6], cr.table[i, 7]); } }
public void SaveHistry() { cr = new csvReader(@filepath, encode); if (isCool) { optionText = "クール便"; } else { optionText = "通常"; } line = new string[] { datetime.ToString(), sender, receiver, length1, length2, length3, weight, optionText }; string[,] newTable = cr.AppendLine(cr.table, line, @filepath, encode); cr.Writecsv(newTable, @filepath, encode); }
public bool Init(bool usecool) { int row_Length, row_Weight; bool errorflg = false; row_Length = DecisonRowLength(sumlength); row_Weight = DecisionRowWight(weight); col = DecisionColmun(receiver_text); if (row_Length > row_Weight) { row = row_Length; } else { row = row_Weight; } if (DecisonRowLength(sumlength) == ERROR_NUM) { errorMessage += "3辺の長さ, "; errorflg = true; } if (DecisionRowWight(weight) == ERROR_NUM) { errorMessage += "重さ, "; errorflg = true; } if ((DecisionTable(sender_text)) == ERROR_STR) { errorMessage += "差出地, "; errorflg = true; } if ((DecisionColmun(receiver_text)) == ERROR_NUM) { errorMessage += "宛先県, "; errorflg = true; } if (errorflg) { errorMessage += " の入力に不備があります。"; MessageBox.Show(errorMessage); return(true); } else { Encoding encode = Encoding.GetEncoding("shift_jis"); string CurrentDir = Environment.CurrentDirectory; cr = new csvReader(CurrentDir + "/charge/YUPACK/" + DecisionTable(sender_text) + ".csv", encode); same_pre = new csvReader(CurrentDir + "/charge/YUPACK/same_pre.csv", encode); if (sender_text == receiver_text) { cr.table[row, col] = (int.Parse(cr.table[row, col], NumberStyles.AllowThousands) - int.Parse(same_pre.table[row, 0], NumberStyles.AllowThousands)).ToString(); } if (usecool) { charge = int.Parse(cr.table[row, col], NumberStyles.AllowThousands) + cool[row]; } else { charge = int.Parse(cr.table[row, col], NumberStyles.AllowThousands); } return(false); } }