Beispiel #1
0
        protected void dataSourceMain_Selected(object sender, ObjectDataSourceStatusEventArgs e)
        {
            System.Data.DataView view = e.ReturnValue as System.Data.DataView;
            if (view != null)
            {
                HashSet <string> parentIds      = new HashSet <string>();
                HashSet <string> deleteLimitIds = new HashSet <string>();
                foreach (System.Data.DataRow row in view.Table.Rows)
                {
                    string parentID = (string)row["ParentID"];
                    parentIds.Add(parentID);
                }

                this.containerPermissions = PC.Adapters.SCAclAdapter.Instance.LoadCurrentContainerAndPermissions(Util.CurrentUser.ID, parentIds);
                foreach (System.Data.DataRow row in view.Table.Rows)
                {
                    string parentID = (string)row["ParentID"];
                    if (this.IsDeleteEnabled(parentID))
                    {
                        deleteLimitIds.Add((string)row["ID"]);
                    }
                }

                this.deleteLimitList.Value = JSONSerializerExecute.Serialize(deleteLimitIds);
            }
        }
Beispiel #2
0
 protected void AddressBookDataGrid_Delete(System.Object sender, System.Web.UI.WebControls.DataGridCommandEventArgs args)
 {
     if (this._delete_items != null && this._delete_items.Count > 0)
     {
         System.Collections.Specialized.ListDictionary addressbook = anmar.SharpWebMail.UI.AddressBook.GetAddressbook(this.addressbookselect.Value, Application["sharpwebmail/send/addressbook"]);
         System.Data.DataTable data = GetDataSource(addressbook, false, Session["client"] as anmar.SharpWebMail.IEmailClient);
         if (data != null)
         {
             bool delete = false;
             System.Data.DataView view = data.DefaultView;
             foreach (System.String item in this._delete_items)
             {
                 view.RowFilter = System.String.Concat(data.Columns[1].ColumnName, "='", item, "'");
                 if (view.Count == 1)
                 {
                     view[0].Delete();
                     delete = true;
                 }
             }
             if (delete)
             {
                 anmar.SharpWebMail.UI.AddressBook.UpdateDataSource(data, addressbook, Session["client"] as anmar.SharpWebMail.IEmailClient);
             }
         }
     }
 }
Beispiel #3
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;

            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
                        + "(insulatedFloorID,partName,description,composition,partNumber,size,sizeUnits,maxWidth,widthUnits,maxLength,usdPrice,cadPrice,status)"
                        + "VALUES"
                        + "(" + (count + 1) + ",'" + InsulatedFloorName + "','" + InsulatedFloorDescription + "','" + InsulatedFloorComposition + "','" + PartNumber + "'," + InsulatedFloorSize + ",'"
                        + InsulatedFloorSizeUnits + "'," + InsulatedFloorMaxWidth + ",'" + InsulatedFloorMaxWidthUnits + "','" + InsulatedFloorMaxLength + "',"
                        + InsulatedFloorUsdPrice + "," + InsulatedFloorCadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #4
0
        /// <summary>
        /// Applies the current filter to the ObjectView.
        /// </summary>
        /// <param name="filteredView">The filter to apply.</param>
        /// <returns>True if the filter is not set or the ObjectView passes the filter; otherwise false.</returns>
        internal bool ApplyFilter(System.Data.DataView filteredView)
        {
            if (filteredView == null || filteredView.RowFilter.Length == 0)
            {
                _visible = true;
                return(_visible);
            }

            string filter = filteredView.RowFilter;

            filteredView.RowFilter = string.Empty;
            System.Data.DataRow row = filteredView.Table.Rows[0];

            for (int i = 0; i < this.Parent.ObjectProperties.Count; i++)
            {
                string propertyName = this.Parent.ObjectProperties[i].Name;
                object value        = this[propertyName];

                if (value == null)
                {
                    row[propertyName] = DBNull.Value;
                }
                else
                {
                    row[propertyName] = value;
                }
            }

            filteredView.RowFilter = filter;
            _visible = filteredView.Count > 0;

            return(_visible);
        }
        private void CopyToDataSet(System.Data.DataView dv)
        {
            int idx = 0;
            PatientVisitDataSet ds = new PatientVisitDataSet();

            string[] strColNames = new string[ds.V_PATIENT_VISIT.Columns.Count];
            foreach (System.Data.DataColumn col in ds.V_PATIENT_VISIT.Columns)
            {
                strColNames[idx++] = col.ColumnName;
            }

            IEnumerator viewEnumerator = dv.GetEnumerator();

            while (viewEnumerator.MoveNext())
            {
                System.Data.DataRowView drv = (System.Data.DataRowView)viewEnumerator.Current;
                PatientVisitDataSet.V_PATIENT_VISITRow dr = ds.V_PATIENT_VISIT.NewV_PATIENT_VISITRow();

                foreach (string strName in strColNames)
                {
                    dr[strName] = drv[strName];
                }

                ds.V_PATIENT_VISIT.AddV_PATIENT_VISITRow(dr);
            }

            _ds = ds;
        }
Beispiel #6
0
 private void cbxFieldCrosstab_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cbxFieldCrosstab.SelectedIndex > 0)
     {
         System.Data.DataView mydv = this.DashboardHelper.DataSet.Tables[0].DefaultView;
         List <object>        distinctCrosstabValues = new List <object>();
         for (int i = 0; i < mydv.Count; i++)
         {
             System.Data.DataRow dr = mydv[i].Row;
             object ob = dr[cbxFieldCrosstab.SelectedItem + ""];
             if (!distinctCrosstabValues.Contains(ob))
             {
                 distinctCrosstabValues.Add(ob);
             }
         }
         if (distinctCrosstabValues.Count == 2)
         {
             cbxFieldPairID.Visibility = Visibility.Visible;
             tblockPairID.Visibility   = Visibility.Visible;
         }
         else
         {
             cbxFieldPairID.SelectedIndex = 0;
             cbxFieldPairID.Visibility    = Visibility.Collapsed;
             tblockPairID.Visibility      = Visibility.Collapsed;
         }
     }
     else
     {
         cbxFieldPairID.SelectedIndex = 0;
         cbxFieldPairID.Visibility    = Visibility.Collapsed;
         tblockPairID.Visibility      = Visibility.Collapsed;
     }
 }
Beispiel #7
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;

            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
                        + "(rollID,partName,partNumber,width,widthUnits,length,lengthUnits,usdPrice,cadPrice,status)"
                        + "VALUES"
                        + "(" + (count + 1) + ",'" + ScreenRollName + "','" + PartNumber + "'," + ScreenRollWidth + ",'" + ScreenRollWidthUnits + "',"
                        + ScreenRollLength + ",'" + ScreenRollLengthUnits + "',"
                        + UsdPrice + "," + CadPrice + "," + 1 + ")";


            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #8
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;

            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
                        + "(extrusionID,partName,description,partNumber,size,sizeUnits,color,extrusionAngleA,angleAUnits,extrusionAngleB,angleBUnits,extrusionAngleC,angleCUnits,maxLength,lengthUnits,usdPrice,cadPrice,status)"
                        + "VALUES"
                        + "(" + (count + 1) + ",'" + ExtrusionName + "','" + ExtrusionDescription + "','" + ExtrusionNumber + "'," + ExtrusionSize + ",'"
                        + SizeUnits + "','" + ExtrusionColor + "'," + AngleA + ",'" + AngleAUnits + "'," + AngleB + ",'" + AngleBUnits + "'," + AngleC + ",'" + AngleCUnits + "'," + ExtrusionMaxLength + ",'" + MaxLengthUnits + "',"
                        + UsdPrice + "," + CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #9
0
 protected void DDAsignaturas_SelectedIndexChanged(object sender, EventArgs e)
 {
     System.Data.DataView dv = Session["dataview"] as System.Data.DataView;
     dv.RowFilter             = "codigoasig ='" + DDAsignaturas.Text.ToString() + "'";
     GVAsignaturas.DataSource = dv;
     GVAsignaturas.DataBind();
 }
        public IDictionary <string, string> Execute(IEnumerable <LinkedService> linkedServices,
                                                    IEnumerable <Dataset> datasets,
                                                    Activity activity,
                                                    IActivityLogger logger)
        {
            //Output#: Dataset Compatible Filter string
            //# of formulas must match # datasets
            //Single input expected
            var inDS  = Helper.DatasetHelper.GetInputDatatable(activity, linkedServices, datasets);
            var outDS = Helper.DatasetHelper.GetOutputDatasetShell(activity, linkedServices, datasets);

            foreach (var o in activity.Outputs)
            {
                System.Data.DataView dv = new System.Data.DataView(inDS);
                dv.RowFilter = ((DotNetActivity)(activity.TypeProperties)).ExtendedProperties.Single(ep => ep.Key == string.Format("DatasetCondition{0}", activity.Outputs.IndexOf(o))).Value;

                foreach (System.Data.DataRow r in dv.ToTable().Rows)
                {
                    outDS.Tables[activity.Outputs.IndexOf(o)].Rows.Add(r.ItemArray);
                }
            }

            Helper.DatasetHelper.WriteOutputDataset(activity, linkedServices, datasets, outDS);

            return(new Dictionary <string, string>());
        }
Beispiel #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /*if (!string.IsNullOrEmpty(Session["usuario"] as string))
             * {
             *  if (Session["tipo"].ToString() != "alumno")
             *  {
             *      Server.Transfer("../Profesor/Profesor.aspx", true);
             *  }
             * }
             * else
             * {
             *  Response.Redirect("../Inicio.aspx");
             * }*/

            if (!HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority).Contains("localhost"))
            {
                log.Visible = false;
            }

            dBManager.Conectar();
            if (!IsPostBack)
            {
                List <String> asignaturas = dBManager.getAsignaturasAlumno(Session["usuario"].ToString());
                DDAsignaturas.DataSource = asignaturas;
                DDAsignaturas.DataBind();
                System.Data.DataTable dt = dBManager.getTareasGenericas(Session["usuario"].ToString()).Tables[0];
                System.Data.DataView  dv = new System.Data.DataView(dt);
                dv.RowFilter             = "codigoasig ='" + DDAsignaturas.Text.ToString() + "'";
                Session["dataview"]      = dv;
                GVAsignaturas.DataSource = dv;
                GVAsignaturas.DataBind();
            }
        }
Beispiel #12
0
 /// <summary>
 /// ccfollowup allen
 /// </summary>
 /// <param name="srcDG"></param>
 /// <param name="refreshControlId"></param>
 /// <param name="destUrl"></param>
 /// <param name="querystring"></param>
 public virtual void DGDbClickTransfer_Popup_Refresh(DataGrid srcDG, string refreshControlId, string destUrl, string querystring)
 {
     System.Data.DataView dvw = srcDG.DataSource as System.Data.DataView;
     if (dvw != null)
     {
         foreach (DataGridItem dgItem in srcDG.Items)
         {
             if (dgItem.ItemType == ListItemType.Item || dgItem.ItemType == ListItemType.AlternatingItem)
             {
                 dgItem.Attributes.Add("title", CWXT.Enums.Constants.DGItemAlterText);
                 dgItem.Attributes.Add("ondblclick",
                                       string.Format("dgItemOnDbClick_Popup_Refresh('{2}?{0}={1}&{3}={4}&{6}', '{5}','{7}','{8}')",
                                                     CWXT.Enums.Constants.UrlReferrer,
                                                     this.Request.Url.AbsolutePath,
                                                     destUrl,
                                                     CWXT.Enums.Constants.PKID,
                                                     dvw[dgItem.ItemIndex]["PKID"],
                                                     refreshControlId,
                                                     querystring,
                                                     srcDG.UniqueID + this.Page.ID,
                                                     dvw[dgItem.ItemIndex]["PKID"]));
             }
         }
     }
 }
Beispiel #13
0
        public void drillDownButton_Click(Office.IRibbonControl ctrl)
        {
            string sheetName      = Globals.ThisAddIn.Application.ActiveSheet.Name;
            object reportInstance = RuntimeReports.FindReportByWorksheet(sheetName);

            if (reportInstance == null)
            {
                return;
            }
            if (!(reportInstance is BalanceSheetService))
            {
                return;
            }

            string cellAddr = ExcelUtils.GetRelativeAddress(ThisAddIn.ExcelApp.ActiveCell);
            BalanceSheetService bsService = (BalanceSheetService)reportInstance;

            string fsItem = bsService.FindFsItem(cellAddr); // 根据单元格地址查找报表项

            if (fsItem != null)
            {
                System.Data.DataTable tbItems = bsService.GetBsItemsDetail();
                System.Data.DataView  tbView  = new System.Data.DataView(tbItems);
                tbView.RowFilter = $"FSItem = '{fsItem}' ";
                System.Data.DataTable rv = tbView.ToTable();

                // Copy Template
                string fullPath = ExcelUtils.TemplatePath + "B000_Trial_Balance_v1.xltx";
                ExcelUtils.CopyTemplate(fullPath, "TB", ThisAddIn.ExcelApp.ActiveSheet);

                ExcelUtils.CopyFromDataTable(rv, ThisAddIn.ExcelApp.ActiveSheet, false);
            }
        }
        void bindDataGrid(System.Data.DataView source)
        {
            dgImport.AutoGenerateColumns = false;
            dgImport.Columns.Clear();
            dgImport.ItemsSource = source;

            // Create columns
            foreach (var col in source.Table.Columns)
            {
                DataGridTextColumn dgc = new DataGridTextColumn
                {
                    Header = col.ToString()
                };

                Binding b = new Binding()
                {
                    Mode = BindingMode.OneWay,
                    Path = new PropertyPath(string.Format("[{0}]", col.ToString()))
                };

                dgc.Binding = b;

                dgImport.Columns.Add(dgc);
            }
        }
Beispiel #15
0
 public static void DgridToExcelContext(object sender, RoutedEventArgs e)
 {
     try
     {
         using (Excelcontrol xl = new Excelcontrol())
         {
             DataGrid dg       = ((((sender as MenuItem).Parent) as ContextMenu).PlacementTarget as DataGrid);
             bool[]   visOrder = new bool[dg.Columns.Count];
             for (int i = 0; i <= dg.Columns.Count - 1; i++)
             {
                 if (dg.Columns[i].Visibility.Equals(Visibility.Visible))
                 {
                     visOrder[i] = true;
                 }
                 else
                 {
                     visOrder[i] = false;
                 }
             }
             System.Data.DataView dv = (System.Data.DataView)(((((sender as MenuItem).Parent) as ContextMenu).PlacementTarget as DataGrid).ItemsSource);
             xl.ExportToExcel(dv.ToTable(), visOrder);
         }
     }
     catch
     {
     }
 }
Beispiel #16
0
        public void CopyFrom(System.Data.DataView view)
        {
            foreach (System.Data.DataRowView drv in view)
            {
                int rowID = (int)drv["MATRIX_ROW_ID"];

                WfMatrixRow row = this[rowID];

                if (row == null)
                {
                    row = new WfMatrixRow(this._Matrix)
                    {
                        RowNumber    = rowID,
                        OperatorType = (WfMatrixOperatorType)drv["OPERATOR_TYPE"],
                        Operator     = drv["OPERATOR"].ToString(),
                    };
                    this.Add(row);
                }

                row.Cells.Add(new WfMatrixCell()
                {
                    Definition  = this._Matrix.Definition.Dimensions[drv["DIMENSION_KEY"].ToString()],
                    StringValue = drv["STRING_VALUE"].ToString()
                });
            }
        }
Beispiel #17
0
        /// <summary>
        /// Load or reloads all the table content. You can specify which records you want to be checked by default.
        /// In order to successfully call this method, you need to call first the Initialize method.
        /// </summary>
        /// <param name="ArrayOf_PK_Sup_GuidID">Primary keys of the records you want to be checked by default.</param>
        /// <param name="startRecord">The zero-based record number to start with.</param>
        /// <param name="maxRecords">The maximum number of records to retrieve.</param>
        public void RefreshData(WS_Supplier.WSGuid[] ArrayOf_PK_Sup_GuidID, int startRecord, int maxRecords)
        {
            System.Data.DataSet dataSet = null;
            dataSet = supplierWebService.GetAllDisplay_Suppliers_DataSet();

            this.BeginUpdate();
            this.bindingInProgress = true;

            this.DataSource    = dataSet.Tables["spS_tblSupplier_Display"].DefaultView;
            this.ValueMember   = "ID1";
            this.DisplayMember = "Display";

            this.bindingInProgress = false;

            System.Data.DataView dataView = dataSet.Tables["spS_tblSupplier_Display"].DefaultView;

            if (ArrayOf_PK_Sup_GuidID != null && ArrayOf_PK_Sup_GuidID.Length > 0)
            {
                this.SetRecordsCheckState(ArrayOf_PK_Sup_GuidID, System.Windows.Forms.CheckState.Checked);
            }
            else
            {
                base.OnSelectedIndexChanged(EventArgs.Empty);
            }
            this.EndUpdate();
        }
        private void FilterEditRow()
        {
            if (m_filterData == null)
            {
                foreach (Xceed.Grid.DataRow row in this.dropDownGrid.DataRows)
                {
                    row.ResetHeight();
                    //row.ResetReadOnly();
                }
            }
            else
            {
                System.Data.DataView editorData = m_filterData;

                Dictionary <string, bool> dict = new Dictionary <string, bool>();
                foreach (System.Data.DataRowView row in editorData)
                {
                    dict[row[this.ValueMember].ToString()] = true;
                }
                foreach (Xceed.Grid.DataRow row in this.dropDownGrid.DataRows)
                {
                    if (!dict.ContainsKey(row.Cells[this.ValueMember].Value.ToString()))
                    {
                        row.Height = 0;
                        //row.ReadOnly = true;
                    }
                    else
                    {
                        row.ResetHeight();
                        //row.ResetReadOnly();
                    }
                }
            }
        }
 /// <summary>
 /// This method is required for Windows Forms designer support.
 /// Do not change the method contents inside the source code editor. The Forms designer might
 /// not be able to load this method if it was changed manually.
 /// </summary>
 private void InitializeComponent()
 {
     System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     System.Windows.Forms.DataVisualization.Charting.Legend    legend1    = new System.Windows.Forms.DataVisualization.Charting.Legend();
     this.dataView1     = new System.Data.DataView();
     this.barChartPanel = new System.Windows.Forms.DataVisualization.Charting.Chart();
     ((System.ComponentModel.ISupportInitialize)(this.dataView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.barChartPanel)).BeginInit();
     this.SuspendLayout();
     //
     // barChartPanel
     //
     chartArea1.Name = "ChartAreaMain";
     this.barChartPanel.ChartAreas.Add(chartArea1);
     legend1.Name = "Legend1";
     this.barChartPanel.Legends.Add(legend1);
     this.barChartPanel.Location = new System.Drawing.Point(10, 10);
     this.barChartPanel.Name     = "barChartPanel";
     this.barChartPanel.Palette  = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.SeaGreen;
     this.barChartPanel.Size     = new System.Drawing.Size(250, 150);
     this.barChartPanel.TabIndex = 0;
     this.barChartPanel.Text     = "chart1";
     //
     // MacroscopeBarChart
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.barChartPanel);
     this.Name = "MacroscopeBarChart";
     this.Size = new System.Drawing.Size(300, 200);
     ((System.ComponentModel.ISupportInitialize)(this.dataView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.barChartPanel)).EndInit();
     this.ResumeLayout(false);
 }
Beispiel #20
0
        //void cacheDataInViewstate(System.Data.DataView dv)
        //{

        //    DateTime firstDay = FirstCalendarDay(this.VisibleDate);
        //    DateTime lastDay = EndDate(this.VisibleDate);

        //    System.Collections.Generic.Dictionary<DateTime, int> ctrlcount = new System.Collections.Generic.Dictionary<DateTime, int>();

        //    foreach (System.Data.DataRowView drv in dv)
        //    {
        //        DateTime rowdate = ((DateTime)drv[DayField]).Date;
        //        if (rowdate > firstDay && rowdate <= lastDay)
        //        {
        //            if (ctrlcount.ContainsKey(rowdate))
        //            {
        //                ctrlcount[rowdate] += 1;
        //            }
        //            else
        //            {
        //                ctrlcount[rowdate] = 1;
        //            }
        //        }
        //    }
        //    ViewState[ViewStateDataKey] = ctrlcount;
        //}

        void cacheDataInViewstate(System.Data.DataView dv)
        {
            DateTime firstDay = FirstCalendarDay(this.VisibleDate);
            DateTime lastDay  = EndDate(this.VisibleDate);

            System.Collections.Generic.Dictionary <DateTime, int> ctrlcount = new System.Collections.Generic.Dictionary <DateTime, int>();

            foreach (System.Data.DataRowView drv in dv)
            {
                DateTime startdate = ((DateTime)drv[DayField]).Date;
                DateTime enddate   = (drv[EndDayField] != DBNull.Value) ? ((DateTime)drv[EndDayField]).Date : startdate;
                DateTime rowdate   = startdate;
                while (rowdate <= enddate)
                {
                    if (rowdate >= firstDay && rowdate <= lastDay)
                    {
                        if (ctrlcount.ContainsKey(rowdate))
                        {
                            ctrlcount[rowdate] += 1;
                        }
                        else
                        {
                            ctrlcount[rowdate] = 1;
                        }
                    }
                    rowdate = rowdate.AddDays(1);
                }
            }
            ViewState[ViewStateDataKey] = ctrlcount;
        }
Beispiel #21
0
        private void ButtonGet_Click(object sender, RoutedEventArgs e)
        {
            string[] _pointCodes = txtPointIds.Text.Split(new char[] { '|' });

            StringBuilder sb = new StringBuilder();

            sb.Append("[");
            foreach (var point in _pointCodes)
            {
                sb.AppendFormat("{{id:{0}}},", point);
            }
            sb.Remove(sb.Length - 1, 1);
            sb.Append("]");

            var table = client.GetSTPLData("PSDTU_SERVER", "[{id:3644},{id:3646},{id:3648},{id:3650}]", "[{id:385},{id:386}]", "01.12.2016 00:00:00", "01.01.2017 00:00:00");

            Items2 = table.DefaultView;

            /*Stopwatch s = new Stopwatch();
             * s.Start();
             * System.Data.DataTable table = ExecuteGetSTPLDataFunction(sb.ToString(), new int[] { 385, 386 }, new DateTime(2016, 12, 1), new DateTime(2017, 1, 1));
             * s.Stop();
             * MessageBox.Show(s.ElapsedTicks.ToString());
             *
             * Items2 = table.DefaultView;*/
        }
Beispiel #22
0
        public IDictionary<string, string> Execute(IEnumerable<LinkedService> linkedServices, IEnumerable<Dataset> datasets, Activity activity, IActivityLogger logger)
        {
            //Settings in extended items:
            //1) List of columns to operate on
            //  a) Sort Column
            //  b) Sort Type
            //  c) Sort Order

            var inDS = Helper.DatasetHelper.GetInputDatatable(activity, linkedServices, datasets);
            var outDS = Helper.DatasetHelper.GetOutputDatasetShell(activity, linkedServices, datasets);

            foreach (var o in activity.Outputs)
            {
                System.Data.DataView dv = new System.Data.DataView(inDS);
                dv.Sort = ((DotNetActivity)(activity.TypeProperties)).ExtendedProperties.Single(ep => ep.Key == string.Format("DatasetSort{0}", activity.Outputs.IndexOf(o))).Value;
                foreach (System.Data.DataRow r in dv.ToTable().Rows)
                {
                    outDS.Tables[activity.Outputs.IndexOf(o)].Rows.Add(r.ItemArray);
                }
            }

            Helper.DatasetHelper.WriteOutputDataset(activity, linkedServices, datasets, outDS);

            //Per documentation, this isn't used yet
            return new Dictionary<string, string>();
        }
Beispiel #23
0
        protected void LogIn(object sender, EventArgs e)
        {
            Upwd        = Password.Text;
            Uemail      = email.Text;
            lbl.Visible = true;

            SqlDataSource3.SelectCommand = ("SELECT customer_ID FROM [customer] where customer_email ='" + Uemail + "' AND customer_pwd = '" + Upwd + "'");

            DataSourceSelectArguments sr = new DataSourceSelectArguments();

            System.Data.DataView dv = (System.Data.DataView)SqlDataSource3.Select(sr);
            if (dv.Count != 0)
            {
                Session["uid"] = dv[0][0].ToString();
            }


            if (correctUser.Equals(true))
            {
                lbl.Text = "Correct Credentials Inserted";
                Response.Redirect("~/user_management/userHomePage", false); //create a user page with few options (book, view profile, view booking list)
                Session["email"] = Uemail;
                Session["state"] = "logged in";
            }
            else
            {
                lbl.Text = "Wrong Credentials inserted";
            }
        }
Beispiel #24
0
        /*********************************************************************************
        *
        * Data binding control methods
        *
        *********************************************************************************/

        protected override int CreateChildControls(IEnumerable dataSource, bool dataBinding)
        {
            //set the count to zero
            int controlsCreated = 0;

            //Create the table for the rows

            DateTime visibleDate = this.VisibleDate;
            DateTime firstDay    = FirstCalendarDay(visibleDate);
            DateTime todaysDate  = TodaysDate;

            System.Globalization.Calendar threadCalendar = DateTimeFormatInfo.CurrentInfo.Calendar;

            m_table = CreateTable(visibleDate, firstDay, threadCalendar);
            this.Controls.Add(m_table);

            if (dataBinding)
            {
                //We have real data.
                System.Data.DataView dv = SetupRealData(dataSource);
                controlsCreated += CreateDataBoundChildren(dv, m_table, todaysDate, visibleDate, threadCalendar);
            }
            else
            {
                //Get the number of templates from viewstate and instantiate the templates
                controlsCreated += createChildrenFromViewstate(m_table, todaysDate, visibleDate, threadCalendar);
            }
            return(controlsCreated);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="inbox"></param>
        /// <param name="all"></param>
        /// <returns></returns>
        public bool PurgeInbox(anmar.SharpWebMail.CTNInbox inbox, bool all)
        {
            bool error = false;

            System.String filter;
            if (all)
            {
                filter = System.String.Empty;
            }
            else
            {
                filter = "delete=true";
            }
            System.Data.DataView result = inbox.Inbox;
            result.RowFilter = filter;
            if (result.Count > 0)
            {
                int total = 0, totalbytes = 0;
                error            = !this.connect();
                error            = (error)?error:!this.login(this.username, this.password);
                error            = (error)?error:!this.status(ref total, ref totalbytes);
                error            = (error)?error:!this.getListToIndex(null, total, inbox, 0, 0);
                result.RowFilter = filter;
                error            = (error)?error:!this.deletemessages(result);
                error            = (error)?error:!this.getListToIndex(null, total, inbox, 0, 0);
                this.quit();
            }
            result.RowFilter = System.String.Empty;
            return(!error);
        }
        public WindowSupplier(Object dbObject)
        {
            InitializeComponent();

            Width = 600;
            Height = 650;            

            _db = (DBManager)dbObject;
            dv = _db.DataTableGet("sups").DefaultView;
            dv.RowFilter = null;


            #region Initialize Control

            gridControl1.DataSource = dv;

            gridControl1.Columns.Add(new GridColumn { FieldName = "SUPPLIER", Header="Код", AllowEditing = DefaultBoolean.False });
            gridControl1.Columns.Add(new GridColumn { FieldName = "SUP_NAME", Header="Наименование", Width = 400, AllowEditing = DefaultBoolean.False });

            //gridControl1.View.FilterEditorCreated += ViewFilterEditorCreated;
            gridControl1.MouseDoubleClick += GridControl1MouseDoubleClick;

            lblFilter.Text = "Фильтр по коду:";
            tbFilter.Focus();

            #endregion
        }
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;

            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
                        + "(srAccID,partName,description,partNumber,color,usdPrice,cadPrice,status)"
                        + "VALUES"
                        + "(" + (count + 1) + ",'" + Sunrail300AccessoriesName + "','" + Sunrail300AccessoriesDescription + "','" + PartNumber + "','"
                        + Sunrail300AccessoriesColor + "',"
                        + Sunrail300AccessoriesUsdPrice + "," + Sunrail300AccessoriesCadPrice + "," + 1 + ")";


            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #28
0
        ICollection CreateDataSource()
        {
            System.Data.DataTable dt = new System.Data.DataTable();
            System.Data.DataRow   dr;
            dt.Columns.Add(new System.Data.DataColumn("学生班级", typeof(System.String)));
            dt.Columns.Add(new System.Data.DataColumn("学生姓名", typeof(System.String)));
            dt.Columns.Add(new System.Data.DataColumn("语文", typeof(System.Decimal)));
            dt.Columns.Add(new System.Data.DataColumn("数学", typeof(System.Decimal)));
            dt.Columns.Add(new System.Data.DataColumn("英语", typeof(System.Decimal)));
            dt.Columns.Add(new System.Data.DataColumn("计算机", typeof(System.Decimal)));

            for (int i = 0; i < 50; i++)
            {
                System.Random rd = new System.Random(Environment.TickCount * i);;
                dr    = dt.NewRow();
                dr[0] = "班级" + i.ToString();
                dr[1] = "【明日科技】" + i.ToString();
                dr[2] = Math.Round(rd.NextDouble() * 100, 2);
                dr[3] = Math.Round(rd.NextDouble() * 100, 2);
                dr[4] = Math.Round(rd.NextDouble() * 100, 2);
                dr[5] = Math.Round(rd.NextDouble() * 100, 2);
                dt.Rows.Add(dr);
            }
            System.Data.DataView dv = new System.Data.DataView(dt);
            return(dv);
        }
        } // End Sub button2_Click

        private System.Data.DataTable GetAllBenchmarks()
        {
            HtmlAgilityPack.HtmlWeb web = new HtmlAgilityPack.HtmlWeb();
            //HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.Load(@"");
            HtmlAgilityPack.HtmlDocument doc = web.Load(@"http://benchmarksgame.alioth.debian.org/");


            System.Data.DataTable dt = new System.Data.DataTable();

            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Url", typeof(string));

            System.Data.DataRow dr = null;

            foreach (HtmlAgilityPack.HtmlNode link in doc.DocumentNode.SelectNodes("//section[1]//li/a[@href]"))
            {
                dr = dt.NewRow();
                // System.Console.WriteLine(link);
                dr["Name"] = System.Web.HttpUtility.HtmlDecode(link.InnerText);
                dr["Url"]  = link.Attributes["href"].Value;

                dt.Rows.Add(dr);
            } // Next link


            System.Data.DataView dv = dt.DefaultView;
            dv.Sort = "Name ASC";
            System.Data.DataTable sortedDT = dv.ToTable();

            return(sortedDT);
        } // End Function GetAllBenchmarks
Beispiel #30
0
 private void check_id()
 {
     SqlDataSource4.SelectCommand = "SELECT * FROM [ticket_details]";
     System.Data.DataView dv = (System.Data.DataView)SqlDataSource4.Select(DataSourceSelectArguments.Empty);
     lbl.Text   = dv.Count.ToString();
     id_From_db = dv.Count + 1;
 }
Beispiel #31
0
        //Gets the data ready and caches the count of records in viewstate.

        System.Data.DataView SetupRealData(IEnumerable data)
        {
            System.Data.DataView dv = null;

            if (data is System.Data.DataSet)
            {
                System.Data.DataTable dt;
                if (DataMember != null && DataMember != "")
                {
                    dt = ((System.Data.DataSet)data).Tables[this.DataMember];
                }
                else
                {
                    dt = ((System.Data.DataSet)data).Tables[0];
                }

                dv = new System.Data.DataView(dt);
            }
            else if (data is System.Data.DataTable)
            {
                System.Data.DataTable dt = (System.Data.DataTable)data;
                dv = new System.Data.DataView(dt);
            }
            else if (data is System.Data.DataView)
            {
                dv = (System.Data.DataView)data;
            }

            cacheDataInViewstate(dv);

            return(dv);
        }
Beispiel #32
0
 public static System.Data.DataTable GetByGroup(int inUserGroup)
 {
     if (_powerShipTable == null) {
         _powerShipTable = GetAll();
     }
     System.Data.DataView dv = new System.Data.DataView(_powerShipTable);
     dv.RowFilter = string.Format("UserGroup = {0}", inUserGroup);
     return dv.ToTable();
 }
        protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlCategory.SelectedValue != "")
            {
                //get table name selected
                string tableName = "tbl" + ddlCategory.SelectedValue.Replace(" ", "");

                //display second dropdown
                ddlPart.CssClass = "ddlField";

                //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);

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

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

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

                //populate second drop down
                for (int i = 0; i < rowCount; i++)
                {
                    ddlPart.Items.Add(partsList[i][0].ToString() + " (" + partsList[i][1].ToString() + ")");
                }

                //add table name to session
                Session.Add("tableName", tableName);

                if (Session["categoryIndex"] != null)
                {
                    Session["categoryIndex"] = ddlCategory.SelectedIndex;
                }
                else
                {
                    Session.Add("categoryIndex", ddlCategory.SelectedIndex);
                }
            }
        }
Beispiel #34
0
		public BoundDataView(System.Data.DataView dataView)
		{
			m_dataView = dataView;

			m_dataView.ListChanged += new System.ComponentModel.ListChangedEventHandler(mDataView_ListChanged);
			// Save it for destructor
			m_dataTable = m_dataView.Table;
			if ( m_dataTable != null )
			{
				m_dataTable.TableCleared += new System.Data.DataTableClearEventHandler(Table_TableCleared);
				m_dataTable.RowDeleted += new System.Data.DataRowChangeEventHandler(Table_RowDeleted);
			}
		}
        /// <summary>
        /// Renderiza matriz de dados.
        /// </summary>
        /// <returns>Matriz de dados.</returns>
        /// <param name="p_pageheight">Altura da página.</param>
        /// <param name="p_pagewidth">Largura da página.</param>
        /// <param name="p_datafieldfont">Fonte do campo de dados.</param>
        /// <param name="p_groupheaderfont">Fonte do cabeçalho de grupo.</param>
        /// <param name="p_groupfooterfont">Fonte do rodapé de grupo.</param>
        private System.Collections.Generic.List<System.Collections.Generic.List<PDFjet.NET.Cell>> RenderData(
            float p_pageheight,
            float p_pagewidth,
            PDFjet.NET.Font p_datafieldfont,
            PDFjet.NET.Font p_groupheaderfont,
            PDFjet.NET.Font p_groupfooterfont
        )
        {
            System.Collections.Generic.List<System.Collections.Generic.List<PDFjet.NET.Cell>> v_data;
            System.Data.DataView v_view;
            string v_textrow;
            System.IO.StreamWriter v_writer;
            string v_text;
            int k, r, v_sectionrow;
            string v_sort;

            v_data = new System.Collections.Generic.List<System.Collections.Generic.List<PDFjet.NET.Cell>>();
            v_writer = new System.IO.StreamWriter(this.v_datafile);

            // se o relatorio possui grupos
            if (this.v_groups.Count > 0)
            {
                // ordenando campos da tabela original para otimizar a renderização
                v_sort = "";
                for (k = this.v_groups.Count - 1; k >= 0; k--)
                    v_sort += ((Spartacus.Reporting.Group)v_groups[k]).v_column + ", ";
                v_view = new System.Data.DataView(this.v_table);
                v_view.Sort = v_sort + ((Spartacus.Reporting.Group)v_groups[0]).v_sort;
                this.v_rendertable = v_view.ToTable();

                this.RenderGroup(
                    this.v_groups.Count - 1,
                    null,
                    null,
                    v_data,
                    p_pageheight,
                    p_pagewidth,
                    p_datafieldfont,
                    p_groupheaderfont,
                    p_groupfooterfont,
                    v_writer
                );
            }
            else // se o relatorio nao possui grupos
            {
                r = 0;
                foreach (System.Data.DataRow rb in this.v_table.Rows)
                {
                    for (v_sectionrow = 0; v_sectionrow < this.v_numrowsdetail; v_sectionrow++)
                    {
                        v_textrow = "";
                        for (k = 0; k < this.v_fields.Count; k++)
                        {
                            if (((Spartacus.Reporting.Field)this.v_fields[k]).v_row == v_sectionrow)
                            {
                                v_text = ((Spartacus.Reporting.Field)this.v_fields[k]).Format(rb[((Spartacus.Reporting.Field)this.v_fields[k]).v_column].ToString());
                                v_textrow += v_text.Replace(';', ',') + ";";
                            }
                        }
                        v_writer.WriteLine(v_textrow);
                    }

                    if (r % 2 == 0)
                        v_data.AddRange(this.v_detaileventemplate);
                    else
                        v_data.AddRange(this.v_detailoddtemplate);
                    r++;

                    this.v_perc += v_inc;
                    this.v_renderedrows++;
                    this.v_progress.FireEvent("Spartacus.Reporting.Report", "ExportPDF", this.v_perc, "Relatorio " + this.v_reportid.ToString() + ": linha " + this.v_renderedrows.ToString() + " de " + this.v_table.Rows.Count.ToString());
                }
            }

            v_writer.Flush();

            return v_data;
        }
Beispiel #36
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(suncrylicRoofID,partName,description,partNumber,color,maxLength,lengthUnits,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + SuncrylicName + "','" + SuncrylicDescription + "','" + PartNumber + "','" + SuncrylicColor + "'," + SuncrylicMaxLength + ",'" + SuncrylicLengthUnits + "',"
            + UsdPrice + "," + CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #37
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(extrusionID,partName,description,partNumber,size,sizeUnits,color,extrusionAngleA,angleAUnits,extrusionAngleB,angleBUnits,extrusionAngleC,angleCUnits,maxLength,lengthUnits,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + ExtrusionName + "','" + ExtrusionDescription + "','" + ExtrusionNumber + "'," + ExtrusionSize + ",'"
            + SizeUnits + "','" + ExtrusionColor + "'," + AngleA + ",'" + AngleAUnits + "'," + AngleB + ",'" + AngleBUnits + "'," + AngleC + ",'" + AngleCUnits + "'," + ExtrusionMaxLength + ",'" + MaxLengthUnits + "',"
            + UsdPrice + "," + CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #38
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) //only on first load
            {
                //set default values to declared empty variables
                Session.Add("categoryIndex", 0);
                radIncreaseDecrease.SelectedIndex = 0;
                radPercentDollar.SelectedIndex = 0;
                totalElements = 0;
                lblHeaderPriceAdjust.Text = "Price Increase by %";

                //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"; 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("All");
                //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"];
            }

                #region populateViews

            //Dataviews for each table
            System.Data.DataView tblAccessories = new System.Data.DataView();
            System.Data.DataView tblDecorativeColumn = new System.Data.DataView();
            System.Data.DataView tblDoorFrameExtrusion = new System.Data.DataView();
            System.Data.DataView tblInsulatedFloors = new System.Data.DataView();
            System.Data.DataView tblRoofExtrusions = new System.Data.DataView();
            System.Data.DataView tblRoofPanels = new System.Data.DataView();
            System.Data.DataView tblScreenRoll = new System.Data.DataView();
            System.Data.DataView tblSuncrylicRoof = new System.Data.DataView();
            System.Data.DataView tblSunrail1000 = new System.Data.DataView();
            System.Data.DataView tblSunrail300 = new System.Data.DataView();
            System.Data.DataView tblSunrail300Accessories = new System.Data.DataView();
            System.Data.DataView tblSunrail400 = new System.Data.DataView();
            System.Data.DataView tblVinylRoll = new System.Data.DataView();
            System.Data.DataView tblWallExtrusions = new System.Data.DataView();
            System.Data.DataView tblWallPanels = new System.Data.DataView();

            //If all, or specific table name (will display only this table)
            if (ddlCategory.SelectedValue == "Accessories" || ddlCategory.SelectedValue == "All")
            {
                datSelectDataSource.SelectCommand = "SELECT * FROM tblAccessories"; //select all data from table
                tblAccessories = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty); //put data into the data view for later
                totalElements += tblAccessories.Count;//increase total counter
                tableStarts[tableCounter] = 0; //starts at 0 since first table
                tableNames[tableCounter] = "tblAccessories"; //set the table name in this array
                tableCounter++; //and increase amount of tables populated by one
            }

            if (ddlCategory.SelectedValue == "Decorative Column" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblDecorativeColumn";
                tblDecorativeColumn = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblDecorativeColumn.Count;
                tableNames[tableCounter] = "tblDecorativeColumn";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Door Frame Extrusion" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblDoorFrameExtrusion";
                tblDoorFrameExtrusion = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblDoorFrameExtrusion.Count;
                tableNames[tableCounter] = "tblDoorFrameExtrusion";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Insulated Floors" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblInsulatedFloors";
                tblInsulatedFloors = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblInsulatedFloors.Count;
                tableNames[tableCounter] = "tblInsulatedFloors";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Roof Extrusions" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblRoofExtrusions";
                tblRoofExtrusions = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblRoofExtrusions.Count;
                tableNames[tableCounter] = "tblRoofExtrusions";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Roof Panels" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblRoofPanels";
                tblRoofPanels = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblRoofPanels.Count;
                tableNames[tableCounter] = "tblRoofPanels";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Screen Roll" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblScreenRoll";
                tblScreenRoll = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblScreenRoll.Count;
                tableNames[tableCounter] = "tblScreenRoll";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Suncrylic Roof" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblSuncrylicRoof";
                tblSuncrylicRoof = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblSuncrylicRoof.Count;
                tableNames[tableCounter] = "tblSuncrylicRoof";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Sunrail 1000" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail1000";
                tblSunrail1000 = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblSunrail1000.Count;
                tableNames[tableCounter] = "tblSunrail1000";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Sunrail 300" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail300";
                tblSunrail300 = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblSunrail300.Count;
                //          CHANGETHISCODE, need to uncomment upon Sunrail300 fix
                 tableNames[tableCounter] = "tblSunrail300";
                 tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Sunrail 300 Accessories" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail300Accessories";
                tblSunrail300Accessories = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblSunrail300Accessories.Count;
                tableNames[tableCounter] = "tblSunrail300Accessories";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Sunrail 400" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail400";
                tblSunrail400 = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblSunrail400.Count;
                tableNames[tableCounter] = "tblSunrail400";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Vinyl Roll" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblVinylRoll";
                tblVinylRoll = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblVinylRoll.Count;
                tableNames[tableCounter] = "tblVinylRoll";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Wall Extrusions" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblWallExtrusions";
                tblWallExtrusions = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblWallExtrusions.Count;
                tableNames[tableCounter] = "tblWallExtrusions";
                tableCounter++;
            }

            if (ddlCategory.SelectedValue == "Wall Panels" || ddlCategory.SelectedValue == "All")
            {
                tableStarts[tableCounter] = totalElements;  //will start at the current # of elements
                datSelectDataSource.SelectCommand = "SELECT * FROM tblWallPanels";
                tblWallPanels = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                totalElements += tblWallPanels.Count;
                tableNames[tableCounter] = "tblWallPanels";
                tableCounter++;
            }
                #endregion

                #region declareArrays
                //generate array based on total # of elements calculated
                checkboxArray = new CheckBox[totalElements];
                partNumArray = new Label[totalElements];
                partNameArray = new Label[totalElements];
                currentUSArray = new Label[totalElements];
                currentCanArray = new Label[totalElements];
                priceUSArray = new TextBox[totalElements];
                priceCanArray = new TextBox[totalElements];
                previewUSArray = new TextBox[totalElements];
                previewCanArray = new TextBox[totalElements];
                lastCalculatedUS = new string[totalElements];
                lastCalculatedCan = new string[totalElements];
                lastAdjustedUS = new string[totalElements];
                lastAdjustedCan = new string[totalElements];

                Session.Add("totalElements", totalElements);
                #endregion

                #region populateArrays
                //Need a class instantiated per table so call populate functions
                Accessories tempAccessory = new Accessories();
                DecorativeColumn tempDecorativeColumn = new DecorativeColumn();
                DoorFrameExtrusion tempDoorFrameExtrusion = new DoorFrameExtrusion();
                InsulatedFloors tempInsulatedFloors = new InsulatedFloors();
                RoofExtrusion tempRoofExtrusions = new RoofExtrusion();
                RoofPanels tempRoofPanels = new RoofPanels();
                ScreenRoll tempScreenRoll = new ScreenRoll();
                SuncrylicRoof tempSuncrylicRoof = new SuncrylicRoof();
                Sunrail1000 tempSunrail1000 = new Sunrail1000();
                Sunrail300 tempSunrail300 = new Sunrail300();
                Sunrail300Accessories tempSunrail300Accessories = new Sunrail300Accessories();
                Sunrail400 tempSunrail400 = new Sunrail400();
                VinylRoll tempVinylRoll = new VinylRoll();
                WallExtrusions tempWallExtrusions = new WallExtrusions();
                WallPanels tempWallPanels = new WallPanels();

                //a temp data view for use with populate function
                System.Data.DataView tempDataView = new System.Data.DataView();
                int elementCounter = 0; //for use with keeping track of where we are in totalElements, while not resetting to 0 for each table
                int pastTablesTotal = 0; //used to make sure we access element 0 of at the start of each table, not the counter's value

                if (ddlCategory.SelectedValue == "Accessories" || ddlCategory.SelectedValue == "All")
                {
                    #region Accessories
                    for (int i = elementCounter; i < tblAccessories.Count; i++)
                    {
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblAccessories WHERE accID=" + i; //select statement from database
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty); //results from select command are placed in temp data view
                        tempAccessory.Populate(tempAccessory.SelectAll(datDisplayDataSource, "tblAccessories", tblAccessories[i][3].ToString())); //temp dataview calls populate from the class

                        checkboxArray[i] = new CheckBox(); //add a control for this record
                        checkboxArray[i].ID = "tblAccessoriesCheckBox" + i.ToString(); //give it an ID

                        partNumArray[i] = new Label();//add a control for this record
                        partNumArray[i].ID = "tblAccessoriesPartNumLabel" + i.ToString();//give it an ID
                        partNumArray[i].Text = tempAccessory.AccessoryNumber; //set it's default value based on data retrieved from class population

                        partNameArray[i] = new Label();//add a control for this record
                        partNameArray[i].ID = "tblAccessoriesPartNameLabel" + i.ToString();//give it an ID
                        partNameArray[i].Text = tempAccessory.AccessoryName; //set it's default value based on data retrieved from class population

                        currentUSArray[i] = new Label();//add a control for this record
                        currentUSArray[i].ID = "tblAccessoriesCurrentUSLabel" + i.ToString();//give it an ID
                        currentUSArray[i].Text = tempAccessory.AccessoryUsdPrice.ToString("N2"); //set it's default value based on data retrieved from class population

                        currentCanArray[i] = new Label();//add a control for this record
                        currentCanArray[i].ID = "tblAccessoriesCurrentCanLabel" + i.ToString();//give it an ID
                        currentCanArray[i].Text = tempAccessory.AccessoryCadPrice.ToString("N2"); //set it's default value based on data retrieved from class population

                        priceUSArray[i] = new TextBox();//add a control for this record
                        priceUSArray[i].ID = "tblAccessoriesPriceUSTextBox" + i.ToString();//give it an ID
                        priceUSArray[i].CssClass = "txtInputField"; //set CSS and height/width
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();//add a control for this record
                        priceCanArray[i].ID = "tblAccessoriesPriceCanTextBox" + i.ToString();//give it an ID
                        priceCanArray[i].CssClass = "txtInputField";//set CSS and height/width
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();//add a control for this record
                        previewUSArray[i].ID = "tblAccessoriesPreviewUSLabel" + i.ToString();//give it an ID
                        previewUSArray[i].CssClass = "txtInputField";//set CSS and height/width
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblAccessoriesPreviewCanLabel" + i.ToString();//give it an ID
                        previewCanArray[i].CssClass = "txtInputField";//set CSS and height/width
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblAccessories.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Decorative Column" || ddlCategory.SelectedValue == "All")
                {
                    #region DecorativeColumn
                    for (int i = elementCounter; i < (tblDecorativeColumn.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblDecorativeColumn WHERE columnID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempDecorativeColumn.Populate(tempDecorativeColumn.SelectAll(datDisplayDataSource, "tblDecorativeColumn", tblDecorativeColumn[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblDecorativeColumnCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblDecorativeColumnPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempDecorativeColumn.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblDecorativeColumnPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempDecorativeColumn.ColumnName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblDecorativeColumnCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempDecorativeColumn.ColumnUsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblDecorativeColumnCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempDecorativeColumn.ColumnCadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblDecorativeColumnPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblDecorativeColumnPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblDecorativeColumnPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblDecorativeColumnPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblDecorativeColumn.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Door Frame Extrusion" || ddlCategory.SelectedValue == "All")
                {
                    #region DoorFrameExtrusion
                    for (int i = elementCounter; i < (tblDoorFrameExtrusion.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblDoorFrameExtrusion WHERE dfeID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempDoorFrameExtrusion.Populate(tempDoorFrameExtrusion.SelectAll(datDisplayDataSource, "tblDoorFrameExtrusion", tblDoorFrameExtrusion[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblDoorFrameExtrusionCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblDoorFrameExtrusionPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempDoorFrameExtrusion.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblDoorFrameExtrusionPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempDoorFrameExtrusion.DfeName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblDoorFrameExtrusionCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempDoorFrameExtrusion.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblDoorFrameExtrusionCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempDoorFrameExtrusion.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblDoorFrameExtrusionPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblDoorFrameExtrusionPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblDoorFrameExtrusionPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblDoorFrameExtrusionPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblDoorFrameExtrusion.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Insulated Floors" || ddlCategory.SelectedValue == "All")
                {
                    #region InsulatedFloors
                    for (int i = elementCounter; i < (tblInsulatedFloors.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblInsulatedFloors WHERE insulatedFloorID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempInsulatedFloors.Populate(tempInsulatedFloors.SelectAll(datDisplayDataSource, "tblInsulatedFloors", tblInsulatedFloors[i - pastTablesTotal][4].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblInsulatedFloorsCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblInsulatedFloorsPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempInsulatedFloors.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblInsulatedFloorsPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempInsulatedFloors.InsulatedFloorName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblInsulatedFloorsCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempInsulatedFloors.InsulatedFloorUsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblInsulatedFloorsCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempInsulatedFloors.InsulatedFloorCadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblInsulatedFloorsPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblInsulatedFloorsPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblInsulatedFloorsPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblInsulatedFloorsPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblInsulatedFloors.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Roof Extrusions" || ddlCategory.SelectedValue == "All")
                {
                    #region RoofExtrusions
                    for (int i = elementCounter; i < (tblRoofExtrusions.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblRoofExtrusions WHERE extrusionID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempRoofExtrusions.Populate(tempRoofExtrusions.SelectAll(datDisplayDataSource, "tblRoofExtrusions", tblRoofExtrusions[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblRoofExtrusionsCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblRoofExtrusionsPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempRoofExtrusions.ExtrusionNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblRoofExtrusionsPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempRoofExtrusions.ExtrusionName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblRoofExtrusionsCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempRoofExtrusions.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblRoofExtrusionsCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempRoofExtrusions.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblRoofExtrusionsPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblRoofExtrusionsPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblRoofExtrusionsPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblRoofExtrusionsPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblRoofExtrusions.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Roof Panels" || ddlCategory.SelectedValue == "All")
                {
                    #region RoofPanels
                    for (int i = elementCounter; i < (tblRoofPanels.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblRoofPanels WHERE panelId=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempRoofPanels.Populate(tempRoofPanels.SelectAll(datDisplayDataSource, "tblRoofPanels", tblRoofPanels[i - pastTablesTotal][6].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblRoofPanelsCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblRoofPanelsPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempRoofPanels.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblRoofPanelsPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempRoofPanels.PanelName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblRoofPanelsCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempRoofPanels.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblRoofPanelsCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempRoofPanels.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblRoofPanelsPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblRoofPanelsPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblRoofPanelsPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblRoofPanelsPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblRoofPanels.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Screen Roll" || ddlCategory.SelectedValue == "All")
                {
                    #region ScreenRoll
                    for (int i = elementCounter; i < (tblScreenRoll.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblScreenRoll WHERE rollID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempScreenRoll.Populate(tempScreenRoll.SelectAll(datDisplayDataSource, "tblScreenRoll", tblScreenRoll[i - pastTablesTotal][2].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblScreenRollCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblScreenRollPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempScreenRoll.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblScreenRollPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempScreenRoll.ScreenRollName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblScreenRollCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempScreenRoll.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblScreenRollCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempScreenRoll.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblScreenRollPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblScreenRollPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblScreenRollPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblScreenRollPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblScreenRoll.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Suncrylic Roof" || ddlCategory.SelectedValue == "All")
                {
                    #region SuncrylicRoof
                    for (int i = elementCounter; i < (tblSuncrylicRoof.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblSuncrylicRoof WHERE suncrylicRoofID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempSuncrylicRoof.Populate(tempSuncrylicRoof.SelectAll(datDisplayDataSource, "tblSuncrylicRoof", tblSuncrylicRoof[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblSuncrylicRoofCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblSuncrylicRoofPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempSuncrylicRoof.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblSuncrylicRoofPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempSuncrylicRoof.SuncrylicName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblSuncrylicRoofCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempSuncrylicRoof.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblSuncrylicRoofCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempSuncrylicRoof.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblSuncrylicRoofPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblSuncrylicRoofPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblSuncrylicRoofPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblSuncrylicRoofPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblSuncrylicRoof.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Sunrail 1000" || ddlCategory.SelectedValue == "All")
                {
                    #region Sunrail1000
                    for (int i = elementCounter; i < (tblSunrail1000.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail1000 WHERE sr1000ID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempSunrail1000.Populate(tempSunrail1000.SelectAll(datDisplayDataSource, "tblSunrail1000", tblSunrail1000[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblSunrail1000CheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblSunrail1000PartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempSunrail1000.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblSunrail1000PartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempSunrail1000.Sunrail1000Name;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblSunrail1000CurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempSunrail1000.Sunrail1000UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblSunrail1000CurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempSunrail1000.Sunrail1000CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblSunrail1000PriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblSunrail1000PriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblSunrail1000PreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblSunrail1000PreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblSunrail1000.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Sunrail 300" || ddlCategory.SelectedValue == "All")
                {
                    #region Sunrail300

                    for (int i = elementCounter; i < (tblSunrail300.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail300 WHERE sr300ID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempSunrail300.Populate(tempSunrail300.SelectAll(datDisplayDataSource, "tblSunrail300", tblSunrail300[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblSunrail300CheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblSunrail300PartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempSunrail300.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblSunrail300PartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempSunrail300.Sunrail300Name;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblSunrail300CurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempSunrail300.Sunrail300UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblSunrail300CurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempSunrail300.Sunrail300CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblSunrail300PriceUSTextBox" + i.ToString();
                            priceUSArray[i].CssClass = "txtInputField";
                            priceUSArray[i].Height = TEXTBOX_HEIGHT;
                            priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblSunrail300PriceCanTextBox" + i.ToString();
                            priceCanArray[i].CssClass = "txtInputField";
                            priceCanArray[i].Height = TEXTBOX_HEIGHT;
                            priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblSunrail300PreviewUSLabel" + i.ToString();
                            previewUSArray[i].CssClass = "txtInputField";
                            previewUSArray[i].Height = TEXTBOX_HEIGHT;
                            previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblSunrail300PreviewCanLabel" + i.ToString();
                            previewCanArray[i].CssClass = "txtInputField";
                            previewCanArray[i].Height = TEXTBOX_HEIGHT;
                            previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblSunrail300.Count;

                    #endregion
                }

                if (ddlCategory.SelectedValue == "Sunrail 300 Accessories" || ddlCategory.SelectedValue == "All")
                {
                    #region Sunrail300Accessories
                    for (int i = elementCounter; i < (tblSunrail300Accessories.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail300Accessories WHERE srAccID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempSunrail300Accessories.Populate(tempSunrail300Accessories.SelectAll(datDisplayDataSource, "tblSunrail300Accessories", tblSunrail300Accessories[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblSunrail300AccessoriesCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblSunrail300AccessoriesPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempSunrail300Accessories.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblSunrail300AccessoriesPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempSunrail300Accessories.Sunrail300AccessoriesName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblSunrail300AccessoriesCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempSunrail300Accessories.Sunrail300AccessoriesUsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblSunrail300AccessoriesCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempSunrail300Accessories.Sunrail300AccessoriesCadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblSunrail300AccessoriesPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblSunrail300AccessoriesPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblSunrail300AccessoriesPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblSunrail300AccessoriesPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblSunrail300Accessories.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Sunrail 400" || ddlCategory.SelectedValue == "All")
                {
                    #region Sunrail400
                    for (int i = elementCounter; i < (tblSunrail400.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblSunrail400 WHERE sr400ID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempSunrail400.Populate(tempSunrail400.SelectAll(datDisplayDataSource, "tblSunrail400", tblSunrail400[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblSunrail400CheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblSunrail400PartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempSunrail400.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblSunrail400PartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempSunrail400.Sunrail400Name;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblSunrail400CurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempSunrail400.Sunrail400UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblSunrail400CurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempSunrail400.Sunrail400CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblSunrail400PriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblSunrail400PriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblSunrail400PreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblSunrail400PreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblSunrail400.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Vinyl Roll" || ddlCategory.SelectedValue == "All")
                {
                    #region VinylRoll
                    for (int i = elementCounter; i < (tblVinylRoll.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblVinylRoll WHERE rollID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempVinylRoll.Populate(tempVinylRoll.SelectAll(datDisplayDataSource, "tblVinylRoll", tblVinylRoll[i - pastTablesTotal][2].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblVinylRollCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblVinylRollPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempVinylRoll.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblVinylRollPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempVinylRoll.VinylRollName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblVinylRollCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempVinylRoll.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblVinylRollCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempVinylRoll.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblVinylRollPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblVinylRollPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblVinylRollPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblVinylRollPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblVinylRoll.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Wall Extrusions" || ddlCategory.SelectedValue == "All")
                {
                    #region WallExtrusions
                    for (int i = elementCounter; i < (tblWallExtrusions.Count + pastTablesTotal); i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblWallExtrusions WHERE wallExtrusionID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempWallExtrusions.Populate(tempWallExtrusions.SelectAll(datDisplayDataSource, "tblWallExtrusions", tblWallExtrusions[i - pastTablesTotal][3].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblWallExtrusionsCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblWallExtrusionsPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempWallExtrusions.PartNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblWallExtrusionsPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempWallExtrusions.WallExtrusionName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblWallExtrusionsCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempWallExtrusions.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblVinylRollCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempWallExtrusions.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblWallExtrusionsPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblWallExtrusionsPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblWallExtrusionsPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblWallExtrusionsPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblWallExtrusions.Count;
                    #endregion
                }

                if (ddlCategory.SelectedValue == "Wall Panels" || ddlCategory.SelectedValue == "All")
                {
                    #region WallPanels
                    //
                    //
                    //
                    // CHANGETHISCODE - hardcoded for sunrail300 fixing
                    //
                    //totalElements = 440;
                    //
                    //
                    //
                    //
                    //
                    for (int i = elementCounter; i < totalElements; i++) //adding elementCounter so that, if it starts above 0, will just do the .count value
                    {                                                                                    //past tables total is there so that the ending condition is in the proper # away from the start
                        datSelectDataSource.SelectCommand = "SELECT * FROM tblWallPanels WHERE wallPanelID=" + (i - pastTablesTotal);
                        tempDataView = (System.Data.DataView)datSelectDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
                        tempWallPanels.Populate(tempWallPanels.SelectAll(datDisplayDataSource, "tblWallPanels", tblWallPanels[i - pastTablesTotal][6].ToString()));

                        checkboxArray[i] = new CheckBox();
                        checkboxArray[i].ID = "tblWallPanelsCheckBox" + i.ToString();

                        partNumArray[i] = new Label();
                        partNumArray[i].ID = "tblWallPanelsPartNumLabel" + i.ToString();
                        partNumArray[i].Text = tempWallPanels.WallPanelNumber;

                        partNameArray[i] = new Label();
                        partNameArray[i].ID = "tblWallPanelsPartNameLabel" + i.ToString();
                        partNameArray[i].Text = tempWallPanels.WallPanelName;

                        currentUSArray[i] = new Label();
                        currentUSArray[i].ID = "tblWallPanelsCurrentUSLabel" + i.ToString();
                        currentUSArray[i].Text = tempWallPanels.UsdPrice.ToString("N2");

                        currentCanArray[i] = new Label();
                        currentCanArray[i].ID = "tblWallPanelsCurrentCanLabel" + i.ToString();
                        currentCanArray[i].Text = tempWallPanels.CadPrice.ToString("N2");

                        priceUSArray[i] = new TextBox();
                        priceUSArray[i].ID = "tblWallPanelsPriceUSTextBox" + i.ToString();
                        priceUSArray[i].CssClass = "txtInputField";
                        priceUSArray[i].Height = TEXTBOX_HEIGHT;
                        priceUSArray[i].Width = TEXTBOX_WIDTH;

                        priceCanArray[i] = new TextBox();
                        priceCanArray[i].ID = "tblWallPanelsPriceCanTextBox" + i.ToString();
                        priceCanArray[i].CssClass = "txtInputField";
                        priceCanArray[i].Height = TEXTBOX_HEIGHT;
                        priceCanArray[i].Width = TEXTBOX_WIDTH;

                        previewUSArray[i] = new TextBox();
                        previewUSArray[i].ID = "tblWallPanelsPreviewUSLabel" + i.ToString();
                        previewUSArray[i].CssClass = "txtInputField";
                        previewUSArray[i].Height = TEXTBOX_HEIGHT;
                        previewUSArray[i].Width = TEXTBOX_WIDTH;

                        previewCanArray[i] = new TextBox();
                        previewCanArray[i].ID = "tblWallPanelsPreviewCanLabel" + i.ToString();
                        previewCanArray[i].CssClass = "txtInputField";
                        previewCanArray[i].Height = TEXTBOX_HEIGHT;
                        previewCanArray[i].Width = TEXTBOX_WIDTH;

                        elementCounter++;
                    }
                    pastTablesTotal += tblWallPanels.Count;
                    #endregion
                }
                #endregion

                #region generateRows

                //create table row and cells for adding record to the page
                TableRow tempRow;
                TableCell checkboxArrayCell;
                TableCell partNumArrayCell;
                TableCell partNameArrayCell;
                TableCell currentUSArrayCell;
                TableCell currentCanArrayCell;
                TableCell priceUSArrayCell;
                TableCell priceCanArrayCell;
                TableCell previewUSArrayCell;
                TableCell previewCanArrayCell;

                for (int i = 0; i < totalElements; i++) //hard coded 501 until Sunrail300 fixed CHANGETHISCODE
                {
                    tempRow = new TableRow(); //create a new row

                    //add each control by creating a new cell for the row, and adding to it.
                    checkboxArrayCell = new TableCell();
                    checkboxArrayCell.Controls.Add(checkboxArray[i]);
                    tempRow.Cells.Add(checkboxArrayCell);

                    partNumArrayCell = new TableCell();
                    partNumArrayCell.Controls.Add(partNumArray[i]);
                    tempRow.Cells.Add(partNumArrayCell);

                    partNameArrayCell = new TableCell();
                    partNameArrayCell.Controls.Add(partNameArray[i]);
                    tempRow.Cells.Add(partNameArrayCell);

                    currentUSArrayCell = new TableCell();
                    currentUSArrayCell.CssClass = "align-center";
                    currentUSArrayCell.Controls.Add(currentUSArray[i]);
                    tempRow.Cells.Add(currentUSArrayCell);

                    currentCanArrayCell = new TableCell();
                    currentCanArrayCell.CssClass = "align-center";
                    currentCanArrayCell.Controls.Add(currentCanArray[i]);
                    tempRow.Cells.Add(currentCanArrayCell);

                    priceUSArrayCell = new TableCell();
                    priceUSArrayCell.Controls.Add(priceUSArray[i]);
                    tempRow.CssClass = "tdTxtInputUS";
                    tempRow.Cells.Add(priceUSArrayCell);

                    priceCanArrayCell = new TableCell();
                    priceCanArrayCell.Controls.Add(priceCanArray[i]);
                    tempRow.CssClass = "tdTxtInputCAN";
                    tempRow.Cells.Add(priceCanArrayCell);

                    previewUSArrayCell = new TableCell();
                    previewUSArrayCell.Controls.Add(previewUSArray[i]);
                    tempRow.CssClass = "tdTxtInputUS";
                    tempRow.Cells.Add(previewUSArrayCell);

                    previewCanArrayCell = new TableCell();
                    previewCanArrayCell.Controls.Add(previewCanArray[i]);
                    tempRow.CssClass = "tdTxtInputCAN";
                    tempRow.Cells.Add(previewCanArrayCell);

                    tblPriceGrid.Controls.Add(tempRow);
                }
                #endregion

            for (int i = 0; i < totalElements; i++) //fill the 'last' arrays, which are used in checking for changes.  Blank for first time
            {
                lastAdjustedUS[i] = priceUSArray[i].Text;
                lastAdjustedCan[i] = priceCanArray[i].Text;
                lastCalculatedUS[i] = previewUSArray[i].Text;
                lastCalculatedCan[i] = previewCanArray[i].Text;
            }
        }
Beispiel #39
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(rollID,partName,partNumber,color,width,widthUnits,weight,weightUnits,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + VinylRollName + "','" + PartNumber + "','" + VinylRollColor + "'," + VinylRollWidth + ",'" + VinylRollWidthUnits + "',"
            + VinylRollWeight + ",'" + VinylRollWeightUnits + "',"
            + UsdPrice + "," + CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #40
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label firstLabel = (Label)Master.FindControl("lblUpdate");
            if (firstLabel != null)
            {
                firstLabel.Text = "UPDATE";
            }

            Label secondLabel = (Label)Master.FindControl("lblPartNumTitle");
            if (secondLabel != null)
            {
                secondLabel.Text = Session["partNumber"].ToString();
            }
            if (!Page.IsPostBack)
            {
                //prevent backdoor
                if (Session["tableName"] == null)
                {
                    Response.Redirect("ProductSelect.aspx");
                }
                else
                {
                    //load dropdowns
                    if (!Page.IsPostBack)
                    {
                        //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"; 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("updateChanged", "true");
                        }
                    }

                    //only run if the display has changed, to allow display postback changes
                    if (Session["updateChanged"] != null)
                    {
                        //we're running this, so the display has been updated, and is not set for change
                        Session.Remove("updateChanged");
                        //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";
                        }

                        //Clear updated object in session
                        if (Session["updatedObject"] != null)
                        {
                            Session.Remove("updatedObject");
                        }

                        //get table selected from session
                        string tableName = Session["tableName"].ToString();
                        #region Display Pricing Only
                        if (Session["pricingOnly"] != null)
                        {
                            lblPartKey.CssClass = "removeElement";
                            pnlPackQuantity.CssClass = "removeElement";
                            pnlComposition.CssClass = "removeElement";
                            pnlStandard.CssClass = "removeElement";
                            pnlDimensions.CssClass = "removeElement";
                            pnlStatus.CssClass = "removeElement";
                            btnUploadImg.CssClass = "removeElement";
                            txtPartDesc.CssClass = "txtInputFieldDisabled";
                            pnlSchematics.CssClass = "removeElement";
                            pnlPricingSchematics.CssClass = "removeElement";
                            //Switch statement for displaying according to selected product

                            switch (tableName)
                            {
                                #region RoofExtrusion
                                //When Roof Extrusions is selected
                                case "tblRoofExtrusions":
                                    {
                                        //create RoofExtrusion object
                                        RoofExtrusion aRoofExtrusion = new RoofExtrusion();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aRoofExtrusion.ExtrusionName;
                                        txtPartDesc.Text = aRoofExtrusion.ExtrusionDescription;
                                        lblPartNum.Text = aRoofExtrusion.ExtrusionNumber;
                                        lblColorInput.Text = aRoofExtrusion.ExtrusionColor;
                                        txtUsdPrice.Text = aRoofExtrusion.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aRoofExtrusion.CadPrice.ToString("N2");

                                        break;
                                    }
                                #endregion
                                #region Accessories
                                //When Accessories is selected
                                case "tblAccessories":
                                    {
                                        //create Accessories object
                                        Accessories anAccessory = new Accessories();

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

                                        //add Accessories Object to the session
                                        Session.Add("accessories", anAccessory);

                                        //populate fields
                                        lblPartName.Text = anAccessory.AccessoryName;
                                        txtPartDesc.Text = anAccessory.AccessoryDescription;
                                        lblPartNum.Text = anAccessory.AccessoryNumber;
                                        txtUsdPrice.Text = anAccessory.AccessoryUsdPrice.ToString("N2");
                                        txtCadPrice.Text = anAccessory.AccessoryCadPrice.ToString("N2");
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";

                                        if (anAccessory.AccessoryColor != "")
                                        {
                                            lblColorInput.Text = anAccessory.AccessoryColor;
                                        }
                                        else
                                        {
                                            lblColorInput.CssClass = "removeElement";
                                            lblColor.CssClass = "removeElement";
                                        }

                                        break;
                                    }
                                #endregion

                                #region DecorativeColumn
                                //When Decorative Column is selected
                                case "tblDecorativeColumn":
                                    {
                                        //create DecorativeColumn object
                                        DecorativeColumn aColumn = new DecorativeColumn();

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

                                        //add DecorativeColumn Object to the session
                                        Session.Add("decorativeColumn", aColumn);

                                        //populate fields
                                        lblPartName.Text = aColumn.ColumnName;
                                        txtPartDesc.Text = aColumn.ColumnDescription;
                                        lblPartNum.Text = aColumn.PartNumber;
                                        lblColorInput.Text = aColumn.ColumnColor;
                                        txtUsdPrice.Text = aColumn.ColumnUsdPrice.ToString("N2");
                                        txtCadPrice.Text = aColumn.ColumnCadPrice.ToString("N2");
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";

                                        break;
                                    }
                                #endregion

                                #region DoorFrameExtrusion
                                //When Door Frame Extrusion is selected
                                case "tblDoorFrameExtrusion":
                                    {
                                        //create DoorFrameExtrusion object
                                        DoorFrameExtrusion aFrameExtrusion = new DoorFrameExtrusion();

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

                                        //populate fields

                                        lblPartName.Text = aFrameExtrusion.DfeName;
                                        txtPartDesc.Text = aFrameExtrusion.DfeDescription;
                                        lblPartNum.Text = aFrameExtrusion.PartNumber;
                                        lblColorInput.Text = aFrameExtrusion.DfeColor;
                                        txtUsdPrice.Text = aFrameExtrusion.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aFrameExtrusion.CadPrice.ToString("N2");
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";

                                        break;
                                    }
                                #endregion

                                #region InsulatedFloors
                                //When Insulated Floors is selected
                                case "tblInsulatedFloors":
                                    {
                                        lblColor.CssClass = "removeElement";
                                        lblColorInput.CssClass = "removeElement";

                                        //create InsulatedFloors object
                                        InsulatedFloors aFloor = new InsulatedFloors();

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

                                        //populate fields
                                        lblPartName.Text = aFloor.InsulatedFloorName;
                                        txtPartDesc.Text = aFloor.InsulatedFloorDescription;
                                        lblPartNum.Text = aFloor.PartNumber;
                                        txtUsdPrice.Text = aFloor.InsulatedFloorUsdPrice.ToString("N2");
                                        txtCadPrice.Text = aFloor.InsulatedFloorCadPrice.ToString("N2");
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";

                                        break;
                                    }
                                #endregion

                                #region RoofPanels
                                //When Roof Panels is selected
                                case "tblRoofPanels":
                                    {
                                        //create RoofPanels object
                                        RoofPanels aPanel = new RoofPanels();

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

                                        //populate fields
                                        lblPartName.Text = aPanel.PanelName;
                                        txtPartDesc.Text = aPanel.PanelDescription;
                                        lblPartNum.Text = aPanel.PartNumber;
                                        lblColorInput.Text = aPanel.PanelColor;

                                        txtUsdPrice.Text = aPanel.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aPanel.CadPrice.ToString("N2");
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";

                                        break;
                                    }
                                #endregion

                                #region ScreenRoll
                                //When Screen Roll is selected
                                case "tblScreenRoll":
                                    {
                                        lblColor.CssClass = "removeElement";
                                        lblColorInput.CssClass = "removeElement";

                                        //create ScreenRoll object
                                        ScreenRoll aScreenRoll = new ScreenRoll();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aScreenRoll.ScreenRollName;
                                        lblPartNum.Text = aScreenRoll.PartNumber;

                                        txtUsdPrice.Text = aScreenRoll.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aScreenRoll.CadPrice.ToString("N2");
                                        break;
                                    }
                                #endregion

                                #region SuncrylicRoof
                                //When Suncrylic roof is selected
                                case "tblSuncrylicRoof":
                                    {
                                        //create ScreenRoll object
                                        SuncrylicRoof aSunRoof = new SuncrylicRoof();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunRoof.SuncrylicName;
                                        lblPartNum.Text = aSunRoof.PartNumber;

                                        txtUsdPrice.Text = aSunRoof.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aSunRoof.CadPrice.ToString("N2");
                                        break;
                                    }
                                #endregion

                                #region VinylRoll
                                //When Vinyl Roll is selected
                                case "tblVinylRoll":
                                    {
                                        //create ScreenRoll object
                                        VinylRoll aVinylRoll = new VinylRoll();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aVinylRoll.VinylRollName;
                                        lblPartNum.Text = aVinylRoll.PartNumber;
                                        lblColorInput.Text = aVinylRoll.VinylRollColor;
                                        txtUsdPrice.Text = aVinylRoll.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aVinylRoll.CadPrice.ToString("N2");

                                        break;
                                    }
                                #endregion

                                #region Sunrail300
                                //When Sunrail 300 is selected
                                case "tblSunrail300":
                                    {
                                        //create Sunrail300 object
                                        Sunrail300 aSunrail300 = new Sunrail300();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail300.Sunrail300Name;
                                        lblPartNum.Text = aSunrail300.PartNumber;
                                        lblColorInput.Text = aSunrail300.Sunrail300Color;
                                        txtUsdPrice.Text = aSunrail300.Sunrail300UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aSunrail300.Sunrail300CadPrice.ToString("N2");

                                        break;
                                    }
                                #endregion

                                #region Sunrail300Accessories
                                //When Sunrail 300 Accessories is selected
                                case "tblSunrail300Accessories":
                                    {
                                        //create Sunrail300Accessories object
                                        Sunrail300Accessories aSunrail300Accessories = new Sunrail300Accessories();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail300Accessories.Sunrail300AccessoriesName;
                                        lblPartNum.Text = aSunrail300Accessories.PartNumber;
                                        lblColorInput.Text = aSunrail300Accessories.Sunrail300AccessoriesColor;
                                        txtUsdPrice.Text = aSunrail300Accessories.Sunrail300AccessoriesUsdPrice.ToString("N2");
                                        txtCadPrice.Text = aSunrail300Accessories.Sunrail300AccessoriesCadPrice.ToString("N2");

                                        break;
                                    }
                                #endregion

                                #region Sunrail400
                                //When Sunrail 400 is selected
                                case "tblSunrail400":
                                    {
                                        //create Sunrail400 object
                                        Sunrail400 aSunrail400 = new Sunrail400();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail400.Sunrail400Name;
                                        lblPartNum.Text = aSunrail400.PartNumber;
                                        lblColorInput.Text = aSunrail400.Sunrail400Color;
                                        txtUsdPrice.Text = aSunrail400.Sunrail400UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aSunrail400.Sunrail400CadPrice.ToString("N2");
                                        break;
                                    }
                                #endregion

                                #region Sunrail1000
                                //When Sunrail 1000 is selected
                                case "tblSunrail1000":
                                    {
                                        //create Sunrail1000 object
                                        Sunrail1000 aSunrail1000 = new Sunrail1000();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail1000.Sunrail1000Name;
                                        lblPartNum.Text = aSunrail1000.PartNumber;
                                        lblColorInput.Text = aSunrail1000.Sunrail1000Color;
                                        txtUsdPrice.Text = aSunrail1000.Sunrail1000UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aSunrail1000.Sunrail1000CadPrice.ToString("N2");
                                        break;
                                    }
                                #endregion

                                #region WallExtrusions
                                case "tblWallExtrusions":
                                    {
                                        //create Sunrail1000 object
                                        WallExtrusions aWallExtrusion = new WallExtrusions();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aWallExtrusion.WallExtrusionName;
                                        lblPartNum.Text = aWallExtrusion.PartNumber;
                                        lblColorInput.Text = aWallExtrusion.WallExtrusionColor;
                                        txtUsdPrice.Text = aWallExtrusion.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aWallExtrusion.CadPrice.ToString("N2");
                                        break;
                                    }
                                #endregion

                                #region WallPanels
                                case "tblWallPanels":
                                    {
                                        //create Sunrail1000 object
                                        WallPanels aWallPanel = new WallPanels();

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aWallPanel.WallPanelName;
                                        lblPartNum.Text = aWallPanel.WallPanelNumber;
                                        lblColorInput.Text = aWallPanel.WallPanelColor;
                                        txtUsdPrice.Text = aWallPanel.UsdPrice.ToString("N2");
                                        txtCadPrice.Text = aWallPanel.CadPrice.ToString("N2");
                                        break;
                                    }
                                #endregion

                                #region Schematics
                                case "tblSchematics":
                                    {
                                        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";

                                        lblSchemPartNum.CssClass = "removeElement";
                                        lblSchemPartKey.CssClass = "removeElement";
                                        lblSchemPartKeyNum.CssClass = "removeElement";
                                        lblSchemPartName.CssClass = "removeElement";

                                        lblColor.CssClass = "removeElement";
                                        lblColorInput.CssClass = "removeElement";
                                        pnlDimensions.CssClass = "removeElement";
                                        pnlPricing.CssClass = "removeElement";

                                        //show pnlSchematics and pricingSchemTable
                                        pnlSchematics.CssClass = "showElementNoClass";
                                        pnlPricingSchematics.CssClass = "pnlPricing";

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

                                        //create Schematics object
                                        Schematics aSchematic = new Schematics();

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

                                        //add RoofPanels Object to the session
                                        Session.Add("schematic", aSchematic);

                                        //populate fields

                                        //set up a dataview object for object member data
                                        System.Data.DataView aPartsTable = new System.Data.DataView();

                                        //select row based on table name and part number
                                        datUpdateDataSource.SelectCommand = "SELECT partNumber FROM tblSchematicParts WHERE schematicNumber='" + Session["partNumber"] + "' ORDER BY keyNumber ASC";

                                        //assign the row to the dataview object
                                        aPartsTable = (System.Data.DataView)datUpdateDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

                                        ddlSchem.Items.Clear();
                                        ddlSchem.Items.Add("");

                                        for (int i = 0; i < aPartsTable.Count; i++)
                                        {
                                            ddlSchem.Items.Add(aPartsTable[i][0].ToString());
                                        }

                                        lblPartName.Text = aSchematic.SchematicName.ToString();
                                        txtPartDesc.Text = aSchematic.SchematicDescription.ToString();
                                        lblPartNum.Text = aSchematic.SchematicNumber.ToString();

                                        txtUsdPriceSchematic.Text = aSchematic.SchematicUsdPrice.ToString("N2");
                                        txtCadPriceSchematic.Text = aSchematic.SchematicCadPrice.ToString("N2");

                                        rfvSchemWholeUsd.ValidationGroup = "pricing";
                                        cmpSchemWholeUsd.ValidationGroup = "pricing";
                                        rfvSchemWholeCad.ValidationGroup = "pricing";
                                        cmpSchemWholeCad.ValidationGroup = "pricing";

                                        break;
                                    }
                                #endregion
                            }
                        }
                        #endregion
                        else
                        #region Display Pricing and Product Info
                        {
                            //Hide selected 'product' panels
                            lblPartKey.CssClass = "removeElement";
                            pnlPackQuantity.CssClass = "removeElement";
                            pnlComposition.CssClass = "removeElement";
                            pnlStandard.CssClass = "removeElement";
                            txtPartDesc.CssClass = "txtInputFieldDesc";
                            //Hide all 'dimension' panels
                            pnlAccessories.CssClass = "removeElement";
                            pnlDecorativeColumn.CssClass = "removeElement";
                            pnlDoorFrameExtrusions.CssClass = "removeElement";
                            pnlInsulatedFloors.CssClass = "removeElement";
                            pnlRoofExtrusions.CssClass = "removeElement";
                            pnlRoofPanels.CssClass = "removeElement";
                            pnlSchematics.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";
                            pnlPricingSchematics.CssClass = "removeElement";
                            //Switch statement for displaying according to selected product
                            switch (tableName)
                            {
                                #region RoofExtrusions
                                //when tblRoofExtrusions is selected
                                case "tblRoofExtrusions":

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

                                    //show pnlRoofExtrusion
                                    pnlRoofExtrusions.CssClass = "dimensionsTable";

                                    //create RoofExtrusion object
                                    RoofExtrusion aRoofExtrusion = new RoofExtrusion();

                                    //add RoofExtrusion Object to the session
                                    Session.Add("roofExtrusion", aRoofExtrusion);

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

                                    //populate fields
                                    imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";

                                    lblPartName.Text = aRoofExtrusion.ExtrusionName;
                                    txtPartDesc.Text = aRoofExtrusion.ExtrusionDescription;
                                    lblPartNum.Text = aRoofExtrusion.ExtrusionNumber;
                                    lblColorInput.Text = aRoofExtrusion.ExtrusionColor;

                                    //conditional field display, based on whether members have default values or not
                                    if (aRoofExtrusion.ExtrusionSize != 0)
                                    {
                                        lblRoofExtSizeUnits.Text = aRoofExtrusion.SizeUnits.ToString();
                                        txtRoofExtSize.Text = aRoofExtrusion.ExtrusionSize.ToString();
                                        rfvRoofExtSize.ValidationGroup = "roofExtrusion";
                                        cmpRoofExtSize.ValidationGroup = "roofExtrusion";
                                    }
                                    else
                                    {
                                        rowRoofExtSize.CssClass = "removeElement";
                                    }

                                    if (aRoofExtrusion.AngleA != 0)
                                    {
                                        lblRoofExtAngleAUnits.Text = aRoofExtrusion.AngleAUnits.ToString();
                                        txtRoofExtAngleA.Text = aRoofExtrusion.AngleA.ToString();
                                        rfvRoofExtAngleA.ValidationGroup = "roofExtrusion";
                                        cmpRoofExtAngleA.ValidationGroup = "roofExtrusion";
                                    }
                                    else
                                    {
                                        rowRoofExtAngleA.CssClass = "removeElement";
                                    }

                                    if (aRoofExtrusion.AngleB != 0)
                                    {
                                        lblRoofExtAngleBUnits.Text = aRoofExtrusion.AngleBUnits.ToString();
                                        txtRoofExtAngleB.Text = aRoofExtrusion.AngleB.ToString();
                                        rfvRoofExtAngleB.ValidationGroup = "roofExtrusion";
                                        cmpRoofExtAngleB.ValidationGroup = "roofextrusion";
                                    }
                                    else
                                    {
                                        rowRoofExtAngleB.CssClass = "removeElement";
                                    }

                                    if (aRoofExtrusion.AngleC != 0)
                                    {
                                        lblRoofExtAngleCUnits.Text = aRoofExtrusion.AngleCUnits.ToString();
                                        txtRoofExtAngleC.Text = aRoofExtrusion.AngleC.ToString();
                                        rfvRoofExtAngleC.ValidationGroup = "roofExtrusion";
                                        cmpRoofExtAngleC.ValidationGroup = "roofExtrusion";
                                    }
                                    else
                                    {
                                        rowRoofExtAngleC.CssClass = "removeElement";
                                    }

                                    txtRoofExtMaxLength.Text = aRoofExtrusion.ExtrusionMaxLength.ToString();
                                    lblRoofExtMaxLengthUnits.Text = aRoofExtrusion.MaxLengthUnits.ToString();
                                    rfvRoofExtMaxLength.ValidationGroup = "roofExtrusion";
                                    cmpRoofExtMaxLength.ValidationGroup = "roofExtrusion";

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

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

                                    break;
                                #endregion
                                #region Accessories
                                //when tblAccessories is selected
                                case "tblAccessories":

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

                                    //show pnlAccessories
                                    pnlPackQuantity.CssClass = "showPanelNoClass";
                                    pnlAccessories.CssClass = "dimensionsTable";

                                    //create Accessories object
                                    Accessories anAccessory = new Accessories();

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

                                    //add Accessories Object to the session
                                    Session.Add("accessories", anAccessory);

                                    //populate fields
                                    imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                    lblPartName.Text = anAccessory.AccessoryName;
                                    txtPartDesc.Text = anAccessory.AccessoryDescription;
                                    lblPartNum.Text = anAccessory.AccessoryNumber;

                                    //conditional field display, based on whether members have default values or not
                                    if (anAccessory.AccessoryColor != "")
                                    {
                                        lblColorInput.Text = anAccessory.AccessoryColor;
                                    }
                                    else
                                    {
                                        lblColorInput.CssClass = "removeElement";
                                        lblColor.CssClass = "removeElement";
                                    }

                                    if (anAccessory.AccessoryPackQuantity != 0)
                                    {
                                        txtPackQuantity.Text = anAccessory.AccessoryPackQuantity.ToString();
                                        rfvPackQuantity.ValidationGroup = "accessories";
                                        cmpPackQuantity.ValidationGroup = "accessories";
                                    }
                                    else
                                    {
                                        pnlPackQuantity.CssClass = "removeElement";
                                    }

                                    if (anAccessory.AccessoryWidth != 0)
                                    {
                                        lblAccessoryWidthUnits.Text = anAccessory.AccessoryWidthUnits;
                                        txtAccessoryWidth.Text = anAccessory.AccessoryWidth.ToString();
                                        rfvAccessoryWidth.ValidationGroup = "accessories";
                                        cmpAccessoryWidth.ValidationGroup = "accessories";
                                    }
                                    else
                                    {
                                        rowAccessoryMaxWidth.CssClass = "removeElement";
                                    }

                                    if (anAccessory.AccessoryLength != 0)
                                    {
                                        lblAccessoryLengthUnits.Text = anAccessory.AccessoryLengthUnits;
                                        txtAccessoryLength.Text = anAccessory.AccessoryLength.ToString();
                                        rfvAccessoryLength.ValidationGroup = "accessories";
                                        cmpAccessoryLength.ValidationGroup = "accessories";
                                    }
                                    else
                                    {
                                        rowAccessoryMaxLength.CssClass = "removeElement";
                                    }

                                    if (anAccessory.AccessorySize != 0)
                                    {
                                        lblAccessorySizeUnits.Text = anAccessory.AccessorySizeUnits;
                                        txtAccessorySize.Text = anAccessory.AccessorySize.ToString();
                                        rfvAccessorySize.ValidationGroup = "accessories";
                                        cmpAccessorySize.ValidationGroup = "accessories";
                                    }
                                    else
                                    {
                                        rowAccessorySize.CssClass = "removeElement";
                                    }

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

                                    if ((txtAccessoryLength.Text == "") && (txtAccessorySize.Text == "") && (txtAccessoryWidth.Text == ""))
                                    {
                                        pnlDimensions.CssClass = "removeElement";
                                    }

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

                                    break;
                                #endregion
                                #region DecorativeColumn
                                //when tblDecorativeColumn is selected
                                case "tblDecorativeColumn":

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

                                    //show pnlDecorativeColumn
                                    pnlDecorativeColumn.CssClass = "dimensionsTable";

                                    //create DecorativeColumn object
                                    DecorativeColumn aColumn = new DecorativeColumn();

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

                                    //add DecorativeColumn Object to the session
                                    Session.Add("decorativeColumn", aColumn);

                                    //populate fields
                                    imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                    lblPartName.Text = aColumn.ColumnName;
                                    txtPartDesc.Text = aColumn.ColumnDescription;
                                    lblPartNum.Text = aColumn.PartNumber;
                                    lblColorInput.Text = aColumn.ColumnColor;
                                    txtRoofDecColLength.Text = aColumn.ColumnLength.ToString();
                                    lblRoofDecColLengthUnits.Text = aColumn.ColumnLengthUnits;

                                    rfvRoofDecColLength.ValidationGroup = "decorativeColumn";
                                    cmpRoofDecColLength.ValidationGroup = "decorativeColumn";

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

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

                                    break;
                                #endregion
                                #region DoorFrameExtrusion
                                //when tblDoorFrameExtrusion is selected
                                case "tblDoorFrameExtrusion":

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

                                    //show pnlDoorFrameExtrusions
                                    pnlDoorFrameExtrusions.CssClass = "dimensionsTable";

                                    //create DoorFrameExtrusion object
                                    DoorFrameExtrusion aFrameExtrusion = new DoorFrameExtrusion();

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

                                    //add DoorFrameExtrusion Object to the session
                                    Session.Add("doorFrameExtrusion", aFrameExtrusion);

                                    //populate fields
                                    imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                    txtDoorFrExtMaxLength.Text = aFrameExtrusion.DfeMaxLength.ToString();
                                    lblDoorFrExtMaxLengthUnits.Text = aFrameExtrusion.DfeMaxLengthUnits.ToString();

                                    rfvDoorFrExtMaxLength.ValidationGroup = "doorFrameExtrusion";
                                    cmpDoorFrExtMaxLength.ValidationGroup = "doorFrameExtrusion";

                                    lblPartName.Text = aFrameExtrusion.DfeName;
                                    txtPartDesc.Text = aFrameExtrusion.DfeDescription;
                                    lblPartNum.Text = aFrameExtrusion.PartNumber;
                                    lblColorInput.Text = aFrameExtrusion.DfeColor;

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

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

                                    break;
                                #endregion
                                #region InsulatedFloors
                                //when tblInsulatedFloors is selected
                                case "tblInsulatedFloors":

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

                                    //show pnlInsulatedFloors and pnlComposition
                                    pnlInsulatedFloors.CssClass = "dimensionsTable";
                                    pnlComposition.CssClass = "showPanelNoClass";
                                    lblColor.CssClass = "removeElement";
                                    lblColorInput.CssClass = "removeElement";

                                    //create InsulatedFloors object
                                    InsulatedFloors aFloor = new InsulatedFloors();

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

                                    //add InsulatedFloors Object to the session
                                    Session.Add("insulatedFloors", aFloor);

                                    //populate fields
                                    imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                    lblPartName.Text = aFloor.InsulatedFloorName;
                                    txtPartDesc.Text = aFloor.InsulatedFloorDescription;
                                    lblPartNum.Text = aFloor.PartNumber;
                                    txtComposition.Text = aFloor.InsulatedFloorComposition;
                                    txtInsFloorSize.Text = aFloor.InsulatedFloorSize.ToString();
                                    lblInsFloorSizeUnits.Text = aFloor.InsulatedFloorSizeUnits;
                                    txtInsFloorPnlMaxWidth.Text = aFloor.InsulatedFloorMaxWidth.ToString();
                                    lblInsFloorPnlMaxWidthUnits.Text = aFloor.InsulatedFloorMaxWidthUnits;

                                    rfvInsFloorSize.ValidationGroup = "insulatedFloors";
                                    cmpInsFloorSize.ValidationGroup = "insulatedFloors";
                                    rfvInsFloorPnlMaxWidth.ValidationGroup = "insulatedFloors";
                                    cmpInsFloorPnlMaxWidth.ValidationGroup = "insulatedFloors";

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

                                    if (aFloor.InsulatedFloorStatus)
                                    {
                                        radActive.Checked = true;
                                    }
                                    else
                                    {
                                        radInactive.Checked = true;
                                    }
                                    break;
                                #endregion
                                #region RoofPanels
                                //when tblRoofPanels is selected
                                case "tblRoofPanels":

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

                                    //show pnlRoofPanels and pnlStandard
                                    pnlStandard.CssClass = "showPanelNoClass";
                                    pnlComposition.CssClass = "showPanelNoClass";
                                    pnlRoofPanels.CssClass = "dimensionsTable";
                                    rowRoofPanelsMaxLength.CssClass = "removeElement";

                                    //create RoofPanels object
                                    RoofPanels aPanel = new RoofPanels();

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

                                    //add RoofPanels Object to the session
                                    Session.Add("roofPanels", aPanel);

                                    //populate fields
                                    imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                    lblPartName.Text = aPanel.PanelName;
                                    txtPartDesc.Text = aPanel.PanelDescription;
                                    txtStandard.Text = aPanel.PanelStandard;
                                    txtComposition.Text = aPanel.PanelComposition;
                                    lblPartNum.Text = aPanel.PartNumber;
                                    lblColorInput.Text = aPanel.PanelColor;

                                    txtRoofPnlMaxWidth.Text = aPanel.PanelMaxWidth.ToString();
                                    lblRoofPnlMaxWidthUnits.Text = aPanel.MaxWidthUnits;

                                    rfvRoofPnlMaxWidth.ValidationGroup = "roofPanels";
                                    cmpRoofPnlMaxWidth.ValidationGroup = "roofPanels";
                                    rfvRoofPnlSize.ValidationGroup = "roofPanels";
                                    cmpRoofPnlSize.ValidationGroup = "roofPanels";

                                    txtRoofPnlSize.Text = aPanel.PanelSize.ToString();
                                    lblRoofPnlSizeUnits.Text = aPanel.PanelSizeUnits;

                                    if (aPanel.PanelMaxLength != "Site Determined")
                                    {
                                        rowRoofPanelsMaxLengthStr.CssClass = "removeElement";
                                        rowRoofPanelsMaxLength.CssClass = "showElementNoClass";
                                        rfvRoofPnlMaxLength.ValidationGroup = "roofPanels";
                                        cmpRoofPnlMaxLength.ValidationGroup = "roofPanels";
                                    }

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

                                    if (aPanel.Status)
                                    {
                                        radActive.Checked = true;
                                    }
                                    else
                                    {
                                        radInactive.Checked = true;
                                    }
                                    break;
                                #endregion
                                #region ScreenRoll
                                case "tblScreenRoll":
                                    {
                                        if (Session["screenRoll"] != null)
                                        {
                                            Session.Remove("screenRoll");
                                        }
                                        pnlScreenRoll.CssClass = "dimensionsTable";
                                        lblColor.CssClass = "removeElement";
                                        lblColorInput.CssClass = "removeElement";

                                        //create ScreenRoll object
                                        ScreenRoll aScreenRoll = new ScreenRoll();

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

                                        //add RoofPanels Object to the session
                                        Session.Add("screenRoll", aScreenRoll);

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aScreenRoll.ScreenRollName;
                                        lblPartNum.Text = aScreenRoll.PartNumber;
                                        txtScreenRollWidth.Text = aScreenRoll.ScreenRollWidth.ToString();
                                        lblScreenRollWidthUnits.Text = aScreenRoll.ScreenRollWidthUnits.ToString();
                                        txtScreenRollLength.Text = aScreenRoll.ScreenRollLength.ToString();
                                        lblScreenRollLengthUnits.Text = aScreenRoll.ScreenRollLengthUnits.ToString();

                                        rfvScreenRollWidth.ValidationGroup = "screenRoll";
                                        cmpScreenRollWidth.ValidationGroup = "screenRoll";

                                        rfvScreenRollLength.ValidationGroup = "screenRoll";
                                        cmpScreenRollLength.ValidationGroup = "screenRoll";

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

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

                                        break;
                                    }
                                #endregion
                                #region SuncrylicRoof
                                case "tblSuncrylicRoof":
                                    {
                                        if (Session["suncrylicRoof"] != null)
                                        {
                                            Session.Remove("suncrylicRoof");
                                        }

                                        //show pnlRoofExtrusion
                                        pnlSuncrylicRoof.CssClass = "dimensionsTable";

                                        //create RoofExtrusion object
                                        SuncrylicRoof aSunRoof = new SuncrylicRoof();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("suncrylicRoof", aSunRoof);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunRoof.SuncrylicName;
                                        txtPartDesc.Text = aSunRoof.SuncrylicDescription;
                                        lblPartNum.Text = aSunRoof.PartNumber;
                                        lblColorInput.Text = aSunRoof.SuncrylicColor;

                                        rowSunRoofMaxWidthStr.CssClass = "removeElement";

                                        if (aSunRoof.SuncrylicMaxLength != 0)
                                        {
                                            rowSunRoofMaxLengthStr.CssClass = "removeElement";
                                            rowSunRoofMaxLength.CssClass = "showElementNoClass";
                                            txtSunRoofMaxLength.Text = aSunRoof.SuncrylicMaxLength.ToString();
                                            lblSunRoofMaxLengthUnits.Text = aSunRoof.SuncrylicLengthUnits;
                                            rfvSunRoofMaxLength.ValidationGroup = "suncrylicRoof";
                                            cmpSunRoofMaxLength.ValidationGroup = "suncrylicRoof";
                                        }

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

                                        if (aSunRoof.Status)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region VinylRoll
                                case "tblVinylRoll":
                                    {
                                        if (Session["vinylRoll"] != null)
                                        {
                                            Session.Remove("vinylRoll");
                                        }

                                        pnlDescription.CssClass = "removeElement";
                                        //show pnlRoofExtrusion
                                        pnlVinylRoll.CssClass = "dimensionsTable";

                                        //create RoofExtrusion object
                                        VinylRoll aVinylRoll = new VinylRoll();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("vinylRoll", aVinylRoll);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aVinylRoll.VinylRollName;
                                        lblPartNum.Text = aVinylRoll.PartNumber;
                                        lblColorInput.Text = aVinylRoll.VinylRollColor;

                                        rowVinylRollLength.CssClass = "removeElement";

                                        txtVinylRollWeight.Text = aVinylRoll.VinylRollWeight.ToString();
                                        lblVinylRollWeightUnits.Text = aVinylRoll.VinylRollWeightUnits;
                                        txtVinylRollWidth.Text = aVinylRoll.VinylRollWidth.ToString();
                                        lblVinylRollWidthUnits.Text = aVinylRoll.VinylRollWidthUnits;

                                        rfvVinylRollWidth.ValidationGroup = "vinylRoll";
                                        cmpVinylRollWidth.ValidationGroup = "vinylRoll";
                                        rfvVinylRollWeight.ValidationGroup = "vinylRoll";
                                        cmpVinylRollWeight.ValidationGroup = "vinylRoll";

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

                                        if (aVinylRoll.Status)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region Sunrail300
                                case "tblSunrail300":
                                    {
                                        if (Session["sunrail300"] != null)
                                        {
                                            Session.Remove("sunrail300");
                                        }

                                        //show pnlRoofExtrusion
                                        pnlSunrail300.CssClass = "dimensionsTable";

                                        //create RoofExtrusion object
                                        Sunrail300 aSunrail300 = new Sunrail300();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("sunrail300", aSunrail300);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail300.Sunrail300Name;
                                        txtPartDesc.Text = aSunrail300.Sunrail300Description;
                                        lblPartNum.Text = aSunrail300.PartNumber;
                                        lblColorInput.Text = aSunrail300.Sunrail300Color;

                                        txtSun300MaxLengthFt.Text = aSunrail300.Sunrail300MaxLengthFeet.ToString();
                                        lblSun300MaxLengthFtUnits.Text = aSunrail300.Sunrail300MaxLengthFeetUnits;
                                        txtSun300PnlMaxLengthInch.Text = aSunrail300.Sunrail300MaxLengthInches.ToString();
                                        lblSun300PnlMaxLengthInchUnits.Text = aSunrail300.Sunrail300MaxLengthInchesUnits;

                                        rfvSun300MaxLengthFt.ValidationGroup = "sunrail300";
                                        cmpSun300MaxLengthFt.ValidationGroup = "sunrail300";
                                        cmpSun300PnlMaxLengthInch.ValidationGroup = "sunrail300";

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

                                        if (aSunrail300.Sunrail300Status)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region Sunrail300Accessories
                                case "tblSunrail300Accessories":
                                    {
                                        if (Session["sunrail300Acc"] != null)
                                        {
                                            Session.Remove("sunrail300Acc");
                                        }

                                        pnlDimensions.CssClass = "removeElement";

                                        //create RoofExtrusion object
                                        Sunrail300Accessories aSunrail300Acc = new Sunrail300Accessories();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("sunrail300Acc", aSunrail300Acc);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail300Acc.Sunrail300AccessoriesName;
                                        txtPartDesc.Text = aSunrail300Acc.Sunrail300AccessoriesDescription;
                                        lblPartNum.Text = aSunrail300Acc.PartNumber;
                                        lblColorInput.Text = aSunrail300Acc.Sunrail300AccessoriesColor;

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

                                        if (aSunrail300Acc.Sunrail300AccessoriesStatus)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region Sunrail400
                                case "tblSunrail400":
                                    {
                                        if (Session["sunrail400"] != null)
                                        {
                                            Session.Remove("sunrail400");
                                        }

                                        //show pnlRoofExtrusion
                                        pnlSunrail400.CssClass = "dimensionsTable";

                                        //create RoofExtrusion object
                                        Sunrail400 aSunrail400 = new Sunrail400();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("sunrail400", aSunrail400);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail400.Sunrail400Name;
                                        txtPartDesc.Text = aSunrail400.Sunrail400Description;
                                        lblPartNum.Text = aSunrail400.PartNumber;
                                        lblColorInput.Text = aSunrail400.Sunrail400Color;

                                        txtSun400MaxLengthFt.Text = aSunrail400.Sunrail400MaxLengthFeet.ToString();
                                        lblSun400MaxLengthFtUnits.Text = aSunrail400.Sunrail400MaxLengthFeetUnits;
                                        txtSun400PnlMaxLengthInch.Text = aSunrail400.Sunrail400MaxLengthInches.ToString();
                                        lblSun400PnlMaxLengthInchUnits.Text = aSunrail400.Sunrail400MaxLengthInchesUnits;

                                        rfvSun400MaxLengthFt.ValidationGroup = "sunrail400";
                                        cmpSun400MaxLengthFt.ValidationGroup = "sunrail400";
                                        cmpSun400PnlMaxLengthInch.ValidationGroup = "sunrail400";

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

                                        if (aSunrail400.Sunrail400Status)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region Sunrail1000
                                case "tblSunrail1000":
                                    {
                                        if (Session["sunrail1000"] != null)
                                        {
                                            Session.Remove("sunrail1000");
                                        }

                                        //show pnlRoofExtrusion
                                        pnlSunrail1000.CssClass = "dimensionsTable";

                                        //create RoofExtrusion object
                                        Sunrail1000 aSunrail1000 = new Sunrail1000();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("sunrail1000", aSunrail1000);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aSunrail1000.Sunrail1000Name;
                                        txtPartDesc.Text = aSunrail1000.Sunrail1000Description;
                                        lblPartNum.Text = aSunrail1000.PartNumber;
                                        lblColorInput.Text = aSunrail1000.Sunrail1000Color;

                                        txtSun1000MaxLengthFt.Text = aSunrail1000.Sunrail1000MaxLengthFeet.ToString();
                                        lblSun1000MaxLengthFtUnits.Text = aSunrail1000.Sunrail1000MaxLengthFeetUnits;
                                        txtSun1000PnlMaxLengthInch.Text = aSunrail1000.Sunrail1000MaxLengthInches.ToString();
                                        lblSun1000PnlMaxLengthInchUnits.Text = aSunrail1000.Sunrail1000MaxLengthInchesUnits;

                                        rfvSun1000MaxLengthFt.ValidationGroup = "sunrail1000";
                                        cmpSun1000MaxLengthFt.ValidationGroup = "sunrail1000";
                                        cmpSun1000PnlMaxLengthInch.ValidationGroup = "sunrail1000";

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

                                        if (aSunrail1000.Sunrail1000Status)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region WallExtrusions
                                case "tblWallExtrusions":
                                    {
                                        if (Session["wallExtrusions"] != null)
                                        {
                                            Session.Remove("wallExtrusions");
                                        }

                                        //show pnlRoofExtrusion
                                        pnlWallExtrusions.CssClass = "dimensionsTable";

                                        //create RoofExtrusion object
                                        WallExtrusions aWallExtrusion = new WallExtrusions();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("wallExtrusions", aWallExtrusion);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aWallExtrusion.WallExtrusionName;
                                        txtPartDesc.Text = aWallExtrusion.WallExtrusionDescription;
                                        lblPartNum.Text = aWallExtrusion.PartNumber;
                                        lblColorInput.Text = aWallExtrusion.WallExtrusionColor;

                                        txtWallExtMaxLength.Text = aWallExtrusion.WallExtrusionMaxLength.ToString();
                                        lblWallExtMaxLengthUnits.Text = aWallExtrusion.LengthUnits;

                                        rfvWallExtMaxLength.ValidationGroup = "wallExtrusions";
                                        cmpWallExtMaxLength.ValidationGroup = "wallExtrusions";

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

                                        if (aWallExtrusion.Status)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region WallPanels
                                case "tblWallPanels":
                                    {
                                        if (Session["wallPanels"] != null)
                                        {
                                            Session.Remove("wallPanels");
                                        }

                                        //show pnlRoofExtrusion
                                        pnlWallExtrusions.CssClass = "dimensionsTable";
                                        pnlComposition.CssClass = "showPanelNoClass";
                                        pnlStandard.CssClass = "showPanelNoClass";

                                        //create RoofExtrusion object
                                        WallPanels aWallPanel = new WallPanels();

                                        //add RoofExtrusion Object to the session
                                        Session.Add("wallPanels", aWallPanel);

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

                                        //populate fields
                                        imgPart.ImageUrl = "Images/catalogue/" + Session["partNumber"].ToString() + ".jpg";
                                        lblPartName.Text = aWallPanel.WallPanelName;
                                        txtPartDesc.Text = aWallPanel.WallPanelDescription;
                                        txtStandard.Text = aWallPanel.WallPanelStandard;
                                        txtComposition.Text = aWallPanel.WallPanelComposition;
                                        lblPartNum.Text = aWallPanel.WallPanelNumber;
                                        lblColorInput.Text = aWallPanel.WallPanelColor;

                                        txtWallPnlSize.Text = aWallPanel.WallPanelSize.ToString();
                                        lblWallPnlSizeUnits.Text = aWallPanel.SizeUnits;

                                        txtWallPnlMaxLength.Text = aWallPanel.WallPanelMaxLength.ToString();
                                        lblWallPnlMaxLengthUnits.Text = aWallPanel.LengthUnits;

                                        txtWallPnlMaxWidth.Text = aWallPanel.WallPanelMaxWidth.ToString();
                                        lblWallPnlMaxWidthUnits.Text = aWallPanel.WidthUnits;

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

                                        if (aWallPanel.Status)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                    }
                                #endregion
                                #region Schematics
                                case "tblSchematics":
                                    {
                                        if (Session["schematic"] != null)
                                        {
                                            Session.Remove("schematic");
                                        }

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

                                        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";

                                        lblSchemPartNum.CssClass = "removeElement";
                                        lblSchemPartKey.CssClass = "removeElement";
                                        lblSchemPartKeyNum.CssClass = "removeElement";
                                        lblSchemPartName.CssClass = "removeElement";

                                        lblColor.CssClass = "removeElement";
                                        lblColorInput.CssClass = "removeElement";
                                        pnlDimensions.CssClass = "removeElement";
                                        pnlPricing.CssClass = "removeElement";

                                        //show pnlSchematics and pricingSchemTable
                                        pnlSchematics.CssClass = "showElementNoClass";
                                        pnlPricingSchematics.CssClass = "pnlPricing";

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

                                        //create Schematics object
                                        Schematics aSchematic = new Schematics();

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

                                        //add RoofPanels Object to the session
                                        Session.Add("schematic", aSchematic);

                                        //populate fields

                                        //set up a dataview object for object member data
                                        System.Data.DataView aPartsTable = new System.Data.DataView();

                                        //select row based on table name and part number
                                        datUpdateDataSource.SelectCommand = "SELECT partNumber FROM tblSchematicParts WHERE schematicNumber='" + Session["partNumber"] + "' ORDER BY keyNumber ASC";

                                        //assign the row to the dataview object
                                        aPartsTable = (System.Data.DataView)datUpdateDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

                                        ddlSchem.Items.Clear();
                                        ddlSchem.Items.Add("");

                                        for (int i = 0; i < aPartsTable.Count; i++)
                                        {
                                            ddlSchem.Items.Add(aPartsTable[i][0].ToString());
                                        }

                                        lblPartName.Text = aSchematic.SchematicName.ToString();
                                        txtPartDesc.Text = aSchematic.SchematicDescription.ToString();
                                        lblPartNum.Text = aSchematic.SchematicNumber.ToString();

                                        txtUsdPriceSchematic.Text = aSchematic.SchematicUsdPrice.ToString("N2");
                                        txtCadPriceSchematic.Text = aSchematic.SchematicCadPrice.ToString("N2");
                                        rfvSchemWholeUsd.ValidationGroup = "pricing";
                                        cmpSchemWholeUsd.ValidationGroup = "pricing";
                                        rfvSchemWholeCad.ValidationGroup = "pricing";
                                        cmpSchemWholeCad.ValidationGroup = "pricing";

                                        if (aSchematic.SchematicStatus)
                                        {
                                            radActive.Checked = true;
                                        }
                                        else
                                        {
                                            radInactive.Checked = true;
                                        }
                                        break;
                                #endregion
                                    }

                            }
                        #endregion
                        }
                    }
                }
            }
            /*
            if (Session["backToUpdate"] != null)
            {
                imgPart.ImageUrl = "Images/catalogue/temp.jpg";
                System.IO.File.Delete(Server.MapPath("Images/catalogue/temp.jpg"));
                Session.Remove("backToUpdate");
            }
             * */
        }
Beispiel #41
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FTeams));
			this.btnSave = new SafeButton();
			this.btnCancel = new SafeButton();
			this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
			this.label1 = new System.Windows.Forms.Label();
			this.DdTeams = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			this.DdTeamsView = new System.Data.DataView();
			this.btnDelete = new SafeButton();
			this.DdClubs = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.txtName = new Allberg.Shooter.Windows.Forms.SafeTextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.ddWeaponClass = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			this.label8 = new System.Windows.Forms.Label();
			this.ddCompetitor1 = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			this.ddCompetitor2 = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			this.ddCompetitor3 = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			this.ddCompetitor4 = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			this.label9 = new System.Windows.Forms.Label();
			this.ddCompetitor5 = new Allberg.Shooter.Windows.Forms.SafeComboBox();
			((System.ComponentModel.ISupportInitialize)(this.DdTeamsView)).BeginInit();
			this.SuspendLayout();
			// 
			// btnSave
			// 
			this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnSave.Location = new System.Drawing.Point(240, 228);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new System.Drawing.Size(75, 23);
			this.btnSave.TabIndex = 6;
			this.btnSave.Text = "Spara";
			this.toolTip1.SetToolTip(this.btnSave, "Spara den ändrade informationen");
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnCancel.Location = new System.Drawing.Point(320, 228);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(75, 23);
			this.btnCancel.TabIndex = 7;
			this.btnCancel.Text = "Stäng";
			this.toolTip1.SetToolTip(this.btnCancel, "Stäng utan att spara");
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 8);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(56, 23);
			this.label1.TabIndex = 8;
			this.label1.Text = "Lag";
			// 
			// DdTeams
			// 
			this.DdTeams.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.DdTeams.DataSource = this.DdTeamsView;
			this.DdTeams.DisplayMember = "TeamId";
			this.DdTeams.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.DdTeams.Location = new System.Drawing.Point(64, 8);
			this.DdTeams.Name = "DdTeams";
			this.DdTeams.Size = new System.Drawing.Size(248, 21);
			this.DdTeams.TabIndex = 9;
			this.DdTeams.ValueMember = "TeamId";
			this.DdTeams.SelectedIndexChanged += new System.EventHandler(this.DdTeams_SelectedIndexChanged);
			// 
			// DdTeamsView
			// 
			this.DdTeamsView.ApplyDefaultSort = true;
			// 
			// btnDelete
			// 
			this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btnDelete.Location = new System.Drawing.Point(320, 8);
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.Size = new System.Drawing.Size(75, 23);
			this.btnDelete.TabIndex = 10;
			this.btnDelete.Text = "Radera";
			this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
			// 
			// DdClubs
			// 
			this.DdClubs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.DdClubs.DisplayMember = "ClubName";
			this.DdClubs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.DdClubs.Location = new System.Drawing.Point(64, 32);
			this.DdClubs.Name = "DdClubs";
			this.DdClubs.Size = new System.Drawing.Size(328, 21);
			this.DdClubs.TabIndex = 11;
			this.DdClubs.ValueMember = "ClubId";
			this.DdClubs.SelectedIndexChanged += new System.EventHandler(this.DdClubs_SelectedIndexChanged);
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(8, 32);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(48, 23);
			this.label2.TabIndex = 12;
			this.label2.Text = "Klubb";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(8, 80);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(48, 23);
			this.label3.TabIndex = 13;
			this.label3.Text = "Namn";
			// 
			// txtName
			// 
			this.txtName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.txtName.Location = new System.Drawing.Point(64, 80);
			this.txtName.Name = "txtName";
			this.txtName.Size = new System.Drawing.Size(328, 20);
			this.txtName.TabIndex = 14;
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(8, 104);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(48, 23);
			this.label4.TabIndex = 15;
			this.label4.Text = "Nr1";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(8, 128);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(48, 23);
			this.label5.TabIndex = 16;
			this.label5.Text = "Nr2";
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(8, 152);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(48, 23);
			this.label6.TabIndex = 17;
			this.label6.Text = "Nr3";
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(8, 56);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(48, 23);
			this.label7.TabIndex = 18;
			this.label7.Text = "Klass";
			// 
			// ddWeaponClass
			// 
			this.ddWeaponClass.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.ddWeaponClass.DisplayMember = "ClassName";
			this.ddWeaponClass.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.ddWeaponClass.Location = new System.Drawing.Point(64, 56);
			this.ddWeaponClass.Name = "ddWeaponClass";
			this.ddWeaponClass.Size = new System.Drawing.Size(328, 21);
			this.ddWeaponClass.TabIndex = 19;
			this.ddWeaponClass.ValueMember = "ClassId";
			this.ddWeaponClass.SelectedIndexChanged += new System.EventHandler(this.ddWeaponClass_SelectedIndexChanged);
			// 
			// label8
			// 
			this.label8.Location = new System.Drawing.Point(8, 176);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(48, 23);
			this.label8.TabIndex = 20;
			this.label8.Text = "Nr4";
			// 
			// ddCompetitor1
			// 
			this.ddCompetitor1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.ddCompetitor1.DisplayMember = "CompName";
			this.ddCompetitor1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.ddCompetitor1.Location = new System.Drawing.Point(64, 104);
			this.ddCompetitor1.Name = "ddCompetitor1";
			this.ddCompetitor1.Size = new System.Drawing.Size(328, 21);
			this.ddCompetitor1.TabIndex = 21;
			this.ddCompetitor1.ValueMember = "CompId";
			// 
			// ddCompetitor2
			// 
			this.ddCompetitor2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.ddCompetitor2.DisplayMember = "CompName";
			this.ddCompetitor2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.ddCompetitor2.Location = new System.Drawing.Point(64, 128);
			this.ddCompetitor2.Name = "ddCompetitor2";
			this.ddCompetitor2.Size = new System.Drawing.Size(328, 21);
			this.ddCompetitor2.TabIndex = 22;
			this.ddCompetitor2.ValueMember = "CompId";
			// 
			// ddCompetitor3
			// 
			this.ddCompetitor3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.ddCompetitor3.DisplayMember = "CompName";
			this.ddCompetitor3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.ddCompetitor3.Location = new System.Drawing.Point(64, 152);
			this.ddCompetitor3.Name = "ddCompetitor3";
			this.ddCompetitor3.Size = new System.Drawing.Size(328, 21);
			this.ddCompetitor3.TabIndex = 23;
			this.ddCompetitor3.ValueMember = "CompId";
			// 
			// ddCompetitor4
			// 
			this.ddCompetitor4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.ddCompetitor4.DisplayMember = "CompName";
			this.ddCompetitor4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.ddCompetitor4.Location = new System.Drawing.Point(64, 176);
			this.ddCompetitor4.Name = "ddCompetitor4";
			this.ddCompetitor4.Size = new System.Drawing.Size(328, 21);
			this.ddCompetitor4.TabIndex = 24;
			this.ddCompetitor4.ValueMember = "CompId";
			// 
			// label9
			// 
			this.label9.Location = new System.Drawing.Point(8, 199);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(48, 23);
			this.label9.TabIndex = 25;
			this.label9.Text = "Nr5";
			// 
			// ddCompetitor5
			// 
			this.ddCompetitor5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.ddCompetitor5.DisplayMember = "CompName";
			this.ddCompetitor5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.ddCompetitor5.Location = new System.Drawing.Point(64, 199);
			this.ddCompetitor5.Name = "ddCompetitor5";
			this.ddCompetitor5.Size = new System.Drawing.Size(328, 21);
			this.ddCompetitor5.TabIndex = 26;
			this.ddCompetitor5.ValueMember = "CompId";
			// 
			// FTeams
			// 
			this.AcceptButton = this.btnSave;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.CancelButton = this.btnCancel;
			this.ClientSize = new System.Drawing.Size(400, 258);
			this.Controls.Add(this.ddCompetitor5);
			this.Controls.Add(this.label9);
			this.Controls.Add(this.ddCompetitor4);
			this.Controls.Add(this.ddCompetitor3);
			this.Controls.Add(this.ddCompetitor2);
			this.Controls.Add(this.ddCompetitor1);
			this.Controls.Add(this.label8);
			this.Controls.Add(this.ddWeaponClass);
			this.Controls.Add(this.label7);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.txtName);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.DdClubs);
			this.Controls.Add(this.btnDelete);
			this.Controls.Add(this.DdTeams);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.btnSave);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "FTeams";
			this.Text = "Lag";
			((System.ComponentModel.ISupportInitialize)(this.DdTeamsView)).EndInit();
			this.ResumeLayout(false);
			this.PerformLayout();

		}
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["loggedIn"] != null)
            {
                if (Session["viewSelected"] != null)
                {
                    radButtonRow.CssClass = "hideElement";

                    Label firstLabel = (Label)Master.FindControl("lblUpdate");
                    if (firstLabel != null)
                    {
                        firstLabel.Text = "VIEW";
                    }

                    Label secondLabel = (Label)Master.FindControl("lblPartNumTitle");
                    if (secondLabel != null)
                    {
                        secondLabel.Text = "CATALOGUE";
                    }
                }
                else if (Session["updateSelected"] != null)
                {
                    radButtonRow.CssClass = "showElementNoClass";

                    Label firstLabel = (Label)Master.FindControl("lblUpdate");
                    if (firstLabel != null)
                    {
                        firstLabel.Text = "UPDATE";
                    }

                    Label secondLabel = (Label)Master.FindControl("lblPartNumTitle");
                    if (secondLabel != null)
                    {
                        secondLabel.Text = "CATALOGUE";
                    }
                }

                if (radUpdatePricing.Checked && Session["pricingOnly"] == null)
                {
                    Session.Add("pricingOnly", true);
                }
                else if (radUpdateGeneral.Checked && Session["pricingOnly"] != null)
                {
                    Session.Remove("pricingOnly");
                }

                if (!Page.IsPostBack)
                {
                    if (Session["pricingOnly"] != null)
                    {
                        radUpdatePricing.Checked = 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;

                    //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());
                    }
                }
            }
            else
            {
                Response.Redirect("Login.aspx");
            }
        }
Beispiel #43
0
        //Select all parts from the database
        public System.Data.DataView SelectAll(System.Web.UI.WebControls.SqlDataSource dataSource, string partNum, string schematicNum)
        {
            //set up a dataview object for object member data
            System.Data.DataView anObjectTable = new System.Data.DataView();

            //select row based on table name and part number
            dataSource.SelectCommand = "SELECT tblParts.partNumber,tblParts.partName,tblSchematicParts.SchematicNumber, tblSchematicParts.usdPrice, tblSchematicParts.cadPrice, "+
                                        "tblSchematicParts.keyNumber "+
                                        "FROM tblParts "+
                                        "INNER JOIN tblSchematicParts "+
                                        "ON tblParts.partNumber = tblSchematicParts.partNumber "+
                                        "WHERE tblParts.partNumber = '" + partNum + "' AND tblSchematicParts.schematicNumber= '" + schematicNum + "'";

            //assign the row to the dataview object
            anObjectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //return the DataView object
            return anObjectTable;
        }
Beispiel #44
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            string inchesInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            if (Sunrail300MaxLengthInches == null)
            {

                inchesInsert = "null,null,";
            }
            else
            {
                inchesInsert = Sunrail300MaxLengthInches + ",'" + Sunrail300MaxLengthInchesUnits + "',";
            }

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(sr300ID,partName,description,partNumber,color,maxLengthFeet,lengthFeetUnits,maxLengthInches,lengthInchesUnits,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + Sunrail300Name + "','" + Sunrail300Description + "','" + PartNumber + "','" + Sunrail300Color + "'," + Sunrail300MaxLengthFeet + ",'"
            + Sunrail300MaxLengthFeetUnits + "'," + inchesInsert
            + Sunrail300UsdPrice + "," + Sunrail300CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
        private void SetupComboBoxPickYear()
        {
            System.Data.DataView dv = new System.Data.DataView(dsPatientNotes.Tables[0]);

            ArrayList years = Utils.FindPresentYears(dv);

            foreach(object o in years)
            {
                int aYear = (int)o;
                cmbPickYear.Items.Add(aYear);
                cmbPickYear.SelectedIndex++;
                //Set the year to the last one present
                year = aYear;
            }
        }
Beispiel #46
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                //Make product active by  default
                radActive.Checked = true;

                //Reset temp picture
                System.IO.File.Delete(Server.MapPath("Images/catalogue/temp.jpg"));
                //System.IO.File.Copy(Server.MapPath("Images/catalogue/placeholder.jpg"),Server.MapPath("Images/catalogue/temp.jpg"));

                System.Data.DataView tableList = new System.Data.DataView();
            //Load up the tables list
                datInsertDataSource.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)datInsertDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //variable to determine amount of rows in the dataview object

            //populate first drop down
            ddlTables.DataSource = tableList;
            ddlTables.DataTextField = "name";
            ddlTables.DataValueField = "name";
            ddlTables.DataBind();

            Session["tableName"] = "tblAccessories";
             Hide_Panels();
             Show_Panels();

                //populate colors dropdown
             //Populate Colors Drop Down
             System.Data.DataView colorTable = new System.Data.DataView();
             datInsertDataSource.SelectCommand = "SELECT colorName FROM tblColor ORDER BY colorName ASC";
             colorTable = (System.Data.DataView)datInsertDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

             //Bind colors to drop down list

             ddlColors.DataSource = colorTable;
             ddlColors.DataTextField = "colorName";
             ddlColors.DataValueField = "colorName";
             ddlColors.DataBind();
             ddlColors.Items.Insert(0,new ListItem("N/A",""));

            }

            if(Page.IsPostBack)
            {
                //just for testing purposes
                Session["tableName"] = ddlTables.SelectedValue;

                Hide_Panels();
                Show_Panels();

                //Populate Units Drop Downs

                System.Data.DataView unitsTable = new System.Data.DataView();
                datInsertDataSource.SelectCommand = "SELECT lengthUnitName FROM tblLengthUnits ORDER BY lengthUnitName ASC";
                unitsTable = (System.Data.DataView)datInsertDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

                //would populate all the units dropdowns here

                    /*//Clear updated object in session
                    if (Session["updatedObject"] != null)
                    {
                        Session.Remove("updatedObject");
                    }

                    //clear specific product in session
                    if (Session["roofExtrusion"] != null)
                    {
                        Session.Remove("roofExtrusion");
                    }*/
                    //else if
                    //{
                    //    remove more objects
                    //}

                    //get table selected from session

                }
        }
Beispiel #47
0
        //Gets the data ready and caches the count of records in viewstate.
        System.Data.DataView SetupRealData(IEnumerable data)
        {
            System.Data.DataView dv = null;

            if (data is System.Data.DataSet)
            {
                System.Data.DataTable dt;
                if (DataMember != null && DataMember != "")
                {
                    dt = ((System.Data.DataSet)data).Tables[this.DataMember];
                }
                else
                {
                    dt = ((System.Data.DataSet)data).Tables[0];
                }

                dv = new System.Data.DataView(dt);
            }
            else if (data is System.Data.DataTable)
            {
                System.Data.DataTable dt = (System.Data.DataTable)data;
                dv = new System.Data.DataView(dt);
            }
            else if (data is System.Data.DataView)
            {
                dv = (System.Data.DataView)data;
            }

            cacheDataInViewstate(dv);

            return dv;
        }
Beispiel #48
0
        protected Boolean Part_Exists(string tableName, string partNumber)
        {
            //Check to see if part number already exists in database
            string selectSql = "SELECT partNumber from " + tableName + " WHERE partNumber = '" + partNumber + "'";

            datInsertDataSource.SelectCommand = selectSql;
            datInsertDataSource.Select(DataSourceSelectArguments.Empty);
            System.Data.DataView selectResults = new System.Data.DataView();

            selectResults = (System.Data.DataView)datInsertDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            if (selectResults.Count == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
Beispiel #49
0
		/// <summary>
		/// 装饰
		/// </summary>
		public DataView(System.Data.DataView View)
		{
			_View = View;
		}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="nvcName"></param>
        /// <param name="viewerName"></param>
        /// <param name="editorName"></param>
        /// <param name="editorFilter"></param>
        public void SetDataBinding(string nvcName, string viewerName, string editorName, string editorFilter)
        {
            if (NameValueMappingCollection.Instance[viewerName].ValueMember !=
                NameValueMappingCollection.Instance[editorName].ValueMember)
            {
                throw new ArgumentException(viewerName + "'s ValueMember and " + editorName + "' ValueMember should be same!", "viewerName");
            }
            string editTopNvName = NameValueMappingCollection.Instance.FindTopParentNv(editorName);
            //if (viewerName != editorName)
            //{
            //    string viewTopNvName = NameValueMappingCollection.Instance.FindTopParentNv(viewerName);
            //    if (editTopNvName != viewTopNvName)
            //    {
            //        throw new ArgumentException(viewerName + "'s TopNv and " + editorName + "' TopNv should be same!");
            //    }
            //}

            this.m_nvcName = nvcName;
            this.m_editorNvName = editorName;
            this.m_layoutName = MyComboBox.GetGridNameForNv(viewerName + "_" + editorName + "_" + editorFilter, true);

            this.SetDataBinding(NameValueMappingCollection.Instance.GetDataSource(nvcName, viewerName, string.Empty), string.Empty);

            m_editTopNv = NameValueMappingCollection.Instance[editTopNvName];

            // more call SetDataBinding
            m_editTopNv.DataSourceChanged -= new EventHandler(MyComboBox_DataTableChanged);
            m_editTopNv.DataSourceChanged += new EventHandler(MyComboBox_DataTableChanged);

            m_editTopNv.DataSourceChanging -= new System.ComponentModel.CancelEventHandler(MyComboBox_DataTableChanging);
            m_editTopNv.DataSourceChanging += new System.ComponentModel.CancelEventHandler(MyComboBox_DataTableChanging);

            if (viewerName != editorName || !string.IsNullOrEmpty(editorFilter))
            {
                m_needFilter = true;
                m_filterData = NameValueMappingCollection.Instance.GetDataSource(nvcName, editorName, editorFilter);
                FilterEditRow();
            }
        }
        private void SetupComboBoxPickMonth()
        {
            System.Data.DataView dv = new System.Data.DataView(dsPatientNotes.Tables[0]);
            bool[] notesinMonth = Utils.FindPresentMonths(dv, year);

            months.Clear();
            cmbPickMonth.Items.Clear();

            for(int month = 1; month <= 12; month++)
            {
                if (notesinMonth[month-1])
                {
                    string monthName = (new System.DateTime(year, month, 1)).ToString("MMMM");
                    cmbPickMonth.Items.Add(new Utils.Month(month, monthName));

                }
            }

            if (cmbPickMonth.Items.Count > 0)
            {
                cmbPickMonth.ValueMember = "MonthNumber";
                cmbPickMonth.DisplayMember = "MonthName";
                cmbPickMonth.SelectedIndex = 0;

            }
        }
Beispiel #52
0
        //Database select all
        public System.Data.DataView SelectAll(System.Web.UI.WebControls.SqlDataSource dataSource, string table, string partNum)
        {
            //set up a dataview object for object member data
            System.Data.DataView anObjectTable = new System.Data.DataView();

            //select row based on table name and part number
            dataSource.SelectCommand = "SELECT partName, description, partNumber, maxLength, lengthUnits, usdPrice, cadPrice, status FROM "
                            + table
                            + " WHERE partNumber = '"
                            + partNum + "'";

            //assign the row to the dataview object
            anObjectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //return the DataView object
            return anObjectTable;
        }
Beispiel #53
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(insulatedFloorID,partName,description,composition,partNumber,size,sizeUnits,maxWidth,widthUnits,maxLength,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + InsulatedFloorName + "','" + InsulatedFloorDescription + "','" + InsulatedFloorComposition + "','" + PartNumber + "'," + InsulatedFloorSize + ",'"
            + InsulatedFloorSizeUnits + "'," + InsulatedFloorMaxWidth + ",'" + InsulatedFloorMaxWidthUnits + "','" + InsulatedFloorMaxLength + "',"
            + InsulatedFloorUsdPrice + "," + InsulatedFloorCadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Beispiel #54
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");
            }
             */
        }
Beispiel #55
0
        protected void UpdatePartsList()
        {
            //set up a dataview object for object member data
            System.Data.DataView aPartsTable = new System.Data.DataView();
            //select row based on table name and part number
            datDisplayDataSource.SelectCommand = "SELECT partNumber FROM tblSchematicParts WHERE schematicNumber='" + Session["partNumber"] + "' ORDER BY keyNumber ASC";
            //assign the row to the dataview object
            aPartsTable = (System.Data.DataView)datDisplayDataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);
            ddlSchem.Items.Clear();
            ddlSchem.Items.Add("");

            txtLegend.Text = "";

            for (int i = 0; i < aPartsTable.Count; i++)
            {
                ddlSchem.Items.Add(aPartsTable[i][0].ToString());
                txtLegend.Text += (i + 1).ToString() + ": " + aPartsTable[i][0].ToString() + "\n";
            }

            if (Session["ddlSchemSelected"] != null)
            {
                ddlSchem.SelectedIndex = Convert.ToInt32(Session["ddlSchemSelected"]);
            }
        }
 internal DataRowView(System.Data.DataView dataView, DataRow row)
 {
     this.dataView = dataView;
     this._row = row;
 }
Beispiel #57
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            count = selectTable.Count;

            try
            {
                sqlInsert = "INSERT INTO " + table
                + "(accId,partName,description,partNumber,color,packQuantity,width,widthUnits,length,lengthUnits,size,sizeUnits,usdPrice,cadPrice,status)"
                + "VALUES"
                + "(" + (count + 1) + ",'" + AccessoryName + "','" + AccessoryDescription + "','" + AccessoryNumber + "','" + AccessoryColor + "'," + AccessoryPackQuantity + ","
                + AccessoryWidth + ",'" + AccessoryWidthUnits + "'," + AccessoryLength + ",'" + AccessoryLengthUnits + "'," + AccessorySize + ",'" + accessorySizeUnits + "',"
                + AccessoryUsdPrice + "," + AccessoryCadPrice + "," + 1 + ")";

                dataSource.InsertCommand = sqlInsert;
                dataSource.Insert();
            }
            catch (Exception ex)
            {
                string troubleshoot = ex.Message;
            }
        }