Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label firstLabel = (Label)Master.FindControl("lblUpdate");
            if (firstLabel != null)
            {
                firstLabel.Text = "VIEWING";
            }

            Label secondLabel = (Label)Master.FindControl("lblPartNumTitle");
            if (secondLabel != null)
            {
                secondLabel.Text = Session["partNumber"].ToString();
            }

            if (Session["updateSelected"] != null)
            {
                btnInsert.CssClass = "removeElement";
            }

            if (Session["user_type"].ToString() != "S")
            {
                btnUpdate.Visible = false;
                btnInsert.Visible = false;
            }

            //prevent backdoor
            if (Session["tableName"] == null)
            {
                Response.Redirect("ProductSelect.aspx");
            }
            else
            {
                //load dropdowns
                if (!Page.IsPostBack)
                {
                    Session.Add("UpdatePartList", "true");
                    //set up a dataview object to hold table names for the first drop down
                    System.Data.DataView tableList = new System.Data.DataView();

                    //select table names
                    datSelectDataSource.SelectCommand = "SELECT name FROM sys.tables WHERE name != 'tblColor' AND name != 'tblSchematicParts' AND name != 'tblParts' "
                                                        + " AND name != 'tblLengthUnits'  AND name != 'tblAudits' AND name != 'tblSalesOrders' AND name != 'tblSalesOrderItems' "
                                                        + " AND SUBSTRING(name,1,3) = 'tbl' "
                                                        + "ORDER BY name ASC";                    //assign the table names to the dataview object
                    tableList = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

                    //variable to determine amount of rows in the dataview object
                    int rowCount = tableList.Count;

                    ddlCategory.Items.Add("");
                    //populate first drop down
                    for (int i = 0; i < rowCount; i++)
                    {
                        string textString = tableList[i][0].ToString();
                        string newString = textString.Substring(3);
                        string outputString = "";
                        foreach (char character in newString)
                        {
                            if (char.IsUpper(character))
                            {
                                outputString += " " + character;
                            }
                            else if (character.ToString() == "1" || character.ToString() == "3" || character.ToString() == "4")
                            {
                                outputString += " " + character;
                            }
                            else
                            {
                                outputString += character;
                            }
                        }

                        ddlCategory.Items.Add(outputString.Trim());
                    }

                    //select category dropdown default value
                    ddlCategory.SelectedIndex = (int)Session["categoryIndex"];

                    //load part list
                    if (ddlCategory.SelectedValue != "")
                    {
                        //get table name selected
                        string tableName = "tbl" + ddlCategory.SelectedValue.Replace(" ", "");

                        //set up a dataview object to hold part numbers for the second drop down
                        System.Data.DataView partsList = new System.Data.DataView();

                        if (tableName != "tblSchematics")
                        {
                            //select part numbers
                            datSelectDataSource.SelectCommand = "SELECT partNumber, partName FROM " + tableName + " ORDER BY partNumber ASC";
                        }
                        else
                        {
                            datSelectDataSource.SelectCommand = "SELECT schematicNumber, partName FROM " + tableName + " ORDER BY schematicNumber ASC";
                        }
                        //assign the table names to the dataview object
                        partsList = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

                        //clear second drop down
                        ddlPart.Items.Clear();

                        //Insert empty string to first row of second drop down
                        ddlPart.Items.Add("");

                        rowCount = partsList.Count;
                        //populate second drop down
                        for (int i = 0; i < rowCount; i++)
                        {

                            ddlPart.Items.Add(partsList[i][0].ToString() + " (" + partsList[i][1].ToString() + ")");
                        }

                        Session.Add("displayChanged", "true");
                    }
                }

                //only run if the display has changed, to allow display postback changes
                if (Session["displayChanged"] != null)
                {
                    //we're running this, so the display has been updated, and is not set for change
                    Session.Remove("displayChanged");
                    //select part dropdown default value
                    ddlPart.SelectedIndex = (int)Session["partIndex"];

                    //show navigation arrows
                    imgPrevArrow.CssClass = "prevArrow";
                    imgNextArrow.CssClass = "nextArrow";

                    if (ddlPart.SelectedIndex == (ddlPart.Items.Count-1))
                    {
                        //if last item, don't show 'next' arrow
                        imgNextArrow.CssClass = "removeElement";
                    }
                    else if (ddlPart.SelectedIndex == 1)
                    {
                        //if first item, don't show 'prev' arrow
                        imgPrevArrow.CssClass = "removeElement";
                    }

                    //load appropriate image
                    imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                    imgPartLink.NavigateUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                    //remove all non-product panels, whichw ill be shown on switch case below
                    pnlAccessories.CssClass = "removeElement";
                    pnlDecorativeColumn.CssClass = "removeElement";
                    pnlDoorFrameExtrusions.CssClass = "removeElement";
                    pnlInsulatedFloors.CssClass = "removeElement";
                    pnlRoofExtrusions.CssClass = "removeElement";
                    pnlRoofPanels.CssClass = "removeElement";
                    pnlScreenRoll.CssClass = "removeElement";
                    pnlSuncrylicRoof.CssClass = "removeElement";
                    pnlSunrail1000.CssClass = "removeElement";
                    pnlSunrail300.CssClass = "removeElement";
                    pnlSunrail400.CssClass = "removeElement";
                    pnlVinylRoll.CssClass = "removeElement";
                    pnlWallExtrusions.CssClass = "removeElement";
                    pnlWallPanel.CssClass = "removeElement";
                    pnlSchematicsDisplay.CssClass = "removeElement";

                    //Uncomment for checks with login
                    /*
                    if (Session["loggedCountry"] == null)
                    {
                        pnlPriceDisplay.CssClass = "removeElement";
                    }
                    else if (Session["loggedCountry"] == "US")
                    {
                        rowCadPrice.CssClass = "removeElement";
                    }
                    else
                    {
                        rowUsdPrice.CssClass = "removeElement";
                    }
                    */

                    //if value was changed on display page, we

                    string tableName = Session["tableName"].ToString();

                    switch (tableName)
                    {
                        #region Accessories
                        case "tblAccessories":
                            {
                                pnlAccessories.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                lblPartName.Text = "Part Name:";
                                lblPartNum.Text = "Part Number:";

                                Accessories anAccessory = new Accessories();

                                //call select all function to populate object
                                anAccessory.Populate(anAccessory.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartNum.Text = anAccessory.AccessoryNumber;
                                txtPartName.Text = anAccessory.AccessoryName;
                                txtPartDesc.Text = anAccessory.AccessoryDescription;
                                txtColor.Text = anAccessory.AccessoryColor;
                                txtPackQuantity.Text = anAccessory.AccessoryPackQuantity.ToString();
                                txtAccessorySize.Text = anAccessory.AccessorySize.ToString() + " " + anAccessory.AccessorySizeUnits;
                                txtAccessoryWidth.Text = anAccessory.AccessoryWidth.ToString() + " " + anAccessory.AccessoryWidthUnits;
                                txtAccessoryLength.Text = anAccessory.AccessoryLength.ToString() + " " + anAccessory.AccessoryLengthUnits;

                                if (txtPackQuantity.Text == "0" || txtPackQuantity.Text == "")
                                {
                                    rowPackQuantity.CssClass = "removeElement";
                                }

                                if (anAccessory.AccessorySize == 0)//a space is added above, so check for one space, not blank
                                {
                                    rowAccessorySize.CssClass = "removeElement";
                                }

                                if (anAccessory.AccessoryLength == 0)
                                {
                                    rowAccessoryMaxLength.CssClass = "removeElement";
                                }

                                if (anAccessory.AccessoryWidth == 0)
                                {
                                    rowAccessoryMaxWidth.CssClass = "removeElement";
                                }

                                if (txtColor.Text == "")
                                {
                                    rowColor.CssClass = "removeElement";
                                }

                                txtUsdPrice.Text = anAccessory.AccessoryUsdPrice.ToString("N2");
                                txtCadPrice.Text = anAccessory.AccessoryCadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                        #region DecorativeColumn
                        case "tblDecorativeColumn":
                            {
                                pnlDecorativeColumn.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";

                                DecorativeColumn aColumn = new DecorativeColumn();

                                //call select all function to populate object
                                aColumn.Populate(aColumn.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aColumn.ColumnName;
                                txtPartDesc.Text = aColumn.ColumnDescription;
                                txtPartNum.Text = aColumn.PartNumber;
                                txtColor.Text = aColumn.ColumnColor;
                                txtDecColLength.Text = aColumn.ColumnLength.ToString() + " " + aColumn.ColumnLengthUnits;

                                txtUsdPrice.Text = aColumn.ColumnUsdPrice.ToString("N2");
                                txtCadPrice.Text = aColumn.ColumnCadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                        #region Door Frame Extrusion
                        case "tblDoorFrameExtrusion":
                            {
                                pnlDoorFrameExtrusions.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";

                                DoorFrameExtrusion aFrameExtrusion = new DoorFrameExtrusion();

                                //call select all function to populate object
                                aFrameExtrusion.Populate(aFrameExtrusion.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aFrameExtrusion.DfeName;
                                if (aFrameExtrusion.DfeDescription != "")
                                {
                                    txtPartDesc.Text = aFrameExtrusion.DfeDescription;
                                }
                                else
                                {
                                    rowDescription.CssClass = "removeElement";
                                }
                                txtPartNum.Text = aFrameExtrusion.PartNumber;
                                txtColor.Text = aFrameExtrusion.DfeColor;
                                txtDoorFrExtMaxLength.Text = aFrameExtrusion.DfeMaxLength.ToString() + " " + aFrameExtrusion.DfeMaxLengthUnits;

                                txtUsdPrice.Text = aFrameExtrusion.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aFrameExtrusion.CadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                        #region InsulatedFloors
                        case "tblInsulatedFloors":
                            {
                                pnlInsulatedFloors.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";
                                rowColor.CssClass = "removeElement";

                                InsulatedFloors aFloor = new InsulatedFloors();

                                //call select all function to populate object
                                aFloor.Populate(aFloor.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aFloor.InsulatedFloorName;
                                txtPartDesc.Text = aFloor.InsulatedFloorDescription;
                                txtPartNum.Text = aFloor.PartNumber;
                                txtInsFloorSize.Text = aFloor.InsulatedFloorSize.ToString() + " " + aFloor.InsulatedFloorSizeUnits;
                                txtInsFloorMaxWidth.Text = aFloor.InsulatedFloorMaxWidth.ToString() + " " + aFloor.InsulatedFloorMaxWidthUnits;
                                txtInsFloorMaxLength.Text = aFloor.InsulatedFloorMaxLength.ToString();

                                txtUsdPrice.Text = aFloor.InsulatedFloorUsdPrice.ToString("N2");
                                txtCadPrice.Text = aFloor.InsulatedFloorCadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                        #region RoofPanels
                        case "tblRoofPanels":
                            {
                                pnlRoofPanels.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";

                                RoofPanels aRoofPanel = new RoofPanels();

                                //call select all function to populate object
                                aRoofPanel.Populate(aRoofPanel.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aRoofPanel.PanelName;
                                txtPartDesc.Text = aRoofPanel.PanelDescription;
                                txtPartNum.Text = aRoofPanel.PartNumber;
                                txtComposition.Text = aRoofPanel.PanelComposition;
                                txtStandard.Text = aRoofPanel.PanelStandard;

                                txtColor.Text = aRoofPanel.PanelColor;
                                txtRoofPnlSize.Text = aRoofPanel.PanelSize.ToString() + " " + aRoofPanel.PanelSizeUnits;
                                txtRoofPnlMaxWidth.Text = aRoofPanel.PanelMaxWidth.ToString() + " " + aRoofPanel.MaxWidthUnits;
                                txtRoofPnlMaxLength.Text = aRoofPanel.PanelMaxLength;

                                txtUsdPrice.Text = aRoofPanel.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aRoofPanel.CadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                        #region Schematics
                        case "tblSchematics":
                            {
                                pnlSchematicsDisplay.CssClass = "schematicsTableDisplay";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";
                                rowColor.CssClass = "removeElement";
                                lblLegend.Text = "Legend:";
                                Schematics aSchematic = new Schematics();
                                Part aPart = new Part();

                                //call select all function to populate object
                                aSchematic.Populate(aSchematic.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartNum.Text = aSchematic.SchematicNumber;

                                if (Session["UpdatePartList"].ToString() == "true" || !Page.IsPostBack)
                                {
                                    UpdatePartsList();
                                    Session.Remove("UpdatePartList");
                                }

                                if (Session["part"] != null)
                                {
                                    aPart = (Part)Session["part"];
                                    txtSchemPartKey.Text = aPart.PartKeyNumber.ToString();
                                    txtSchemPartName.Text = aPart.PartName;
                                    txtSchemPartNum.Text = aPart.PartNumber;
                                }
                                else
                                {
                                    txtSchemPartKey.Text = "";
                                    txtSchemPartName.Text = "";
                                    txtSchemPartNum.Text = "";
                                }

                                lblPartName.Text = "Schematic Name:";
                                txtPartName.Text = aSchematic.SchematicName.ToString();
                                txtPartDesc.Text = aSchematic.SchematicDescription.ToString();
                                lblPartNum.Text = "Schematic Number:";
                                txtPartNum.Text = aSchematic.SchematicNumber.ToString();

                                if (txtPartDesc.Text == "")
                                {
                                    txtPartDesc.Text = "No Description";
                                }

                                txtUsdPrice.Text = aSchematic.SchematicUsdPrice.ToString("N2");
                                txtCadPrice.Text = aSchematic.SchematicCadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                        #region Screen Roll
                        case "tblScreenRoll":
                            {
                                pnlScreenRoll.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowDescription.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";
                                rowColor.CssClass = "removeElement";

                                ScreenRoll aScreenRoll = new ScreenRoll();

                                //call select all function to populate object
                                aScreenRoll.Populate(aScreenRoll.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aScreenRoll.ScreenRollName;
                                txtPartNum.Text = aScreenRoll.PartNumber;
                                txtScreenRollWidth.Text = aScreenRoll.ScreenRollWidth + " " + aScreenRoll.ScreenRollWidthUnits;
                                txtScreenRollLength.Text = aScreenRoll.ScreenRollLength + " " + aScreenRoll.ScreenRollLengthUnits;

                                txtUsdPrice.Text = aScreenRoll.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aScreenRoll.CadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                        #region Suncrylic Roof
                        case "tblSuncrylicRoof":
                            {
                                pnlSuncrylicRoof.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";

                                SuncrylicRoof aSuncrylicRoof = new SuncrylicRoof();

                                //call select all function to populate object
                                aSuncrylicRoof.Populate(aSuncrylicRoof.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aSuncrylicRoof.SuncrylicName;
                                txtPartDesc.Text = aSuncrylicRoof.SuncrylicDescription;
                                txtPartNum.Text = aSuncrylicRoof.PartNumber;
                                txtColor.Text = aSuncrylicRoof.SuncrylicColor;
                                txtSunRoofMaxLength.Text = aSuncrylicRoof.SuncrylicMaxLength + " " + aSuncrylicRoof.SuncrylicLengthUnits;
                                txtSunRoofMaxWidthStr.Text = "Varies";

                                txtUsdPrice.Text = aSuncrylicRoof.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aSuncrylicRoof.CadPrice.ToString("N2");

                                break;
                            }
                        #endregion

                        #region Sunrail1000
                        case "tblSunrail1000":
                        {
                            pnlSunrail1000.CssClass = "dimensionsTableDisplay";
                            rowLegend.CssClass = "removeElement";
                            rowComposition.CssClass = "removeElement";
                            rowStandard.CssClass = "removeElement";
                            rowPackQuantity.CssClass = "removeElement";

                            Sunrail1000 aSunrail = new Sunrail1000();

                            //call select all function to populate object
                            aSunrail.Populate(aSunrail.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                            txtPartName.Text = aSunrail.Sunrail1000Name;
                            txtPartDesc.Text = aSunrail.Sunrail1000Description;
                            txtPartNum.Text = aSunrail.PartNumber;
                            txtColor.Text = aSunrail.Sunrail1000Color;
                            txtSun1000MaxLength.Text = aSunrail.Sunrail1000MaxLengthFeet.ToString() + " " + aSunrail.Sunrail1000MaxLengthFeetUnits + " "
                                + aSunrail.Sunrail1000MaxLengthInches.ToString() + " " + aSunrail.Sunrail1000MaxLengthInchesUnits;

                            txtUsdPrice.Text = aSunrail.Sunrail1000UsdPrice.ToString("N2");
                            txtCadPrice.Text = aSunrail.Sunrail1000CadPrice.ToString("N2");

                            break;
                        }
                        #endregion
                    #region Sunrail300
                        case "tblSunrail300":
                        {
                            pnlSunrail300.CssClass = "dimensionsTableDisplay";
                            rowLegend.CssClass = "removeElement";
                            rowComposition.CssClass = "removeElement";
                            rowStandard.CssClass = "removeElement";
                            rowPackQuantity.CssClass = "removeElement";

                            Sunrail300 aSunrail300 = new Sunrail300();

                            //call select all function to populate object
                            aSunrail300.Populate(aSunrail300.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                            txtPartName.Text = aSunrail300.Sunrail300Name;
                            txtPartDesc.Text = aSunrail300.Sunrail300Description;
                            txtPartNum.Text = aSunrail300.PartNumber;
                            txtColor.Text = aSunrail300.Sunrail300Color;
                            txtSun300MaxLength.Text = aSunrail300.Sunrail300MaxLengthFeet.ToString() + " " + aSunrail300.Sunrail300MaxLengthFeetUnits + " "
                                                        + aSunrail300.Sunrail300MaxLengthInches.ToString() + " " + aSunrail300.Sunrail300MaxLengthInchesUnits;

                            txtUsdPrice.Text = aSunrail300.Sunrail300UsdPrice.ToString("N2");
                            txtCadPrice.Text = aSunrail300.Sunrail300CadPrice.ToString("N2");

                            break;
                        }
                    #endregion
                    #region Sunrail300Accessories
                    case "tblSunrail300Accessories":
                        {
                            rowLegend.CssClass = "removeElement";
                            rowComposition.CssClass = "removeElement";
                            rowStandard.CssClass = "removeElement";
                            rowPackQuantity.CssClass = "removeElement";

                            Sunrail300Accessories aSunrail300Accessory = new Sunrail300Accessories();

                            //call select all function to populate object
                            aSunrail300Accessory.Populate(aSunrail300Accessory.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                            txtPartName.Text = aSunrail300Accessory.Sunrail300AccessoriesName;
                            txtPartDesc.Text = aSunrail300Accessory.Sunrail300AccessoriesDescription;
                            txtPartNum.Text = aSunrail300Accessory.PartNumber;
                            txtColor.Text = aSunrail300Accessory.Sunrail300AccessoriesColor;

                            txtUsdPrice.Text = aSunrail300Accessory.Sunrail300AccessoriesUsdPrice.ToString("N2");
                            txtCadPrice.Text = aSunrail300Accessory.Sunrail300AccessoriesCadPrice.ToString("N2");

                            break;
                        }
                    #endregion
                    #region Sunrail400
                    case "tblSunrail400":
                        {
                            pnlSunrail400.CssClass = "dimensionsTableDisplay";
                            rowLegend.CssClass = "removeElement";
                            rowComposition.CssClass = "removeElement";
                            rowStandard.CssClass = "removeElement";
                            rowPackQuantity.CssClass = "removeElement";

                            Sunrail400 aSunrail400 = new Sunrail400();

                            //call select all function to populate object
                            aSunrail400.Populate(aSunrail400.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                            txtPartName.Text = aSunrail400.Sunrail400Name;
                            txtPartDesc.Text = aSunrail400.Sunrail400Description;
                            txtPartNum.Text = aSunrail400.PartNumber;
                            txtColor.Text = aSunrail400.Sunrail400Color;
                            txtSun400MaxLength.Text = aSunrail400.Sunrail400MaxLengthFeet.ToString() + " " + aSunrail400.Sunrail400MaxLengthFeetUnits + " "
                                                        + aSunrail400.Sunrail400MaxLengthInches.ToString() + " " + aSunrail400.Sunrail400MaxLengthInchesUnits;

                            txtUsdPrice.Text = aSunrail400.Sunrail400UsdPrice.ToString("N2");
                            txtCadPrice.Text = aSunrail400.Sunrail400CadPrice.ToString("N2");

                            break;
                        }
                    #endregion
                    #region VinylRoll
                    case "tblVinylRoll":
                            {
                                pnlVinylRoll.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowDescription.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";

                                rowVinylRollLength.CssClass = "removeElement";

                                VinylRoll aVinylRoll = new VinylRoll();

                                //call select all function to populate object
                                aVinylRoll.Populate(aVinylRoll.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aVinylRoll.VinylRollName;
                                txtPartNum.Text = aVinylRoll.PartNumber;
                                txtColor.Text = aVinylRoll.VinylRollColor;
                                txtVinylRollWeight.Text = aVinylRoll.VinylRollWeight.ToString() + " " + aVinylRoll.VinylRollWeightUnits;
                                txtVinylRollWidth.Text = aVinylRoll.VinylRollWidth.ToString() + " " + aVinylRoll.VinylRollWidthUnits;

                                txtUsdPrice.Text = aVinylRoll.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aVinylRoll.CadPrice.ToString("N2");

                                break;
                            }
                    #endregion
                    #region WallExtrusions
                    case "tblWallExtrusions":
                            {
                                pnlWallExtrusions.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";

                                WallExtrusions aWallExtrusion = new WallExtrusions();

                                //call select all function to populate object
                                aWallExtrusion.Populate(aWallExtrusion.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aWallExtrusion.WallExtrusionName;
                                txtPartDesc.Text = aWallExtrusion.WallExtrusionDescription;
                                txtPartNum.Text = aWallExtrusion.PartNumber;
                                txtColor.Text = aWallExtrusion.WallExtrusionColor;
                                txtWallExtMaxLength.Text = aWallExtrusion.WallExtrusionMaxLength.ToString() + " " + aWallExtrusion.LengthUnits;

                                txtUsdPrice.Text = aWallExtrusion.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aWallExtrusion.CadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                    #region WallPanels
                        case "tblWallPanels":
                            {
                                pnlWallPanel.CssClass = "dimensionsTableDisplay";
                                rowLegend.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";

                                WallPanels aWallPanel = new WallPanels();

                                //call select all function to populate object
                                aWallPanel.Populate(aWallPanel.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartName.Text = aWallPanel.WallPanelName;
                                txtPartDesc.Text = aWallPanel.WallPanelDescription;
                                txtComposition.Text = aWallPanel.WallPanelComposition;
                                txtStandard.Text = aWallPanel.WallPanelStandard;
                                txtPartNum.Text = aWallPanel.WallPanelNumber;
                                txtColor.Text = aWallPanel.WallPanelColor;
                                txtWallPnlSize.Text = aWallPanel.WallPanelSize.ToString() + " " + aWallPanel.SizeUnits;
                                txtWallPnlMaxWidth.Text = aWallPanel.WallPanelMaxWidth.ToString() + " " + aWallPanel.WidthUnits;
                                txtWallPnlMaxLength.Text = aWallPanel.WallPanelMaxLength.ToString() + " " + aWallPanel.LengthUnits;

                                txtUsdPrice.Text = aWallPanel.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aWallPanel.CadPrice.ToString("N2");

                                break;
                            }
                        #endregion
                    #region RoofExtrusions
                        case "tblRoofExtrusions":
                            {
                                rowLegend.CssClass = "removeElement";
                                rowComposition.CssClass = "removeElement";
                                rowStandard.CssClass = "removeElement";
                                rowPackQuantity.CssClass = "removeElement";
                                pnlRoofExtrusions.CssClass = "dimensionsTableDisplay";

                                RoofExtrusion aRoofExtrusion = new RoofExtrusion();

                                //call select all function to populate object
                                aRoofExtrusion.Populate(aRoofExtrusion.SelectAll(datDisplayDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString()));

                                txtPartNum.Text = aRoofExtrusion.ExtrusionNumber;
                                txtPartName.Text = aRoofExtrusion.ExtrusionName;
                                txtPartDesc.Text = aRoofExtrusion.ExtrusionDescription;
                                txtColor.Text = aRoofExtrusion.ExtrusionColor;
                                txtRoofExtSize.Text = aRoofExtrusion.ExtrusionSize.ToString() + " " + aRoofExtrusion.SizeUnits;

                                if (aRoofExtrusion.AngleA != 0)
                                {
                                    txtRoofExtAngleA.Text = aRoofExtrusion.AngleA.ToString() + " " + aRoofExtrusion.AngleAUnits;
                                }
                                else
                                {
                                    rowRoofExtAngleA.CssClass = "removeElement";
                                }

                                if (aRoofExtrusion.AngleB != 0)
                                {
                                    txtRoofExtAngleB.Text = aRoofExtrusion.AngleB.ToString() + " " + aRoofExtrusion.AngleBUnits;
                                }
                                else
                                {
                                    rowRoofExtAngleB.CssClass = "removeElement";
                                }

                                if (aRoofExtrusion.AngleC != 0)
                                {
                                    txtRoofExtAngleC.Text = aRoofExtrusion.AngleC.ToString() + " " + aRoofExtrusion.AngleCUnits;
                                }
                                else
                                {
                                    rowRoofExtAngleC.CssClass = "removeElement";
                                }

                                txtRoofExtMaxLength.Text = aRoofExtrusion.ExtrusionMaxLength.ToString() + " " + aRoofExtrusion.MaxLengthUnits;

                                txtUsdPrice.Text = aRoofExtrusion.UsdPrice.ToString("N2");
                                txtCadPrice.Text = aRoofExtrusion.CadPrice.ToString("N2");

                                break;
                            }
                        #endregion

                    }
                }
            }
            /*
            if (Session["picChanged"] != null)
            {
                imgPart.ImageUrl = "Images/catalogue/temp.jpg";
                Session.Remove("picChanged");
            }
             */
        }
Example #2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                //get selected table from the session
                string tableName = Session["tableName"].ToString();

                if (Session["pricingOnly"] != null)
                {
                    Page.Validate("pricing");

                    if(Page.IsValid)
                    {
                        switch (tableName)
                        {
                            #region Roof Extrusions
                            //when roof extrusion is selected
                            case "tblRoofExtrusions":
                                {
                                    //create new object
                                    RoofExtrusion aRoofExtrusion = (RoofExtrusion)Session["roofExtrusion"];

                                    if (aRoofExtrusion.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aRoofExtrusion.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aRoofExtrusion.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aRoofExtrusion.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aRoofExtrusion.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aRoofExtrusion);

                                    break;
                                }
                            #endregion
                            #region Accessories
                            case "tblAccessories":
                                {
                                    //create new object
                                    Accessories anAccessory = (Accessories)Session["accessories"];

                                    if (anAccessory.AccessoryCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        anAccessory.AccessoryCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (anAccessory.AccessoryUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        anAccessory.AccessoryUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    anAccessory.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", anAccessory);

                                    break;
                                }
                            #endregion

                            #region Decorative Column
                            case "tblDecorativeColumn":
                                {

                                    //create new object
                                    DecorativeColumn aColumn = (DecorativeColumn)Session["decorativeColumn"];

                                    if (aColumn.ColumnCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aColumn.ColumnCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aColumn.ColumnUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aColumn.ColumnUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aColumn.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aColumn);

                                    break;
                                }
                            #endregion

                            #region Door Frame Extrusion
                            case "tblDoorFrameExtrusion":
                                {
                                    //create new object
                                    DoorFrameExtrusion aDoorExtrusion = (DoorFrameExtrusion)Session["doorFrameExtrusion"];

                                    if (aDoorExtrusion.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aDoorExtrusion.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aDoorExtrusion.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aDoorExtrusion.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aDoorExtrusion.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aDoorExtrusion);
                                    break;
                                }
                            #endregion

                            #region Insulated Floors
                            case "tblInsulatedFloors":
                                {
                                    //create new object
                                    InsulatedFloors anInsulatedFloor = (InsulatedFloors)Session["insulatedFloors"];

                                    if (anInsulatedFloor.InsulatedFloorCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        anInsulatedFloor.InsulatedFloorCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (anInsulatedFloor.InsulatedFloorUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        anInsulatedFloor.InsulatedFloorUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    anInsulatedFloor.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", anInsulatedFloor);
                                    break;
                                }
                            #endregion

                            #region Roof Panels
                            case "tblRoofPanels":
                                {
                                    //create new object
                                    RoofPanels aRoofPanel = (RoofPanels)Session["roofPanels"];

                                    if (aRoofPanel.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aRoofPanel.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aRoofPanel.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aRoofPanel.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aRoofPanel.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aRoofPanel);
                                    break;
                                }
                            #endregion

                            #region Screen Roll
                            case "tblScreenRoll":
                                {
                                    //create new object
                                    ScreenRoll aScreenRoll = (ScreenRoll)Session["screenRoll"];

                                    if (aScreenRoll.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aScreenRoll.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aScreenRoll.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aScreenRoll.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aScreenRoll.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aScreenRoll);
                                    break;
                                }
                            #endregion

                            #region VinylRoll
                            case "tblVinylRoll":
                                {
                                    //create new object
                                    VinylRoll aVinylRoll = (VinylRoll)Session["vinylRoll"];

                                    if (aVinylRoll.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aVinylRoll.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aVinylRoll.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aVinylRoll.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aVinylRoll.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aVinylRoll);
                                    break;
                                }
                            #endregion

                            #region Sunrail300
                            case "tblSunrail300":
                                {
                                    //create new object
                                    Sunrail300 aSunrail300 = (Sunrail300)Session["sunrail300"];

                                    if (aSunrail300.Sunrail300CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail300.Sunrail300CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail300.Sunrail300UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail300.Sunrail300UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aSunrail300.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail300);
                                    break;
                                }
                            #endregion
                            #region Sunrail300Accessories
                            case "tblSunrail300Accessories":
                                {
                                    //create new object
                                    Sunrail300Accessories aSunrail300Accessory = (Sunrail300Accessories)Session["sunrail300Accessories"];

                                    if (aSunrail300Accessory.Sunrail300AccessoriesCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail300Accessory.Sunrail300AccessoriesCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail300Accessory.Sunrail300AccessoriesUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail300Accessory.Sunrail300AccessoriesUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aSunrail300Accessory.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail300Accessory);
                                    break;
                                }
                            #endregion
                            #region Sunrail400
                            case "tblSunrail400":
                                {
                                    //create new object
                                    Sunrail400 aSunrail400 = (Sunrail400)Session["sunrail400"];

                                    if (aSunrail400.Sunrail400CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail400.Sunrail400CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail400.Sunrail400UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail400.Sunrail400UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aSunrail400.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail400);
                                    break;
                                }
                            #endregion
                            #region  Sunrail1000
                            case "tblSunrail1000":
                                {
                                    //create new object
                                    Sunrail1000 aSunrail1000 = (Sunrail1000)Session["sunrail1000"];

                                    if (aSunrail1000.Sunrail1000CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail1000.Sunrail1000CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail1000.Sunrail1000UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail1000.Sunrail1000UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aSunrail1000.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail1000);
                                    break;
                                }
                            #endregion
                            #region Wall Panels
                            case "tblWallPanels":
                                {
                                    //create new object
                                    WallPanels aWallPanel = (WallPanels)Session["wallPanels"];

                                    if (aWallPanel.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aWallPanel.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aWallPanel.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aWallPanel.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aWallPanel.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aWallPanel);
                                    break;
                                }
                            #endregion
                            #region Suncrylic Roof
                            case "tblSuncrylicRoof":
                                {
                                    //create new object
                                    SuncrylicRoof aSunRoof = (SuncrylicRoof)Session["suncrylicRoof"];

                                    if (aSunRoof.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunRoof.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunRoof.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunRoof.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aSunRoof.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunRoof);
                                    break;
                                }
                            #endregion
                            #region Wall Extrusions
                            case "tblWallExtrusions":
                                {
                                    //create new object
                                    WallExtrusions aWallExtrusion = (WallExtrusions)Session["wallExtrusions"];

                                    if (aWallExtrusion.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aWallExtrusion.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aWallExtrusion.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aWallExtrusion.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    //call update function
                                    aWallExtrusion.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aWallExtrusion);
                                    break;
                                }
                            #endregion
                            #region Schematics
                            case "tblSchematics":
                                {
                                    if (ddlSchem.SelectedValue != "")
                                    {
                                        Schematics aSchematic = (Schematics)Session["schematic"];
                                        Part aPart = new Part();

                                        if (Session["part"] != null)
                                        {
                                            aPart = (Part)Session["part"];
                                        }
                                        else
                                        {
                                            aPart.Populate(aPart.SelectAll(datUpdateDataSource, ddlSchem.SelectedValue, Session["partNumber"].ToString()));
                                            Session.Add("part", aPart);
                                        }

                                        //set member variables based on any changes made
                                        if (aSchematic.SchematicCadPrice != Convert.ToDecimal(txtCadPriceSchematic.Text))
                                        {
                                            aSchematic.SchematicCadPrice = Convert.ToDecimal(txtCadPriceSchematic.Text);
                                        }

                                        if (aSchematic.SchematicUsdPrice != Convert.ToDecimal(txtUsdPriceSchematic.Text))
                                        {
                                            aSchematic.SchematicUsdPrice = Convert.ToDecimal(txtUsdPriceSchematic.Text);
                                        }
                                        #region PartKeys
                                        if (aPart.PartKeyNumber == 1)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartOne.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartOne.Text);
                                            }

                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartOne.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartOne.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 2)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwo.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwo.Text);
                                            }

                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwo.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwo.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 3)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartThree.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartThree.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartThree.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartThree.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 4)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFour.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFour.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFour.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFour.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 5)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFive.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFive.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFive.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFive.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 6)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSix.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSix.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSix.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSix.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 7)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSeven.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSeven.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSeven.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSeven.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 8)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartEight.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartEight.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartEight.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartEight.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 9)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartNine.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartNine.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartNine.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartNine.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 10)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTen.Text);
                                            }
                                        }
                                        #region PartKey11
                                        else if (aPart.PartKeyNumber == 11)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartEleven.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartEleven.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartEleven.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartEleven.Text);
                                            }
                                        }
            #endregion
                                        #region PartKey12
                                        else if (aPart.PartKeyNumber == 12)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwelve.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwelve.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwelve.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwelve.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey13
                                        else if (aPart.PartKeyNumber == 13)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartThirteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartThirteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartThirteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartThirteen.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey14
                                        else if (aPart.PartKeyNumber == 14)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFourteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFourteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFourteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFourteen.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey15
                                        else if (aPart.PartKeyNumber == 15)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFifteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFifteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFifteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFifteen.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey16
                                        else if (aPart.PartKeyNumber == 16)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSixteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSixteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSixteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSixteen.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey17
                                        else if (aPart.PartKeyNumber == 17)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSeventeen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSeventeen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSeventeen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSeventeen.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey18
                                        else if (aPart.PartKeyNumber == 18)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartEighteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartEighteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartEighteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartEighteen.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey19
                                        else if (aPart.PartKeyNumber == 19)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartNineteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartNineteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartNineteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartNineteen.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey20
                                        else if (aPart.PartKeyNumber == 20)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwenty.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwenty.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwenty.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwenty.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey21
                                        else if (aPart.PartKeyNumber == 21)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwentyOne.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwentyOne.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwentyOne.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwentyOne.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey22
                                        else if (aPart.PartKeyNumber == 22)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwentyTwo.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwentyTwo.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwentyTwo.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwentyTwo.Text);
                                            }
                                        }
                                        #endregion
                                        #region PartKey23
                                        else if (aPart.PartKeyNumber == 23)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwentyThree.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwentyThree.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwentyThree.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwentyThree.Text);
                                            }
                                        }
                                        #endregion
                                        #endregion

                                        //call update function
                                        aSchematic.Update(datUpdateDataSource, Session["partNumber"].ToString());
                                        aPart.Update(datUpdateDataSource, aPart.PartNumber.ToString());

                                        //set session variable
                                        Session.Add("updatedObject", aSchematic);
                                        Session.Add("updatedPart", aPart);

                                    }
                                    break;
                                }
                            #endregion
                        }

                    }
                    if (Page.IsValid)
                    {
                        //remove 1 from current index to get previous product
                        Session["partIndex"] = (int)Session["partIndex"] + 1;
                        //find partnumber at previous product to update info on page
                        Session["partNumber"] = ddlPart.Items[(int)Session["partIndex"]].Value;
                        //let page know it has to update info
                        Session.Add("updateChanged", "true");
                        Response.Redirect("update.aspx"); //post
                    }
                }

                else
                #region Product Info And Pricing

                {
                    //select case statement for each possible object
                    switch (tableName)
                    {
                        //when roof extrusion is selected
                        case "tblRoofExtrusions":
                            {
                                //create new object
                                RoofExtrusion aRoofExtrusion = (RoofExtrusion)Session["roofExtrusion"];
                                Page.Validate("roofExtrusion");
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //set member variables based on any changes made
                                    if (aRoofExtrusion.ExtrusionDescription != txtPartDesc.Text)
                                    {
                                        aRoofExtrusion.ExtrusionDescription = txtPartDesc.Text;
                                    }

                                    if (aRoofExtrusion.ExtrusionSize != 0)
                                    {
                                        aRoofExtrusion.ExtrusionSize = Convert.ToInt32(txtRoofExtSize.Text);
                                    }

                                    if (aRoofExtrusion.AngleA != 0)
                                    {
                                        aRoofExtrusion.AngleA = Convert.ToInt32(txtRoofExtAngleA.Text);
                                    }

                                    if (aRoofExtrusion.AngleB != 0.0m)
                                    {
                                        aRoofExtrusion.AngleB = Convert.ToDecimal(txtRoofExtAngleB.Text);
                                    }

                                    if (aRoofExtrusion.AngleC != 0)
                                    {
                                        aRoofExtrusion.AngleC = Convert.ToInt32(txtRoofExtAngleC.Text);
                                    }

                                    if (aRoofExtrusion.ExtrusionMaxLength != Convert.ToInt32(txtRoofExtMaxLength.Text))
                                    {
                                        aRoofExtrusion.ExtrusionMaxLength = Convert.ToInt32(txtRoofExtMaxLength.Text);
                                    }
                                    if (aRoofExtrusion.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aRoofExtrusion.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aRoofExtrusion.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aRoofExtrusion.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aRoofExtrusion.Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aRoofExtrusion.Status = false;
                                    }

                                    //call update function
                                    aRoofExtrusion.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aRoofExtrusion);
                                }
                                break;
                            }

                        case "tblAccessories":
                            {
                                Page.Validate("accessories");
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    Accessories anAccessory = (Accessories)Session["accessories"];

                                    //set member variables based on any changes made
                                    if (anAccessory.AccessoryDescription != txtPartDesc.Text)
                                    {
                                        anAccessory.AccessoryDescription = txtPartDesc.Text;
                                    }

                                    if (anAccessory.AccessoryPackQuantity != 0)
                                    {
                                        anAccessory.AccessoryPackQuantity = Convert.ToInt32(txtPackQuantity.Text);
                                    }

                                    if (anAccessory.AccessoryWidth != 0)
                                    {
                                        anAccessory.AccessoryWidth = Convert.ToInt32(txtAccessoryWidth.Text);
                                    }

                                    if (anAccessory.AccessoryLength != 0)
                                    {
                                        anAccessory.AccessoryLength = Convert.ToInt32(txtAccessoryLength.Text);
                                    }

                                    if (anAccessory.AccessorySize != 0)
                                    {
                                        anAccessory.AccessorySize = Convert.ToInt32(txtAccessorySize.Text);
                                    }

                                    if (anAccessory.AccessoryCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        anAccessory.AccessoryCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (anAccessory.AccessoryUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        anAccessory.AccessoryUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        anAccessory.AccessoryStatus = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        anAccessory.AccessoryStatus = false;
                                    }

                                    //call update function
                                    anAccessory.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", anAccessory);
                                }

                                break;
                            }

                        case "tblDecorativeColumn":
                            {
                                Page.Validate("pricing");
                                Page.Validate("decorativeColumn");
                                if (Page.IsValid)
                                {
                                    //create new object
                                    DecorativeColumn aColumn = (DecorativeColumn)Session["decorativeColumn"];

                                    //set member variables based on any changes made
                                    if (aColumn.ColumnDescription != txtPartDesc.Text)
                                    {
                                        aColumn.ColumnDescription = txtPartDesc.Text;
                                    }

                                    if (aColumn.ColumnLength != 0)
                                    {
                                        aColumn.ColumnLength = Convert.ToInt32(txtRoofDecColLength.Text);
                                    }

                                    if (aColumn.ColumnCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aColumn.ColumnCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aColumn.ColumnUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aColumn.ColumnUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aColumn.ColumnStatus = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aColumn.ColumnStatus = false;
                                    }

                                    //call update function
                                    aColumn.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aColumn);
                                }
                                break;
                            }

                        case "tblWallExtrusions":
                            {
                                Page.Validate("wallExtrusions");
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    WallExtrusions aWallExtrusion = (WallExtrusions)Session["wallExtrusions"];

                                    //set member variables based on any changes made
                                    if (aWallExtrusion.WallExtrusionDescription != txtPartDesc.Text)
                                    {
                                        aWallExtrusion.WallExtrusionDescription = txtPartDesc.Text;
                                    }

                                    if (aWallExtrusion.WallExtrusionMaxLength != 0)
                                    {
                                        aWallExtrusion.WallExtrusionMaxLength = Convert.ToInt32(txtWallExtMaxLength.Text);
                                    }

                                    if (aWallExtrusion.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aWallExtrusion.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aWallExtrusion.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aWallExtrusion.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aWallExtrusion.Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aWallExtrusion.Status = false;
                                    }

                                    //call update function
                                    aWallExtrusion.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aWallExtrusion);
                                }

                                break;
                            }

                        case "tblWallPanels":
                            {
                                Page.Validate("wallPanels");
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    WallPanels aWallPanel = (WallPanels)Session["wallPanels"];

                                    //set member variables based on any changes made
                                    if (aWallPanel.WallPanelDescription != txtPartDesc.Text)
                                    {
                                        aWallPanel.WallPanelDescription = txtPartDesc.Text;
                                    }

                                    if (aWallPanel.WallPanelStandard != txtStandard.Text)
                                    {
                                        aWallPanel.WallPanelStandard = txtStandard.Text;
                                    }

                                    if (aWallPanel.WallPanelComposition != txtComposition.Text)
                                    {
                                        aWallPanel.WallPanelComposition = txtComposition.Text;
                                    }

                                    if (aWallPanel.WallPanelMaxWidth != Convert.ToInt32(txtWallPnlMaxWidth.Text))
                                    {
                                        aWallPanel.WallPanelMaxWidth = Convert.ToInt32(txtWallPnlMaxWidth.Text);
                                    }

                                    if (aWallPanel.WallPanelMaxLength != Convert.ToInt32(txtWallPnlMaxLength.Text))
                                    {
                                        aWallPanel.WallPanelMaxLength = Convert.ToInt32(txtWallPnlMaxLength.Text);
                                    }

                                    if (aWallPanel.WallPanelSize != Convert.ToInt32(txtWallPnlSize.Text))
                                    {
                                        aWallPanel.WallPanelSize = Convert.ToInt32(txtWallPnlSize.Text);
                                    }

                                    if (aWallPanel.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aWallPanel.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aWallPanel.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aWallPanel.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aWallPanel.Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aWallPanel.Status = false;
                                    }

                                    //call update function
                                    aWallPanel.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aWallPanel);
                                }

                                break;
                            }

                        case "tblDoorFrameExtrusion":
                            {
                                Page.Validate("pricing");
                                Page.Validate("doorFrameExtrusion");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    DoorFrameExtrusion aDoorExtrusion = (DoorFrameExtrusion)Session["doorFrameExtrusion"];

                                    //set member variables based on any changes made
                                    if (aDoorExtrusion.DfeDescription != txtPartDesc.Text)
                                    {
                                        aDoorExtrusion.DfeDescription = txtPartDesc.Text;
                                    }

                                    if (aDoorExtrusion.DfeMaxLength != Convert.ToInt32(txtDoorFrExtMaxLength.Text))
                                    {
                                        aDoorExtrusion.DfeMaxLength = Convert.ToInt32(txtDoorFrExtMaxLength.Text);
                                    }
                                    if (aDoorExtrusion.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aDoorExtrusion.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aDoorExtrusion.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aDoorExtrusion.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aDoorExtrusion.DfeStatus = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aDoorExtrusion.DfeStatus = false;
                                    }

                                    //call update function
                                    aDoorExtrusion.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aDoorExtrusion);
                                }
                                break;
                            }

                        case "tblInsulatedFloors":
                            {
                                Page.Validate("pricing");
                                Page.Validate("insulatedFloors");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    InsulatedFloors anInsulatedFloor = (InsulatedFloors)Session["insulatedFloors"];

                                    //set member variables based on any changes made
                                    if (anInsulatedFloor.InsulatedFloorDescription != txtPartDesc.Text)
                                    {
                                        anInsulatedFloor.InsulatedFloorDescription = txtPartDesc.Text;
                                    }

                                    if (anInsulatedFloor.InsulatedFloorComposition != txtComposition.Text)
                                    {
                                        anInsulatedFloor.InsulatedFloorComposition = txtComposition.Text;
                                    }

                                    if (anInsulatedFloor.InsulatedFloorSize != Convert.ToInt32(txtInsFloorSize.Text))
                                    {
                                        anInsulatedFloor.InsulatedFloorSize = Convert.ToInt32(txtInsFloorSize.Text);
                                    }

                                    if (anInsulatedFloor.InsulatedFloorMaxWidth != Convert.ToInt32(txtInsFloorPnlMaxWidth.Text))
                                    {
                                        anInsulatedFloor.InsulatedFloorMaxWidth = Convert.ToInt32(txtInsFloorPnlMaxWidth.Text);
                                    }

                                    if (anInsulatedFloor.InsulatedFloorCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        anInsulatedFloor.InsulatedFloorCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (anInsulatedFloor.InsulatedFloorUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        anInsulatedFloor.InsulatedFloorUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        anInsulatedFloor.InsulatedFloorStatus = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        anInsulatedFloor.InsulatedFloorStatus = false;
                                    }

                                    //call update function
                                    anInsulatedFloor.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", anInsulatedFloor);
                                }
                                break;
                            }

                        case "tblRoofPanels":
                            {
                                Page.Validate("pricing");
                                Page.Validate("roofPanels");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    RoofPanels aRoofPanel = (RoofPanels)Session["roofPanels"];

                                    //set member variables based on any changes made
                                    if (aRoofPanel.PanelDescription != txtPartDesc.Text)
                                    {
                                        aRoofPanel.PanelDescription = txtPartDesc.Text;
                                    }

                                    if (aRoofPanel.PanelComposition != txtComposition.Text)
                                    {
                                        aRoofPanel.PanelComposition = txtComposition.Text;
                                    }

                                    if (aRoofPanel.PanelStandard != txtStandard.Text)
                                    {
                                        aRoofPanel.PanelStandard = txtStandard.Text;
                                    }

                                    if (aRoofPanel.PanelSize != Convert.ToInt32(txtRoofPnlSize.Text))
                                    {
                                        aRoofPanel.PanelSize = Convert.ToInt32(txtRoofPnlSize.Text);
                                    }

                                    if (aRoofPanel.PanelMaxWidth != Convert.ToInt32(txtRoofPnlMaxWidth.Text))
                                    {
                                        aRoofPanel.PanelMaxWidth = Convert.ToInt32(txtRoofPnlMaxWidth.Text);
                                    }

                                    if (aRoofPanel.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aRoofPanel.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aRoofPanel.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aRoofPanel.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aRoofPanel.Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aRoofPanel.Status = false;
                                    }

                                    //call update function
                                    aRoofPanel.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aRoofPanel);
                                }
                                break;
                            }

                        case "tblScreenRoll":
                            {
                                Page.Validate("pricing");
                                Page.Validate("screenRoll");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    ScreenRoll aScreenRoll = (ScreenRoll)Session["screenRoll"];

                                    //set member variables based on any changes made

                                    if (aScreenRoll.ScreenRollWidth != Convert.ToInt32(txtScreenRollWidth.Text))
                                    {
                                        aScreenRoll.ScreenRollWidth = Convert.ToInt32(txtScreenRollWidth.Text);
                                    }

                                    if (aScreenRoll.ScreenRollLength != Convert.ToInt32(txtScreenRollLength.Text))
                                    {
                                        aScreenRoll.ScreenRollLength = Convert.ToInt32(txtScreenRollLength.Text);
                                    }

                                    if (aScreenRoll.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aScreenRoll.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aScreenRoll.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aScreenRoll.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aScreenRoll.Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aScreenRoll.Status = false;
                                    }

                                    //call update function
                                    aScreenRoll.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aScreenRoll);
                                }
                                break;
                            }

                        case "tblVinylRoll":
                            {
                                Page.Validate("pricing");
                                Page.Validate("vinylRoll");
                                if (Page.IsValid)
                                {
                                    //create new object
                                    VinylRoll aVinylRoll = (VinylRoll)Session["vinylRoll"];

                                    //set member variables based on any changes made

                                    if (aVinylRoll.VinylRollWidth != Convert.ToInt32(txtVinylRollWidth.Text))
                                    {
                                        aVinylRoll.VinylRollWidth = Convert.ToInt32(txtVinylRollWidth.Text);
                                    }

                                    if (aVinylRoll.VinylRollWeight != Convert.ToInt32(txtVinylRollWeight.Text))
                                    {
                                        aVinylRoll.VinylRollWeight = Convert.ToInt32(txtVinylRollWeight.Text);
                                    }

                                    if (aVinylRoll.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aVinylRoll.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aVinylRoll.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aVinylRoll.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aVinylRoll.Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aVinylRoll.Status = false;
                                    }

                                    //call update function
                                    aVinylRoll.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aVinylRoll);
                                }
                                break;
                            }

                        case "tblSunrail300":
                            {
                                Page.Validate("sunrail300");
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    Sunrail300 aSunrail300 = (Sunrail300)Session["sunrail300"];

                                    //set member variables based on any changes made
                                    if (aSunrail300.Sunrail300Description != txtPartDesc.Text)
                                    {
                                        aSunrail300.Sunrail300Description = txtPartDesc.Text;
                                    }

                                    if (aSunrail300.Sunrail300MaxLengthFeet != Convert.ToInt32(txtSun300MaxLengthFt.Text))
                                    {
                                        aSunrail300.Sunrail300MaxLengthFeet = Convert.ToInt32(txtSun300MaxLengthFt.Text);
                                    }

                                    if (aSunrail300.Sunrail300MaxLengthInches != Convert.ToInt32(txtSun300PnlMaxLengthInch.Text))
                                    {
                                        aSunrail300.Sunrail300MaxLengthInches = Convert.ToInt32(txtSun300PnlMaxLengthInch.Text);
                                    }

                                    if (aSunrail300.Sunrail300CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail300.Sunrail300CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail300.Sunrail300UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail300.Sunrail300UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aSunrail300.Sunrail300Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aSunrail300.Sunrail300Status = false;
                                    }

                                    //call update function
                                    aSunrail300.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail300);
                                }
                                break;
                            }
                        #region Sunrail300Accessories
                        case "tblSunrail300Accessories":
                            {
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    Sunrail300Accessories aSunrail300Accessory = (Sunrail300Accessories)Session["sunrail300Acc"];

                                    //set member variables based on any changes made
                                    if (aSunrail300Accessory.Sunrail300AccessoriesDescription != txtPartDesc.Text)
                                    {
                                        aSunrail300Accessory.Sunrail300AccessoriesDescription = txtPartDesc.Text;
                                    }

                                    if (aSunrail300Accessory.Sunrail300AccessoriesCadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail300Accessory.Sunrail300AccessoriesCadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail300Accessory.Sunrail300AccessoriesUsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail300Accessory.Sunrail300AccessoriesUsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aSunrail300Accessory.Sunrail300AccessoriesStatus = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aSunrail300Accessory.Sunrail300AccessoriesStatus = false;
                                    }

                                    //call update function
                                    aSunrail300Accessory.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail300Accessory);
                                }
                                break;
                            }
                        #endregion
                        #region Sunrail400
                        case "tblSunrail400":
                            {
                                Page.Validate("sunrail400");
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    Sunrail400 aSunrail400 = (Sunrail400)Session["sunrail400"];

                                    //set member variables based on any changes made
                                    if (aSunrail400.Sunrail400Description != txtPartDesc.Text)
                                    {
                                        aSunrail400.Sunrail400Description = txtPartDesc.Text;
                                    }

                                    if (aSunrail400.Sunrail400MaxLengthFeet != Convert.ToInt32(txtSun400MaxLengthFt.Text))
                                    {
                                        aSunrail400.Sunrail400MaxLengthFeet = Convert.ToInt32(txtSun400MaxLengthFt.Text);
                                    }

                                    if (aSunrail400.Sunrail400MaxLengthInches != Convert.ToInt32(txtSun400PnlMaxLengthInch.Text))
                                    {
                                        aSunrail400.Sunrail400MaxLengthInches = Convert.ToInt32(txtSun400PnlMaxLengthInch.Text);
                                    }

                                    if (aSunrail400.Sunrail400CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail400.Sunrail400CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail400.Sunrail400UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail400.Sunrail400UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aSunrail400.Sunrail400Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aSunrail400.Sunrail400Status = false;
                                    }

                                    //call update function
                                    aSunrail400.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail400);
                                }
                                break;
                            }
                        #endregion
                        #region Sunrail1000
                        case "tblSunrail1000":
                            {
                                Page.Validate("sunrail1000");
                                Page.Validate("pricing");

                                if (Page.IsValid)
                                {
                                    //create new object
                                    Sunrail1000 aSunrail1000 = (Sunrail1000)Session["sunrail1000"];

                                    //set member variables based on any changes made
                                    if (aSunrail1000.Sunrail1000Description != txtPartDesc.Text)
                                    {
                                        aSunrail1000.Sunrail1000Description = txtPartDesc.Text;
                                    }

                                    if (aSunrail1000.Sunrail1000MaxLengthFeet != Convert.ToInt32(txtSun1000MaxLengthFt.Text))
                                    {
                                        aSunrail1000.Sunrail1000MaxLengthFeet = Convert.ToInt32(txtSun1000MaxLengthFt.Text);
                                    }

                                    if (aSunrail1000.Sunrail1000MaxLengthInches != Convert.ToInt32(txtSun1000PnlMaxLengthInch.Text))
                                    {
                                        aSunrail1000.Sunrail1000MaxLengthInches = Convert.ToInt32(txtSun1000PnlMaxLengthInch.Text);
                                    }

                                    if (aSunrail1000.Sunrail1000CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunrail1000.Sunrail1000CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunrail1000.Sunrail1000UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunrail1000.Sunrail1000UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aSunrail1000.Sunrail1000Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aSunrail1000.Sunrail1000Status = false;
                                    }

                                    //call update function
                                    aSunrail1000.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunrail1000);
                                }
                                break;
                            }
                        #endregion

                        #region SuncrylicRoof
                        case "tblSuncrylicRoof":
                            {
                                Page.Validate("pricing");
                                Page.Validate("suncrylicRoof");
                                if (Page.IsValid)
                                {
                                    //create new object
                                    SuncrylicRoof aSunRoof = (SuncrylicRoof)Session["suncrylicRoof"];

                                    //set member variables based on any changes made
                                    if (aSunRoof.SuncrylicDescription != txtPartDesc.Text)
                                    {
                                        aSunRoof.SuncrylicDescription = txtPartDesc.Text;
                                    }

                                    if (aSunRoof.SuncrylicMaxLength != Convert.ToInt32(txtSun1000PnlMaxLengthInch.Text))
                                    {
                                        aSunRoof.SuncrylicMaxLength = Convert.ToInt32(txtSun1000PnlMaxLengthInch.Text);
                                    }

                                    if (aSunRoof.CadPrice != Convert.ToDecimal(txtCadPrice.Text))
                                    {
                                        aSunRoof.CadPrice = Convert.ToDecimal(txtCadPrice.Text);
                                    }

                                    if (aSunRoof.UsdPrice != Convert.ToDecimal(txtUsdPrice.Text))
                                    {
                                        aSunRoof.UsdPrice = Convert.ToDecimal(txtUsdPrice.Text);
                                    }

                                    if (radActive.Checked)
                                    {
                                        aSunRoof.Status = true;
                                    }
                                    else if (radInactive.Checked)
                                    {
                                        aSunRoof.Status = false;
                                    }

                                    //call update function
                                    aSunRoof.Update(datUpdateDataSource, Session["tableName"].ToString(), Session["partNumber"].ToString());

                                    //set session variable
                                    Session.Add("updatedObject", aSunRoof);
                                }
                                break;
                            }
                        #endregion
                        #region Schematics
                        case "tblSchematics":
                            {
                                Page.Validate("pricing");

                                if (ddlSchem.SelectedValue != "")
                                {
                                    Schematics aSchematic = (Schematics)Session["schematic"];
                                    Part aPart = new Part();

                                    if (Page.IsValid)
                                    {

                                        if (Session["part"] != null)
                                        {
                                            aPart = (Part)Session["part"];
                                        }
                                        else
                                        {
                                            aPart.Populate(aPart.SelectAll(datUpdateDataSource, ddlSchem.SelectedValue, Session["partNumber"].ToString()));
                                            Session.Add("part", aPart);
                                        }

                                        //set member variables based on any changes made
                                        if (aSchematic.SchematicDescription != txtPartDesc.Text)
                                        {
                                            aSchematic.SchematicDescription = txtPartDesc.Text;
                                        }

                                        if (aSchematic.SchematicCadPrice != Convert.ToDecimal(txtCadPriceSchematic.Text))
                                        {
                                            aSchematic.SchematicCadPrice = Convert.ToDecimal(txtCadPriceSchematic.Text);
                                        }

                                        if (aSchematic.SchematicUsdPrice != Convert.ToDecimal(txtUsdPriceSchematic.Text))
                                        {
                                            aSchematic.SchematicUsdPrice = Convert.ToDecimal(txtUsdPriceSchematic.Text);
                                        }

                                        if (radActive.Checked)
                                        {
                                            aSchematic.SchematicStatus = true;
                                        }
                                        else if (radInactive.Checked)
                                        {
                                            aSchematic.SchematicStatus = false;
                                        }

                                        if (aPart.PartKeyNumber == 1)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartOne.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartOne.Text);
                                            }

                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartOne.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartOne.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 2)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwo.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwo.Text);
                                            }

                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwo.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwo.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 3)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartThree.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartThree.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartThree.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartThree.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 4)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFour.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFour.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFour.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFour.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 5)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFive.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFive.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFive.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFive.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 6)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSix.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSix.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSix.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSix.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 7)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSeven.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSeven.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSeven.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSeven.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 8)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartEight.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartEight.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartEight.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartEight.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 9)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartNine.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartNine.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartNine.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartNine.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 10)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 11)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartEleven.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartEleven.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartEleven.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartEleven.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 12)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwelve.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwelve.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwelve.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwelve.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 13)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartThirteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartThirteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartThirteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartThirteen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 14)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFourteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFourteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFourteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFourteen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 15)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartFifteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartFifteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartFifteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartFifteen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 16)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSixteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSixteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSixteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSixteen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 17)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartSeventeen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartSeventeen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartSeventeen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartSeventeen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 18)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartEighteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartEighteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartEighteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartEighteen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 19)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartNineteen.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartNineteen.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartNineteen.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartNineteen.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 20)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwenty.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwenty.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwenty.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwenty.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 21)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwentyOne.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwentyOne.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwentyOne.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwentyOne.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 22)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwentyTwo.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwentyTwo.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwentyTwo.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwentyTwo.Text);
                                            }
                                        }

                                        else if (aPart.PartKeyNumber == 23)
                                        {
                                            if (aPart.PartUsdPrice != Convert.ToDecimal(txtUsdPricePartTwentyThree.Text))
                                            {
                                                aPart.PartUsdPrice = Convert.ToDecimal(txtUsdPricePartTwentyThree.Text);
                                            }
                                            if (aPart.PartCadPrice != Convert.ToDecimal(txtCadPricePartTwentyThree.Text))
                                            {
                                                aPart.PartCadPrice = Convert.ToDecimal(txtCadPricePartTwentyThree.Text);
                                            }
                                        }

                                        //call update function
                                        aSchematic.Update(datUpdateDataSource, Session["partNumber"].ToString());
                                        aPart.Update(datUpdateDataSource, aPart.PartNumber.ToString());

                                        //set session variable
                                        Session.Add("updatedObject", aSchematic);
                                        Session.Add("updatedPart", aPart);
                                    }
                        #endregion
                                }
                                break;
                            }
                #endregion

                    }
                }

                if (Page.IsValid)
                {
                    /*
                    List<string> keys = new List<string>();

                    // retrieve application Cache enumerator
                    System.Collections.IDictionaryEnumerator enumerator = Cache.GetEnumerator();

                    // copy all keys that currently exist in Cache
                    while (enumerator.MoveNext())
                    {
                        keys.Add(enumerator.Key.ToString());
                    }

                    // delete every key from cache
                    for (int i = 0; i < keys.Count; i++)
                    {
                        Cache.Remove(keys[i]);
                    }

                    System.IO.File.Copy(Server.MapPath("Images/catalogue/temp.jpg"), Server.MapPath("Images/catalogue/" + Session["partNumber"].ToString() + ".jpg"), true);
                    //redirect to Display.aspx
                     */
                    Session.Add("updateChanged", "true");
                    Response.Redirect("Display.aspx");
                }
            }
        }
Example #3
0
        protected void ddlSchem_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlSchem.SelectedValue != "")
            {
                if (Session["part"] != null)
                {
                    Session.Remove("part");
                }

                Part aPart = new Part();
                aPart.Populate(aPart.SelectAll(datDisplayDataSource, ddlSchem.SelectedValue, Session["partNumber"].ToString()));
                Session.Add("part", aPart);

                if (Session["ddlSchemSelected"] != null)
                {
                    Session.Remove("ddlSchemSelected");
                }

                Session.Add("ddlSchemSelected", ddlSchem.SelectedIndex);
                Response.Redirect("Display.aspx"); //post
            }
        }
Example #4
0
        protected void ddlSchem_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Page.IsPostBack && ddlSchem.SelectedValue == "")
            {
                Response.Redirect("Update.aspx");
            }
            else
            {
                #region Part Validation Group
                rfvUsdPricePartOne.ValidationGroup = "";
                rfvCadPricePartOne.ValidationGroup = "";
                cmpUsdPricePartOne.ValidationGroup = "";
                cmpCadPricePartOne.ValidationGroup = "";

                rfvUsdPricePartTwo.ValidationGroup = "";
                rfvCadPricePartTwo.ValidationGroup = "";
                cmpUsdPricePartTwo.ValidationGroup = "";
                cmpCadPricePartTwo.ValidationGroup = "";

                rfvUsdPricePartThree.ValidationGroup = "";
                rfvCadPricePartThree.ValidationGroup = "";
                cmpUsdPricePartThree.ValidationGroup = "";
                cmpCadPricePartThree.ValidationGroup = "";

                rfvUsdPricePartFour.ValidationGroup = "";
                rfvCadPricePartFour.ValidationGroup = "";
                cmpUsdPricePartFour.ValidationGroup = "";
                cmpCadPricePartFour.ValidationGroup = "";

                rfvUsdPricePartFive.ValidationGroup = "";
                rfvCadPricePartFive.ValidationGroup = "";
                cmpUsdPricePartFive.ValidationGroup = "";
                cmpCadPricePartFive.ValidationGroup = "";

                rfvUsdPricePartSix.ValidationGroup = "";
                rfvCadPricePartSix.ValidationGroup = "";
                cmpUsdPricePartSix.ValidationGroup = "";
                cmpCadPricePartSix.ValidationGroup = "";

                rfvUsdPricePartSeven.ValidationGroup = "";
                rfvCadPricePartSeven.ValidationGroup = "";
                cmpUsdPricePartSeven.ValidationGroup = "";
                cmpCadPricePartSeven.ValidationGroup = "";

                rfvUsdPricePartEight.ValidationGroup = "";
                rfvCadPricePartEight.ValidationGroup = "";
                cmpUsdPricePartEight.ValidationGroup = "";
                cmpCadPricePartEight.ValidationGroup = "";

                rfvUsdPricePartNine.ValidationGroup = "";
                rfvCadPricePartNine.ValidationGroup = "";
                cmpUsdPricePartNine.ValidationGroup = "";
                cmpCadPricePartNine.ValidationGroup = "";

                rfvUsdPricePartTen.ValidationGroup = "";
                rfvCadPricePartTen.ValidationGroup = "";
                cmpUsdPricePartTen.ValidationGroup = "";
                cmpCadPricePartTen.ValidationGroup = "";

                rfvUsdPricePartEleven.ValidationGroup = "";
                rfvCadPricePartEleven.ValidationGroup = "";
                cmpUsdPricePartEleven.ValidationGroup = "";
                cmpCadPricePartEleven.ValidationGroup = "";

                rfvUsdPricePartTwelve.ValidationGroup = "";
                rfvCadPricePartTwelve.ValidationGroup = "";
                cmpUsdPricePartTwelve.ValidationGroup = "";
                cmpCadPricePartTwelve.ValidationGroup = "";

                rfvUsdPricePartThirteen.ValidationGroup = "";
                rfvCadPricePartThirteen.ValidationGroup = "";
                cmpUsdPricePartThirteen.ValidationGroup = "";
                cmpCadPricePartThirteen.ValidationGroup = "";

                rfvUsdPricePartFourteen.ValidationGroup = "";
                rfvCadPricePartFourteen.ValidationGroup = "";
                cmpUsdPricePartFourteen.ValidationGroup = "";
                cmpCadPricePartFourteen.ValidationGroup = "";

                rfvUsdPricePartFifteen.ValidationGroup = "";
                rfvCadPricePartFifteen.ValidationGroup = "";
                cmpUsdPricePartFifteen.ValidationGroup = "";
                cmpCadPricePartFifteen.ValidationGroup = "";

                rfvUsdPricePartSixteen.ValidationGroup = "";
                rfvCadPricePartSixteen.ValidationGroup = "";
                cmpUsdPricePartSixteen.ValidationGroup = "";
                cmpCadPricePartSixteen.ValidationGroup = "";

                rfvUsdPricePartSeventeen.ValidationGroup = "";
                rfvCadPricePartSeventeen.ValidationGroup = "";
                cmpUsdPricePartSeventeen.ValidationGroup = "";
                cmpCadPricePartSeventeen.ValidationGroup = "";

                rfvUsdPricePartEighteen.ValidationGroup = "";
                rfvCadPricePartEighteen.ValidationGroup = "";
                cmpUsdPricePartEighteen.ValidationGroup = "";
                cmpCadPricePartEighteen.ValidationGroup = "";

                rfvUsdPricePartNineteen.ValidationGroup = "";
                rfvCadPricePartNineteen.ValidationGroup = "";
                cmpUsdPricePartNineteen.ValidationGroup = "";
                cmpCadPricePartNineteen.ValidationGroup = "";

                rfvUsdPricePartTwenty.ValidationGroup = "";
                rfvCadPricePartTwenty.ValidationGroup = "";
                cmpUsdPricePartTwenty.ValidationGroup = "";
                cmpCadPricePartTwenty.ValidationGroup = "";

                rfvUsdPricePartTwentyOne.ValidationGroup = "";
                rfvCadPricePartTwentyOne.ValidationGroup = "";
                cmpUsdPricePartTwentyOne.ValidationGroup = "";
                cmpCadPricePartTwentyOne.ValidationGroup = "";

                rfvUsdPricePartTwentyTwo.ValidationGroup = "";
                rfvCadPricePartTwentyTwo.ValidationGroup = "";
                cmpUsdPricePartTwentyTwo.ValidationGroup = "";
                cmpCadPricePartTwentyTwo.ValidationGroup = "";

                rfvUsdPricePartTwentyThree.ValidationGroup = "";
                rfvCadPricePartTwentyThree.ValidationGroup = "";
                cmpUsdPricePartTwentyThree.ValidationGroup = "";
                cmpCadPricePartTwentyThree.ValidationGroup = "";
                #endregion

                lblSchemPartNum.CssClass = "lblProduct";
                lblSchemPartKey.CssClass = "lblProduct";
                lblSchemPartKeyNum.CssClass = "lblProduct";
                lblSchemPartName.CssClass = "lblProduct";
                pnlPricingSchematics.CssClass = "pnlPricing";
                #region RemoveElements
                rowPart1.CssClass = "removeElement";
                rowPart1Val.CssClass = "removeElement";
                rowPart2.CssClass = "removeElement";
                rowPart2Val.CssClass = "removeElement";
                rowPart3.CssClass = "removeElement";
                rowPart3Val.CssClass = "removeElement";
                rowPart4.CssClass = "removeElement";
                rowPart4Val.CssClass = "removeElement";
                rowPart5.CssClass = "removeElement";
                rowPart5Val.CssClass = "removeElement";
                rowPart6.CssClass = "removeElement";
                rowPart6Val.CssClass = "removeElement";
                rowPart7.CssClass = "removeElement";
                rowPart7Val.CssClass = "removeElement";
                rowPart8.CssClass = "removeElement";
                rowPart8Val.CssClass = "removeElement";
                rowPart9.CssClass = "removeElement";
                rowPart9Val.CssClass = "removeElement";
                rowPart10.CssClass = "removeElement";
                rowPart10Val.CssClass = "removeElement";
                rowPart11.CssClass = "removeElement";
                rowPart11Val.CssClass = "removeElement";
                rowPart12.CssClass = "removeElement";
                rowPart12Val.CssClass = "removeElement";
                rowPart13.CssClass = "removeElement";
                rowPart13Val.CssClass = "removeElement";
                rowPart14.CssClass = "removeElement";
                rowPart14Val.CssClass = "removeElement";
                rowPart15.CssClass = "removeElement";
                rowPart15Val.CssClass = "removeElement";
                rowPart16.CssClass = "removeElement";
                rowPart16Val.CssClass = "removeElement";
                rowPart17.CssClass = "removeElement";
                rowPart17Val.CssClass = "removeElement";
                rowPart18.CssClass = "removeElement";
                rowPart18Val.CssClass = "removeElement";
                rowPart19.CssClass = "removeElement";
                rowPart19Val.CssClass = "removeElement";
                rowPart20.CssClass = "removeElement";
                rowPart20Val.CssClass = "removeElement";
                rowPart21.CssClass = "removeElement";
                rowPart21Val.CssClass = "removeElement";
                rowPart22.CssClass = "removeElement";
                rowPart22Val.CssClass = "removeElement";
                rowPart23.CssClass = "removeElement";
                rowPart23Val.CssClass = "removeElement";
                #endregion

                Part aPart = new Part();
                aPart.Populate(aPart.SelectAll(datUpdateDataSource, ddlSchem.SelectedValue, Session["partNumber"].ToString()));
                Session.Add("part", aPart);

                imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + "-" + aPart.PartNumber.ToString() + "-" + aPart.PartKeyNumber.ToString() + ".jpg";

                if (aPart.PartKeyNumber == 1)
                {
                    rowPart1.CssClass = "trPriceSchem";
                    rowPart1Val.CssClass = "trPriceSchem";
                    txtUsdPricePartOne.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartOne.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartOne.ValidationGroup = "pricing";
                    rfvCadPricePartOne.ValidationGroup = "pricing";
                    cmpUsdPricePartOne.ValidationGroup = "pricing";
                    cmpCadPricePartOne.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 2)
                {
                    rowPart2.CssClass = "trPriceSchem";
                    rowPart2Val.CssClass = "trPriceSchem";
                    txtUsdPricePartTwo.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartTwo.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartTwo.ValidationGroup = "pricing";
                    rfvCadPricePartTwo.ValidationGroup = "pricing";
                    cmpUsdPricePartTwo.ValidationGroup = "pricing";
                    cmpCadPricePartTwo.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 3)
                {
                    rowPart3.CssClass = "trPriceSchem";
                    rowPart3Val.CssClass = "trPriceSchem";
                    txtUsdPricePartThree.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartThree.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartThree.ValidationGroup = "pricing";
                    rfvCadPricePartThree.ValidationGroup = "pricing";
                    cmpUsdPricePartThree.ValidationGroup = "pricing";
                    cmpCadPricePartThree.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 4)
                {
                    rowPart4.CssClass = "trPriceSchem";
                    rowPart4Val.CssClass = "trPriceSchem";
                    txtUsdPricePartFour.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartFour.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartFour.ValidationGroup = "pricing";
                    rfvCadPricePartFour.ValidationGroup = "pricing";
                    cmpUsdPricePartFour.ValidationGroup = "pricing";
                    cmpCadPricePartFour.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 5)
                {
                    rowPart5.CssClass = "trPriceSchem";
                    rowPart5Val.CssClass = "trPriceSchem";
                    txtUsdPricePartFive.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartFive.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartFive.ValidationGroup = "pricing";
                    rfvCadPricePartFive.ValidationGroup = "pricing";
                    cmpUsdPricePartFive.ValidationGroup = "pricing";
                    cmpCadPricePartFive.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 6)
                {
                    rowPart6.CssClass = "trPriceSchem";
                    rowPart6Val.CssClass = "trPriceSchem";
                    txtUsdPricePartSix.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartSix.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartSix.ValidationGroup = "pricing";
                    rfvCadPricePartSix.ValidationGroup = "pricing";
                    cmpUsdPricePartSix.ValidationGroup = "pricing";
                    cmpCadPricePartSix.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 7)
                {
                    rowPart7.CssClass = "trPriceSchem";
                    rowPart7Val.CssClass = "trPriceSchem";
                    txtUsdPricePartSeven.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartSeven.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartSeven.ValidationGroup = "pricing";
                    rfvCadPricePartSeven.ValidationGroup = "pricing";
                    cmpUsdPricePartSeven.ValidationGroup = "pricing";
                    cmpCadPricePartSeven.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 8)
                {
                    rowPart8.CssClass = "trPriceSchem";
                    rowPart8Val.CssClass = "trPriceSchem";
                    txtUsdPricePartEight.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartEight.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartEight.ValidationGroup = "pricing";
                    rfvCadPricePartEight.ValidationGroup = "pricing";
                    cmpUsdPricePartEight.ValidationGroup = "pricing";
                    cmpCadPricePartEight.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 9)
                {
                    rowPart9.CssClass = "trPriceSchem";
                    rowPart9Val.CssClass = "trPriceSchem";
                    txtUsdPricePartNine.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartNine.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartNine.ValidationGroup = "pricing";
                    rfvCadPricePartNine.ValidationGroup = "pricing";
                    cmpUsdPricePartNine.ValidationGroup = "pricing";
                    cmpCadPricePartNine.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 10)
                {
                    rowPart10.CssClass = "trPriceSchem";
                    rowPart10Val.CssClass = "trPriceSchem";
                    txtUsdPricePartTen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartTen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartTen.ValidationGroup = "pricing";
                    rfvCadPricePartTen.ValidationGroup = "pricing";
                    cmpUsdPricePartTen.ValidationGroup = "pricing";
                    cmpCadPricePartTen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 11)
                {
                    rowPart11.CssClass = "trPriceSchem";
                    rowPart12Val.CssClass = "trPriceSchem";
                    txtUsdPricePartEleven.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartEleven.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartEleven.ValidationGroup = "pricing";
                    rfvCadPricePartEleven.ValidationGroup = "pricing";
                    cmpUsdPricePartEleven.ValidationGroup = "pricing";
                    cmpCadPricePartEleven.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 12)
                {
                    rowPart12.CssClass = "trPriceSchem";
                    rowPart12Val.CssClass = "trPriceSchem";
                    txtUsdPricePartTwelve.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartTwelve.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartTwelve.ValidationGroup = "pricing";
                    rfvCadPricePartTwelve.ValidationGroup = "pricing";
                    cmpUsdPricePartTwelve.ValidationGroup = "pricing";
                    cmpCadPricePartTwelve.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 13)
                {
                    rowPart13.CssClass = "trPriceSchem";
                    rowPart13Val.CssClass = "trPriceSchem";
                    txtUsdPricePartThirteen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartThirteen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartThirteen.ValidationGroup = "pricing";
                    rfvCadPricePartThirteen.ValidationGroup = "pricing";
                    cmpUsdPricePartThirteen.ValidationGroup = "pricing";
                    cmpCadPricePartThirteen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 14)
                {
                    rowPart14.CssClass = "trPriceSchem";
                    rowPart14Val.CssClass = "trPriceSchem";
                    txtUsdPricePartFourteen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartFourteen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartFourteen.ValidationGroup = "pricing";
                    rfvCadPricePartFourteen.ValidationGroup = "pricing";
                    cmpUsdPricePartFourteen.ValidationGroup = "pricing";
                    cmpCadPricePartFourteen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 15)
                {
                    rowPart15.CssClass = "trPriceSchem";
                    rowPart15Val.CssClass = "trPriceSchem";
                    txtUsdPricePartFifteen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartFifteen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartFifteen.ValidationGroup = "pricing";
                    rfvCadPricePartFifteen.ValidationGroup = "pricing";
                    cmpUsdPricePartFifteen.ValidationGroup = "pricing";
                    cmpCadPricePartFifteen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 16)
                {
                    rowPart16.CssClass = "trPriceSchem";
                    rowPart16Val.CssClass = "trPriceSchem";
                    txtUsdPricePartSixteen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartSixteen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartSixteen.ValidationGroup = "pricing";
                    rfvCadPricePartSixteen.ValidationGroup = "pricing";
                    cmpUsdPricePartSixteen.ValidationGroup = "pricing";
                    cmpCadPricePartSixteen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 17)
                {
                    rowPart17.CssClass = "trPriceSchem";
                    rowPart17Val.CssClass = "trPriceSchem";
                    txtUsdPricePartSeventeen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartSeventeen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartSeventeen.ValidationGroup = "pricing";
                    rfvCadPricePartSeventeen.ValidationGroup = "pricing";
                    cmpUsdPricePartSeventeen.ValidationGroup = "pricing";
                    cmpCadPricePartSeventeen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 18)
                {
                    rowPart18.CssClass = "trPriceSchem";
                    rowPart18Val.CssClass = "trPriceSchem";
                    txtUsdPricePartEighteen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartEighteen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartEighteen.ValidationGroup = "pricing";
                    rfvCadPricePartEighteen.ValidationGroup = "pricing";
                    cmpUsdPricePartEighteen.ValidationGroup = "pricing";
                    cmpCadPricePartEighteen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 19)
                {
                    rowPart19.CssClass = "trPriceSchem";
                    rowPart19Val.CssClass = "trPriceSchem";
                    txtUsdPricePartNineteen.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartNineteen.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartNineteen.ValidationGroup = "pricing";
                    rfvCadPricePartNineteen.ValidationGroup = "pricing";
                    cmpUsdPricePartNineteen.ValidationGroup = "pricing";
                    cmpCadPricePartNineteen.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 20)
                {
                    rowPart20.CssClass = "trPriceSchem";
                    rowPart20Val.CssClass = "trPriceSchem";
                    txtUsdPricePartTwenty.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartTwenty.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartTwenty.ValidationGroup = "pricing";
                    rfvCadPricePartTwenty.ValidationGroup = "pricing";
                    cmpUsdPricePartTwenty.ValidationGroup = "pricing";
                    cmpCadPricePartTwenty.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 21)
                {
                    rowPart21.CssClass = "trPriceSchem";
                    rowPart21Val.CssClass = "trPriceSchem";
                    txtUsdPricePartTwentyOne.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartTwentyOne.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartTwentyOne.ValidationGroup = "pricing";
                    rfvCadPricePartTwentyOne.ValidationGroup = "pricing";
                    cmpUsdPricePartTwentyOne.ValidationGroup = "pricing";
                    cmpCadPricePartTwentyOne.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 22)
                {
                    rowPart22.CssClass = "trPriceSchem";
                    rowPart22Val.CssClass = "trPriceSchem";
                    txtUsdPricePartTwentyTwo.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartTwentyTwo.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartTwentyTwo.ValidationGroup = "pricing";
                    rfvCadPricePartTwentyTwo.ValidationGroup = "pricing";
                    cmpUsdPricePartTwentyTwo.ValidationGroup = "pricing";
                    cmpCadPricePartTwentyTwo.ValidationGroup = "pricing";
                }
                else if (aPart.PartKeyNumber == 23)
                {
                    rowPart23.CssClass = "trPriceSchem";
                    rowPart23Val.CssClass = "trPriceSchem";
                    txtUsdPricePartTwentyThree.Text = aPart.PartUsdPrice.ToString("N2");
                    txtCadPricePartTwentyThree.Text = aPart.PartCadPrice.ToString("N2");
                    rfvUsdPricePartTwentyThree.ValidationGroup = "pricing";
                    rfvCadPricePartTwentyThree.ValidationGroup = "pricing";
                    cmpUsdPricePartTwentyThree.ValidationGroup = "pricing";
                    cmpCadPricePartTwentyThree.ValidationGroup = "pricing";
                }

                lblSchemPartNum.Text = aPart.PartNumber.ToString();
                lblSchemPartKeyNum.Text = aPart.PartKeyNumber.ToString();
                lblSchemPartName.Text = aPart.PartName.ToString();
            }
        }