internal void PopulateLineValues() { BOXX_V2Entities bv2 = new BOXX_V2Entities(); VW_OMCWebItem item = bv2.VW_OMCWebItem.Where(z => z.ItemID == this.PartNumber).FirstOrDefault(); try { this.ComponentType = item.ComponentType; this.PartName = item.ItemName; this.StandardCost = double.Parse(item.StandardCost.ToString()); this.AccountingCost = double.Parse(item.AccountingCost.ToString()); } catch { return; } }
private void SetupLabelDropDown() { // Create a connection to Tables in database dbConnection = new BOXX_V2Entities(); // Get all labels listed as active in the label table and set selectedLabel to myLabel Session variable try { ddlLabels.Items.AddRange(dbConnection.tbl_Label.Where(x => x.ActiveInactive == 1).ToList().Select(y => new ListItem(y.Name, y.ID.ToString())).ToArray()); setLabelSelectionAccordingToFavorite(); selectedLabel = dbConnection.tbl_Label.Where(x => x.ID.ToString() == ddlLabels.SelectedValue).First(); myLabel = new myLabel(selectedLabel); } catch (Exception e) { Response.Write("<script>alert('Unable to load Labels or No Active Labels in Label table');</script>"); } }