Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Addressed for Version 1.04 » View Incident Report |
Serious |
Reported By: Chris Holland Reported On: 7/2/2007 For: Version 1.04 Build 4 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.Odbc; using System.IO; namespace Test { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void StartButton_Click(object sender, EventArgs e) { AddButton.Enabled = false; OdbcConnection Connection = new OdbcConnection(); Connection.ConnectionString = "DSN=Test"; try { Connection.Open(); OdbcCommand Command = new OdbcCommand(); Command.Connection = Connection; string SQL = "INSERT INTO EstimateHeader" + " (" + "Name,Password,CustomerCode,CustomerTypeName,CustomerLastName" + ",CustomerFirstName,CustomerFullName" + ",CustomerSageAccount,CustomerSageDepartment,CustomerContact1LastName" + ",CustomerContact1FirstName,CustomerContact1Phone,CustomerContact1Fax" + ",CustomerContact1Mobile,CustomerContact1Email,CustomerContact2LastName" + ",CustomerContact2FirstName" + ",CustomerContact2Phone,CustomerContact2Fax,CustomerContact2Mobile" + ",CustomerContact2Email,CustomerAddress,CustomerPostcode,CustomerArea" + ",SiteCode,SiteTypeName,SiteLastName" + ",SiteFirstName,SiteFullName,SiteContact1LastName,SiteContact1FirstName" + ",SiteContact1Phone,SiteContact1Fax,SiteContact1Mobile,SiteContact1Email" + ",SiteContact2LastName,SiteContact2FirstName" + ",SiteContact2Phone,SiteContact2Fax,SiteContact2Mobile,SiteContact2Email" + ",SiteAddress,SitePostcode,SiteArea,CreatedBy,Manager,EstimateType,DateCreated,TenderInDate" + ",TenderDueDate,EstimateFinishedDate,OrderedDate,StartDate,EndDate,Submitted,Won,WinValue,Description" + ",MaterialTrade,MaterialNet,MaterialOHNet,MaterialRetail" + ",SubcontractTrade,SubcontractNet,SubcontractOHNet,SubcontractRetail" + ",PlantTrade,PlantNet,PlantOHNet,PlantRetail,OtherTrade,OtherNet,OtherOHNet" + ",OtherRetail,FitTimeA,LabourCostA,LabourOHCostA,LabourRetailA,Mcd" + ",ScheduleLabour,ScheduleMaterial,Prelims,ProvisionalSums,TotalValue)" + " VALUES(?,?,?,?,?,?,?" + ",?,?,?,?,?,?,?,?,?,?" + ",?,?,?,?,?,?,?,?,?,?" + ",?,?,?,?,?,?,?,?,?,?" + ",?,?,?,?,?,?,?,?,?,?,?,?" + ",?,?,?,?" + ",?,?,?,?,?,?,?,?,?,?" + ",?,?,?,?,?,?,?,?,?,?" + ",?,?,?,?,?,?,?,?,?,?,?)"; Command.CommandText = SQL; Command.Parameters.Clear(); Command.Parameters.Add("Name", OdbcType.VarChar, 50); Command.Parameters.Add("Password", OdbcType.VarChar, 10); Command.Parameters.Add("CustomerCode", OdbcType.Int); Command.Parameters.Add("CustomerTypeName", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerLastName", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerFirstName", OdbcType.VarChar, 20); Command.Parameters.Add("CustomerFullName", OdbcType.VarChar, 70); Command.Parameters.Add("CustomerSageAccount", OdbcType.VarChar, 8); Command.Parameters.Add("CustomerSageDepartment", OdbcType.SmallInt); Command.Parameters.Add("CustomerContact1LastName", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact1FirstName", OdbcType.VarChar, 20); Command.Parameters.Add("CustomerContact1Phone", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact1Fax", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact1Mobile", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact1Email", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact2LastName", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact2FirstName", OdbcType.VarChar, 20); Command.Parameters.Add("CustomerContact2Phone", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact2Fax", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact2Mobile", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerContact2Email", OdbcType.VarChar, 50); Command.Parameters.Add("CustomerAddress", OdbcType.VarChar, 250); Command.Parameters.Add("CustomerPostcode", OdbcType.VarChar, 10); Command.Parameters.Add("CustomerArea", OdbcType.VarChar, 50); Command.Parameters.Add("SiteCode", OdbcType.Int); Command.Parameters.Add("SiteTypeName", OdbcType.VarChar, 50); Command.Parameters.Add("SiteLastName", OdbcType.VarChar, 50); Command.Parameters.Add("SiteFirstName", OdbcType.VarChar, 20); Command.Parameters.Add("SiteFullName", OdbcType.VarChar, 70); Command.Parameters.Add("SiteContact1LastName", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact1FirstName", OdbcType.VarChar, 20); Command.Parameters.Add("SiteContact1Phone", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact1Fax", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact1Mobile", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact1Email", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact2LastName", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact2FirstName", OdbcType.VarChar, 20); Command.Parameters.Add("SiteContact2Phone", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact2Fax", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact2Mobile", OdbcType.VarChar, 50); Command.Parameters.Add("SiteContact2Email", OdbcType.VarChar, 50); Command.Parameters.Add("SiteAddress", OdbcType.VarChar, 250); Command.Parameters.Add("SitePostcode", OdbcType.VarChar, 10); Command.Parameters.Add("SiteArea", OdbcType.VarChar, 50); Command.Parameters.Add("CreatedBy", OdbcType.VarChar, 50); Command.Parameters.Add("Manager", OdbcType.VarChar, 50); Command.Parameters.Add("EstimateType", OdbcType.VarChar, 50); Command.Parameters.Add("DateCreated", OdbcType.Date); Command.Parameters.Add("TenderInDate", OdbcType.Date); Command.Parameters.Add("TenderDueDate", OdbcType.Date); Command.Parameters.Add("EstimateFinishedDate", OdbcType.Date); Command.Parameters.Add("OrderedDate", OdbcType.Date); Command.Parameters.Add("StartDate", OdbcType.Date); Command.Parameters.Add("EndDate", OdbcType.Date); Command.Parameters.Add("Submitted", OdbcType.Bit); Command.Parameters.Add("Won", OdbcType.Bit); Command.Parameters.Add("WinValue", OdbcType.Double); Command.Parameters.Add("Description", OdbcType.Text); Command.Parameters.Add("MaterialTrade", OdbcType.Double); Command.Parameters.Add("MaterialNet", OdbcType.Double); Command.Parameters.Add("MaterialOHNet", OdbcType.Double); Command.Parameters.Add("MaterialRetail", OdbcType.Double); Command.Parameters.Add("SubcontractTrade", OdbcType.Double); Command.Parameters.Add("SubcontractNet", OdbcType.Double); Command.Parameters.Add("SubcontractOHNet", OdbcType.Double); Command.Parameters.Add("SubcontractRetail", OdbcType.Double); Command.Parameters.Add("PlantTrade", OdbcType.Double); Command.Parameters.Add("PlantNet", OdbcType.Double); Command.Parameters.Add("PlantOHNet", OdbcType.Double); Command.Parameters.Add("PlantRetail", OdbcType.Double); Command.Parameters.Add("OtherTrade", OdbcType.Double); Command.Parameters.Add("OtherNet", OdbcType.Double); Command.Parameters.Add("OtherOHNet", OdbcType.Double); Command.Parameters.Add("OtherRetail", OdbcType.Double); Command.Parameters.Add("FitTimeA", OdbcType.Double); Command.Parameters.Add("LabourCostA", OdbcType.Double); Command.Parameters.Add("LabourOHCostA", OdbcType.Double); Command.Parameters.Add("LabourRetailA", OdbcType.Double); Command.Parameters.Add("Mcd", OdbcType.Double); Command.Parameters.Add("ScheduleLabour", OdbcType.Double); Command.Parameters.Add("ScheduleMaterial", OdbcType.Double); Command.Parameters.Add("Prelims", OdbcType.Double); Command.Parameters.Add("ProvisionalSums", OdbcType.Double); Command.Parameters.Add("TotalValue", OdbcType.Double); Command.Parameters["Name"].Value = NameEdit.Text; Command.Parameters["Password"].Value = ""; Command.Parameters["CustomerCode"].Value = 0; Command.Parameters["CustomerTypeName"].Value = ""; Command.Parameters["CustomerLastName"].Value = ""; Command.Parameters["CustomerFirstName"].Value = ""; Command.Parameters["CustomerFullName"].Value = ""; Command.Parameters["CustomerSageAccount"].Value = ""; Command.Parameters["CustomerSageDepartment"].Value = 0; Command.Parameters["CustomerContact1LastName"].Value = ""; Command.Parameters["CustomerContact1FirstName"].Value = ""; Command.Parameters["CustomerContact1Phone"].Value = ""; Command.Parameters["CustomerContact1Fax"].Value = ""; Command.Parameters["CustomerContact1Mobile"].Value = ""; Command.Parameters["CustomerContact1Email"].Value = ""; Command.Parameters["CustomerContact2LastName"].Value = ""; Command.Parameters["CustomerContact2FirstName"].Value = ""; Command.Parameters["CustomerContact2Phone"].Value = ""; Command.Parameters["CustomerContact2Fax"].Value = ""; Command.Parameters["CustomerContact2Mobile"].Value = ""; Command.Parameters["CustomerContact2Email"].Value = ""; Command.Parameters["CustomerAddress"].Value = ""; Command.Parameters["CustomerPostcode"].Value = ""; Command.Parameters["CustomerArea"].Value = ""; Command.Parameters["SiteCode"].Value = 0; Command.Parameters["SiteTypeName"].Value = ""; Command.Parameters["SiteLastName"].Value = ""; Command.Parameters["SiteFirstName"].Value = ""; Command.Parameters["SiteFullName"].Value = ""; Command.Parameters["SiteContact1LastName"].Value = ""; Command.Parameters["SiteContact1FirstName"].Value = ""; Command.Parameters["SiteContact1Phone"].Value = ""; Command.Parameters["SiteContact1Fax"].Value = ""; Command.Parameters["SiteContact1Mobile"].Value = ""; Command.Parameters["SiteContact1Email"].Value = ""; Command.Parameters["SiteContact2LastName"].Value = ""; Command.Parameters["SiteContact2FirstName"].Value = ""; Command.Parameters["SiteContact2Phone"].Value = ""; Command.Parameters["SiteContact2Fax"].Value = ""; Command.Parameters["SiteContact2Mobile"].Value = ""; Command.Parameters["SiteContact2Email"].Value = ""; Command.Parameters["SiteAddress"].Value = ""; Command.Parameters["SitePostcode"].Value = ""; Command.Parameters["SiteArea"].Value = ""; Command.Parameters["CreatedBy"].Value = ""; Command.Parameters["Manager"].Value = ""; Command.Parameters["EstimateType"].Value = ""; Command.Parameters["DateCreated"].Value = DateTime.Today; Command.Parameters["TenderInDate"].Value = DateTime.Today; Command.Parameters["TenderDueDate"].Value = DateTime.Today; Command.Parameters["EstimateFinishedDate"].Value = DateTime.Today; Command.Parameters["OrderedDate"].Value = DateTime.Today; Command.Parameters["StartDate"].Value = DateTime.Today; Command.Parameters["EndDate"].Value = DateTime.Today; Command.Parameters["Submitted"].Value = false; Command.Parameters["Won"].Value = false; Command.Parameters["WinValue"].Value = 0.0; Command.Parameters["Description"].Value = ""; Command.Parameters["MaterialTrade"].Value = 0.0; Command.Parameters["MaterialNet"].Value = 0.0; Command.Parameters["MaterialOHNet"].Value = 0.0; Command.Parameters["MaterialRetail"].Value = 0.0; Command.Parameters["SubcontractTrade"].Value = 0.0; Command.Parameters["SubcontractNet"].Value = 0.0; Command.Parameters["SubcontractOHNet"].Value = 0.0; Command.Parameters["SubcontractRetail"].Value = 0.0; Command.Parameters["PlantTrade"].Value = 0.0; Command.Parameters["PlantNet"].Value = 0.0; Command.Parameters["PlantOHNet"].Value = 0.0; Command.Parameters["PlantRetail"].Value = 0.0; Command.Parameters["OtherTrade"].Value = 0.0; Command.Parameters["OtherNet"].Value = 0.0; Command.Parameters["OtherOHNet"].Value = 0.0; Command.Parameters["OtherRetail"].Value = 0.0; Command.Parameters["FitTimeA"].Value = 0.0; Command.Parameters["LabourCostA"].Value = 0.0; Command.Parameters["LabourOHCostA"].Value = 0.0; Command.Parameters["LabourRetailA"].Value = 0.0; Command.Parameters["Mcd"].Value = 0.0; Command.Parameters["ScheduleLabour"].Value = 0.0; Command.Parameters["ScheduleMaterial"].Value = 0.0; Command.Parameters["Prelims"].Value = 0.0; Command.Parameters["ProvisionalSums"].Value = 0.0; Command.Parameters["TotalValue"].Value = 0.0; Command.ExecuteNonQuery(); Command.Dispose(); } catch (FormatException fe) { MessageBox.Show(fe.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (OdbcException oe) { MessageBox.Show(oe.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ee) { MessageBox.Show(ee.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } Connection.Close(); AddButton.Enabled = true; } } }
This web page was last updated on Tuesday, April 23, 2024 at 08:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |