public static DataRow CreateRow(DeskQuote quote, DataTable table) { DataRow row = table.NewRow(); row["Customer Name"] = quote.GetCustomerName(); row["Quote Amount"] = quote.GetQuoteAmount(); row["Date of Completition"] = quote.GetCompletionDate(); row["Production Days"] = quote.GetProductionDays(); row["Desk Width"] = quote.GetDesk().GetDeskWidth(); row["Desk Depth"] = quote.GetDesk().GetDeskDepth(); row["Number of Drawers"] = quote.GetDesk().GetNumOfDrawers(); row["Material"] = quote.GetDesk().GetDeskMaterial(); return(row); }
public MainMenu() { InitializeComponent(); //Load in Rush Order Pricing DeskQuote.GetRushOrder(); //Load JSon if (File.Exists(quotesFile)) { string json = File.ReadAllText(quotesFile); List <DeskQuote> deser = JsonConvert.DeserializeObject <List <DeskQuote> >(json); //Error checking maybe? quotes = deser; } }
private void createButton_Click(object sender, EventArgs e) { if (checkValid()) { try { DeskMaterial material; Enum.TryParse <DeskMaterial>(materialComboBox.SelectedValue.ToString(), out material); deskQuote = new DeskQuote(nameTextBox.Text, int.Parse(widthNum.Text), int.Parse(depthNum.Text), int.Parse(drawersNum.Text), material, (int)daysComboBox.SelectedItem); MainMenu.GetQuotes().Add(deskQuote); DisplayQuote quote = new DisplayQuote(deskQuote); quote.Tag = this; quote.Show(this); Hide(); } catch (Exception exe) { errorLabel.Text = exe.Message; } } }
public DisplayQuote(DeskQuote desk) { deskQuote = desk; InitializeComponent(); displayVariables(); }