void Kit::ingestCsvInput(std::vector<std::vector<std::string>> csvFieldList)
{
	std::vector<std::string> csvField;
	std::string firstField;
	std::string quantity;
	std::string partNumber;
	std::string description;
	int line;

	for (int i = 0; i < csvFieldList.size(); i++)
	{

		line = i;
		csvField = csvFieldList[i];

		if (line == 0)
		{
			firstField = csvField[0];
			setKitName(firstField);
		}

		//checks if field is size 3 and if not header
		if (csvField.size() >= 3 && csvField[0] != "Qty")
		{
			quantity = csvField[0];
			partNumber = csvField[1];
			description = csvField[2];
			setQuantity(quantity);
			setPartNumber(partNumber);
			setDescription(description);
			setAttributes(getQuantity(), getDescription());
			addParts();
		}
	}
}//end ingestCsvInput()
Exemple #2
0
Invoice::Invoice(Date d, string num, string des, int q, float p) {
	setDateOrdered(d);
	setPartNumber(num);
	setDescription(des);
	setQuantity(q);
	setPrice(p);
}
void ModDownload::setPartNumber(const QString & partNumber) {
	if(partNumber.isEmpty()) { return; }
	bool valid = false;
	int value = partNumber.toInt(&valid, 10);
	if(valid) {
		setPartNumber(value);
	}
}
void ModDownload::setPartNumber(const char * partNumber) {
	if(partNumber == NULL || Utilities::stringLength(partNumber) == 0) { return; }
	bool valid = false;
	int value = QString(partNumber).toInt(&valid, 10);
	if(valid) {
		setPartNumber(value);
	}
}
Kit::Kit()
{
	setKitName("");
	setPartNumber("");
	setQuantity("");
	setDescription("");
	setAttributes("", "");

}//end Kit()