Example #1
0
		public void CreateAndSendEmails(int orderID, string pdfFilePath)
		{
			BPOrders bpOrder = new BPOrders();
			BPOrderDetails bpDetails = new BPOrderDetails();
			BEOrders dsOrder = bpOrder.SelectOrdersByID(orderID);
			dsOrder.Merge(bpDetails.SelectOrderDetailsWithInventoryByOrderID(orderID));
			BEOrders.tbl_OrdersRow order = (BEOrders.tbl_OrdersRow) dsOrder.tbl_Orders.Rows[0];

			BPCompanyEmails bp = new BPCompanyEmails();
			BPCompanies bpCompany = new BPCompanies();
			BPCompanyAliases bpAliases = new BPCompanyAliases();

			BECompanies ds = bp.SelectActiveCompanyEmailsByCompanyID(order.CompanyID);
			ds.Merge(bpCompany.SelectCompaniesByID(order.CompanyID));
			ds.Merge(bpAliases.SelectCompanyColumnsByCompanyID(order.CompanyID));

			BECompanies.tbl_CompanyAliasesRow aliases = (BECompanies.tbl_CompanyAliasesRow) ds.tbl_CompanyAliases.Rows[0];
			BECompanies.tbl_CompaniesRow company;
			bool hasHuntingInventoryAccess = false;
			string CompanyImage = "";

			if(ds.tbl_Companies.Count > 0)
			{
				company = (BECompanies.tbl_CompaniesRow) ds.tbl_Companies.Rows[0];

				if (!company.IsCompanyImageIDNull())
				{
					BPImages bpImages = new BPImages();
					BEImages DSImages = bpImages.SelectByID(company.CompanyImageID);
					string imageName = DSImages.tbl_Images.FindByImageID(company.CompanyImageID).ImageName;
					CompanyImage = "<img src='" + companyLogoPath + "l_" + imageName + "' />";
				}

				hasHuntingInventoryAccess = company.CompanyRentalInventory;
			}

			MailMessage mm = new MailMessage();
			mm.Subject = "Confirmation of " + _EmailType.ToUpper() + " ID:" + orderID;
			foreach (BECompanies.tbl_CompanyEmailsRow row in ds.tbl_CompanyEmails.Rows)
			{
				mm.To += row.CompanyEmail + ";";
			}

			mm.From = ConfigurationSettings.AppSettings.Get("AdministratorEmailFrom");
			
			mm.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = Convert.ToInt32(ConfigurationSettings.AppSettings["SmtpServerPort"]);
			SmtpMail.SmtpServer = ConfigurationSettings.AppSettings.Get("SmtpServer");

			string createOrder = "";
			createOrder += "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>";
			createOrder += "<Html><head><LINK href='" + cssLinkPath + "screen.css' type='text/css' rel='stylesheet'></head><body class='alignleft'><div class='top'></div><div class='wrap'>";

			createOrder += "<table border='0' cellspacing='0' cellpadding='0' style='margin-bottom:10px;' class='tablewidth'><tr>";
			createOrder += "<td><img src='" + huntingLogoPath + "' /></td>";
			createOrder += "<td style='text-align:right;'>" + CompanyImage + "</td>";
			createOrder += "</tr></table>";
			
			//new order details table
			createOrder += "<table class='orderdetails tablewidth'>";
			createOrder += "<tr><th colspan='4' class='heading'>Confirmation of " + _EmailType.ToUpper() + " ID: " + order.OrderID + "</th></tr><tr>";

			createOrder += "<th width='20%'>Date</th>";
			createOrder += "<td width='30%'>" + order.OrderDate.ToString("MMM d, yyyy h:mm tt") + "</td>";
			createOrder += "<th width='20%'>&nbsp;</th>";
			createOrder += "<td width='30%'>&nbsp;</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			if (_EmailType == "Order")
			{
				createOrder += "<th>Ordered By </th>";
			}
			else
			{
				createOrder += "<th>Received By </th>";
			}

			createOrder += "<td>" + order.OrderRequestedBy + "</td>";
			createOrder += "<th width='16%'>Rig </th>";
			createOrder += "<td width='34%'>" + order.OrderRigNumber + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			createOrder += "<th>Ship To </th>";
			createOrder += "<td>" + order.OrderShipTo + "</td>";
			createOrder += "<th>Job # </th>";
			createOrder += "<td>" + order.OrderJobNumber + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			createOrder += "<th>Via </th>";
			createOrder += "<td>" + order.OrderShipVIA + "</td>";
			createOrder += "<th>Lease </th>";
			createOrder += "<td>" + order.OrderLeaseNumber + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			if (_EmailType == "Order")
			{
				createOrder += "<th>Date Required </th>";
			}
			else
			{
				createOrder += "<th>Date Received </th>";
			}
			
			createOrder += "<td>" + order.OrderDateRequired.ToString("MMM d, yyyy") + "</td>";
			if (_EmailType == "Order")
			{
				createOrder += "<th>Time Required</th>";
			}
			else
			{
				createOrder += "<th>Time Received</th>";
			}
			
			createOrder += "<td>" + order.OrderTimeRequired + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			createOrder += "<th>Comments</th>";
			createOrder += "<td colspan='3'>" + order.OrderComments + "</td>";
			createOrder += "</tr></table><div style='page-break-after:avoid'>&nbsp;</div>";

			ArrayList columns = new ArrayList();
			createOrder += "<table class='emailitemdetails'><tr>";
			
			if(hasHuntingInventoryAccess)
			{
				createOrder += "<th width='40px'>B/R</th>";
				columns.Add("BuyRentStatus");
			}

			createOrder += "<th>" + aliases.ItemNumber + "</th>";
			columns.Add("ItemNumber");
			createOrder += "<th>" + aliases.Description +  "</th>";
			columns.Add("Description");
			createOrder += "<th>" + aliases.Box +  "</th>";
			columns.Add("Box");
			createOrder += "<th>" + aliases.Pin + "</th>";
			columns.Add("Pin");
			createOrder += "<th>" + aliases.MajorOD + "</th>";
			columns.Add("MajorOD");
			createOrder += "<th>" + aliases.MinorOD + "</th>";
			columns.Add("MinorOD");
			createOrder += "<th>" + aliases.InsideDiameter + "</th>";
			columns.Add("InsideDiameter");
			createOrder += "<th>" + aliases.SealtoSealLength + "</th>";
			columns.Add("SealtoSealLength");
			createOrder += "<th>" + aliases.FloatBore + "</th>";
			columns.Add("FloatBore");
			createOrder += "<th>" + aliases.Box2 + "</th>";
			columns.Add("Box2");
			createOrder += "<th>" + aliases.GeneralComments + "</th>";
			columns.Add("GeneralComments");

			if (!aliases.IsExtraColumn1Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn1 + "</th>";
				columns.Add("ExtraColumn1");
			}
			if (!aliases.IsExtraColumn2Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn2 + "</th>";
				columns.Add("ExtraColumn2");
			}
			if (!aliases.IsExtraColumn3Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn3 + "</th>";
				columns.Add("ExtraColumn3");
			}
			if (!aliases.IsExtraColumn4Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn4 + "</th>";
				columns.Add("ExtraColumn4");
			}
			if (!aliases.IsExtraColumn5Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn5 + "</th>";
				columns.Add("ExtraColumn5");
			}
			if (!aliases.IsExtraColumn6Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn6 + "</th>";
				columns.Add("ExtraColumn6");
			}
			if (!aliases.IsExtraColumn7Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn7 + "</th>";
				columns.Add("ExtraColumn7");
			}
			if (!aliases.IsExtraColumn8Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn8 + "</th>";
				columns.Add("ExtraColumn8");
			}
			if (!aliases.IsExtraColumn9Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn9 + "</th>";
				columns.Add("ExtraColumn9");
			}
			if (!aliases.IsExtraColumn10Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn10 + "</th>";
				columns.Add("ExtraColumn10");
			}
			createOrder += "<td class='lastcell'>&nbsp;&nbsp;</td></tr>";

			int rowCount = 0;
			string strColor2 = "";

			foreach (BEOrders.tbl_OrderDetailsRow item in dsOrder.tbl_OrderDetails.Rows)
			{
				rowCount += 1;	
				if (rowCount % 2 == 0)
				{
					strColor2 = "#efefef";
				}
				else
				{
					strColor2 = "#ffffff";
				}
				createOrder += "<tr style='page-break-inside:avoid'>";
				foreach (string col in columns)
				{
					if (item[col] != null && item[col].ToString() != "")
					{
						if(col == "BuyRentStatus")
							createOrder += "<td nowrap bgColor='" + strColor2 + "'>" + item[col].ToString() + "</td>";
						else
							createOrder += "<td bgColor='" + strColor2 + "'>" + item[col].ToString() + "</td>";
					}
					else
					{
						createOrder += "<td bgColor='" + strColor2 + "'>&nbsp;</td>";
					}
				}
				createOrder += "<td class='lastcell'>&nbsp;&nbsp;</td></tr>";
			}	
			createOrder += "</table>";

			createOrder += "<br><div style='page-break-inside:avoid;'><hr><table cellpadding='0' cellspacing='0' border='0' align='center'>";
			createOrder += "<tr><td align='center'>";
			createOrder += "If you require further clarification please call Mazz Oilfield Services. Customer Service at (403) 720-6299.";

			createOrder += "<br/>";
			createOrder += " Thank you for using Mazz Oilfield Services Online!";
			createOrder += "</td></tr></table><hr></div>";
			
			createOrder += "<br><table class='shippingdept' style='width: 550px !important;' align='center'>";
			createOrder += "<tr><th colspan='2' class='heading'>ORDER ID: " + order.OrderID + " - Shipping Verification</th></tr>";
			createOrder += "<tr><th>Information Check List</th><th width='50%'>Shipper's Initial</td></th>";
			createOrder += "<tr bgColor='#efefef'><td><img src='" + activeIconPath + "'>  Check Box Connections</td><td>&nbsp;</td></tr>";
			createOrder += "<tr><td><img src='" + activeIconPath + "'>  Check Pin Connections</td><td>&nbsp;</td></tr>";
			createOrder += "<tr bgColor='#efefef'><td><img src='" + activeIconPath + "'>  Check Serial Numbers</td><td>&nbsp;</td></tr>";
			createOrder += "<tr><td><img src='" + activeIconPath + "'>  Gauge Float Bore</td><td>&nbsp;</td></tr>";
			createOrder += "<tr bgColor='#efefef'><td><img src='" + activeIconPath + "'>  Gauge UBHO Bore</td><td>&nbsp;</td></tr>";
			createOrder += "<tr><td><img src='" + activeIconPath + "'>  Check Protectors</td><td>&nbsp;</td></tr>";
			createOrder += "</table><br>";



			createOrder += "<br><table class='receiver' align='center'>";
			createOrder += "<tr><td align='left'>All Items Verified and Thread Protectors Installed:</td><td align='center'>____________________________________</td></tr>";
			createOrder += "<tr><td>&nbsp;</td><td align='center'>RECEIVER</td></tr>";
			createOrder += "</table></br>";


			createOrder += "</div><div class='bottom'></div>";
			createOrder += "</body></html>";

			string pdfFileName = "ConfirmOrderID_" + orderID + ".pdf";
			string fullPDFFilePath = pdfFilePath + pdfFileName;

			ConvertHTMLToPDF(createOrder, fullPDFFilePath);

			try
			{
				mm.Body = "Please review the attached PDF file for Order Confirmation";
			
				MailAttachment pdfAttachment = new MailAttachment(fullPDFFilePath);
				mm.Attachments.Add(pdfAttachment);

				mm.BodyFormat = MailFormat.Html;
			
				SmtpMail.Send(mm);

				if (File.Exists(fullPDFFilePath))
					File.Delete(fullPDFFilePath);
			}
			catch (Exception ex)
			{
				ex.ToString();
				//				Response.Redirect (strMWRequestBad);
				//response.write "There was a problem sending the email";
			}

		}
Example #2
0
		private void Page_Load(object sender, EventArgs e)
		{
			this.AuthenticatePage(new string[] {PermissionLevels.EditImages, PermissionLevels.AddImages, PermissionLevels.ViewImages});
			if (ImageID > 0)
			{
				if (this.OryxUser.RolePermission(PermissionLevels.EditImages) != 2)
				{
					btnSubmit.Visible = false;
					btnDelete.Visible = false;
				}
				else
				{
					btnSubmit.Visible = true;
					btnDelete.Visible = true;
				}
			}
			else
			{
				if (this.OryxUser.RolePermission(PermissionLevels.AddImages) != 2)
				{
					btnSubmit.Visible = false;
				}
			}

			if (IsNewSession)
			{
				AddToListIfAdmin();
				IsNewSession = false;
			}
			
			if (!Page.IsPostBack)
			{
				BindImageCategories();

				BPImages bp = new BPImages();
		
				if (ImageID != 0)
				{
					DSImages = bp.SelectByID(ImageID);
					Image = DSImages.tbl_Images.FindByImageID(ImageID);

					//ddlExtranetClients.SelectedValue = Image.ClientID.ToString();

					lblImageName.Text = Image.ImageName.ToString();
					txtAlias.Text = Image.ImageAlias;
					chkSingle.Checked = Image.ImageActive;
					txtDesc.Text = (Image.IsImageDescriptionNull())? string.Empty : Image.ImageDescription;
					if (ddlImageCategory.Items.FindByValue(Image.ImageCategoryID.ToString()) != null)
					{
						ddlImageCategory.SelectedValue = Image.ImageCategoryID.ToString();
					}
					
					lblTitle.Text = "Edit Image - " + Image.ImageAlias;
				}
				else 
				{
					btnDelete.Visible = false;
					lblTitle.Text = "Upload Image";
				}
			}
		}
Example #3
0
		private bool UpdateRecordWithExistingFile()
		{
			try 
			{
				BPImages bp = new BPImages();
				BEImages ds = bp.SelectByID(ImageID);

				BEImages.tbl_ImagesRow ImageRow = ds.tbl_Images.FindByImageID(ImageID);

				//ImageRow.SubCategoryID = Convert.ToInt32(ddlSubCategories.SelectedValue);
				ImageRow.ImageAlias = txtAlias.Text;
				ImageRow.ImageActive = chkSingle.Checked;
				ImageRow.ImageDescription = txtDesc.Text;
				//ImageRow.ClientID = Convert.ToInt32(ddlExtranetClients.SelectedValue);
				
				ImageRow.ImageCategoryID = Convert.ToInt32(ddlImageCategory.SelectedValue);
				
				bp.Update(ds);
				return true;
			}
			catch (Exception)
			{
				pnlError.Visible = true;
				lblError.Text = "Some of the data you have entered maybe invalid, please check all fields and try again.";
				return false;
			}
		}
Example #4
0
		//		private void ddlCategories_SelectedIndexChanged(object sender, System.EventArgs e)
		//		{
		//			BindSubCategories();
		//		}

		private void btnDelete_Click(object sender, EventArgs e)
		{
			BPImages bp = new BPImages();
			BEImages.tbl_ImagesRow Image;
			
			DSImages = bp.SelectByID(ImageID);
			Image = DSImages.tbl_Images.FindByImageID(ImageID);

			File.Delete(Server.MapPath(@System.Configuration.ConfigurationSettings.AppSettings["UploadsPath"] + Image.ImageName));

			Image.Delete();
			bp.Update(DSImages);

			//remove all instances of this image in Products
//			BPProducts bpProducts = new BPProducts();
//			bpProducts.RemoveImagesByImageID(ImageID);

			Response.Redirect("BrowseImages.aspx");
		}
Example #5
0
		public void CreateAndSendEmails(int orderID)
		{
			BPOrders bpOrder = new BPOrders();
			BPOrderDetails bpDetails = new BPOrderDetails();
			BEOrders dsOrder = bpOrder.SelectOrdersByID(orderID);
			dsOrder.Merge(bpDetails.SelectOrderDetailsWithInventoryByOrderID(orderID));
			BEOrders.tbl_OrdersRow order = (BEOrders.tbl_OrdersRow) dsOrder.tbl_Orders.Rows[0];

			BPCompanyEmails bp = new BPCompanyEmails();
			BPCompanies bpCompany = new BPCompanies();
			BPCompanyAliases bpAliases = new BPCompanyAliases();

			BECompanies ds = bp.SelectActiveCompanyEmailsByCompanyID(order.CompanyID);
			ds.Merge(bpCompany.SelectCompaniesByID(order.CompanyID));
			ds.Merge(bpAliases.SelectCompanyColumnsByCompanyID(order.CompanyID));

			BECompanies.tbl_CompanyAliasesRow aliases = (BECompanies.tbl_CompanyAliasesRow) ds.tbl_CompanyAliases.Rows[0];
			BECompanies.tbl_CompaniesRow company;
			bool hasHuntingInventoryAccess = false;
			string CompanyImage = "";

			if(ds.tbl_Companies.Count > 0)
			{
				company = (BECompanies.tbl_CompaniesRow) ds.tbl_Companies.Rows[0];

				if (!company.IsCompanyImageIDNull())
				{
					BPImages bpImages = new BPImages();
					BEImages DSImages = bpImages.SelectByID(company.CompanyImageID);
					string imageName = DSImages.tbl_Images.FindByImageID(company.CompanyImageID).ImageName;
					CompanyImage = "<img src='" + companyLogoPath + "l_" + imageName + "' />";
				}

				hasHuntingInventoryAccess = company.CompanyRentalInventory;
			}

			string createOrder = "";

			createOrder += "<table border='0' cellspacing='0' cellpadding='0'><tr>";
			createOrder += "<td><img src='" + huntingLogoPath + "' /></td>";
			createOrder += "<td style='text-align:right;'>" + CompanyImage + "</td>";
			createOrder += "</tr></table>";
			createOrder += "<br>";
			
			createOrder += "<table class='orderdetails'>";
			createOrder += "<tr><th colspan='4' class='heading'>Confirmation of " + _EmailType.ToUpper() + " ID: " + order.OrderID + "</th></tr><tr>";

			createOrder += "<th width='20%'>Date</th>";
			createOrder += "<td width='30%'>" + order.OrderDate.ToString("MMM d, yyyy h:mm tt") + "</td>";
			createOrder += "<th width='20%'>&nbsp;</th>";
			createOrder += "<td width='30%'>&nbsp;</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			if (_EmailType == "Order")
			{
				createOrder += "<th>Ordered By </th>";
			}
			else
			{
				createOrder += "<th>Transferred By </th>";
			}
			createOrder += "<td>" + order.OrderRequestedBy + "</td>";
			createOrder += "<th width='16%'>Rig </th>";
			createOrder += "<td width='34%'>" + order.OrderRigNumber + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			createOrder += "<th>Ship To </th>";
			createOrder += "<td>" + order.OrderShipTo + "</td>";
			createOrder += "<th>Job # </th>";
			createOrder += "<td>" + order.OrderJobNumber + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			createOrder += "<th>Via </th>";
			createOrder += "<td>" + order.OrderShipVIA + "</td>";
			createOrder += "<th>Lease </th>";
			createOrder += "<td>" + order.OrderLeaseNumber + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			createOrder += "<th>Date Required </th>";
			createOrder += "<td>" + order.OrderDateRequired.ToString("MMM d, yyyy") + "</td>";
			createOrder += "<th>Time Required</th>";
			createOrder += "<td>" + order.OrderTimeRequired + "</td>";
			createOrder += "</tr>";

			createOrder += "<tr>";
			createOrder += "<th>Comments</th>";
			createOrder += "<td colspan='3'>" + order.OrderComments + "</td>";
			createOrder += "</tr></table>";

			ArrayList columns = new ArrayList();
			createOrder += "<br><table class='itemdetails'><tr>";

			if(hasHuntingInventoryAccess)
			{
				createOrder += "<th width='40px' nowrap='true'>B/R</th>";
				columns.Add("BuyRentStatus");
			}

			createOrder += "<th>" + aliases.ItemNumber + "</th>";
			columns.Add("ItemNumber");
			createOrder += "<th>" + aliases.Description +  "</th>";
			columns.Add("Description");
			createOrder += "<th>" + aliases.Box +  "</th>";
			columns.Add("Box");
			createOrder += "<th>" + aliases.Pin + "</th>";
			columns.Add("Pin");
			createOrder += "<th>" + aliases.MajorOD + "</th>";
			columns.Add("MajorOD");
			createOrder += "<th>" + aliases.MinorOD + "</th>";
			columns.Add("MinorOD");
			createOrder += "<th>" + aliases.InsideDiameter + "</th>";
			columns.Add("InsideDiameter");
			createOrder += "<th>" + aliases.SealtoSealLength + "</th>";
			columns.Add("SealtoSealLength");
			createOrder += "<th>" + aliases.FloatBore + "</th>";
			columns.Add("FloatBore");
			createOrder += "<th>" + aliases.Box2 + "</th>";
			columns.Add("Box2");
			createOrder += "<th>" + aliases.GeneralComments + "</th>";
			columns.Add("GeneralComments");

			if (!aliases.IsExtraColumn1Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn1 + "</th>";
				columns.Add("ExtraColumn1");
			}
			if (!aliases.IsExtraColumn2Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn2 + "</th>";
				columns.Add("ExtraColumn2");
			}
			if (!aliases.IsExtraColumn3Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn3 + "</th>";
				columns.Add("ExtraColumn3");
			}
			if (!aliases.IsExtraColumn4Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn4 + "</th>";
				columns.Add("ExtraColumn4");
			}
			if (!aliases.IsExtraColumn5Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn5 + "</th>";
				columns.Add("ExtraColumn5");
			}
			if (!aliases.IsExtraColumn6Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn6 + "</th>";
				columns.Add("ExtraColumn6");
			}
			if (!aliases.IsExtraColumn7Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn7 + "</th>";
				columns.Add("ExtraColumn7");
			}
			if (!aliases.IsExtraColumn8Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn8 + "</th>";
				columns.Add("ExtraColumn8");
			}
			if (!aliases.IsExtraColumn9Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn9 + "</th>";
				columns.Add("ExtraColumn9");
			}
			if (!aliases.IsExtraColumn10Null())
			{
				createOrder += "<th>" + aliases.ExtraColumn10 + "</th>";
				columns.Add("ExtraColumn10");
			}
			createOrder += "</tr>";
			int rowCount = 0;
			string strColor2 = "";
			foreach (BEOrders.tbl_OrderDetailsRow item in dsOrder.tbl_OrderDetails.Rows)
			{
				rowCount += 1;	
				if (rowCount % 2 == 0)
				{
					strColor2 = "#efefef";
				}
				else
				{
					strColor2 = "#ffffff";
				}
				createOrder += "<tr class='tablerows' bgColor='" + strColor2 + "'>";
				foreach (string col in columns)
				{
					if (item[col] != null && item[col].ToString() != "")
					{
						createOrder += "<td>" + item[col].ToString() + "</td>";
					}
					else
					{
						createOrder += "<td>&nbsp;</td>";
					}
				}
				createOrder += "</tr>";
			}	
			createOrder += "</table>";


			createOrder += "<table cellpadding='0' cellspacing='0' border='0' align='center'>";
			createOrder += "<tr><td align='center'>_________________________________________________</td></tr>";
			createOrder += "<tr><td align='center'>";
			createOrder += "If you require further clarification please call <br/>";
			createOrder += "Mazz Oilfield Services. Customer Service at:<br>";
			createOrder += "(403) 720-6299";
			createOrder += "<br/><br/>";
			createOrder += " Thank you for using Mazz Oilfield Services Online.";
			createOrder += "</td></tr></table>";

			createOrder += "</div><div class='bottom'></div>";

			Response.Write(createOrder);
		}