public async Task <IActionResult> Edit(int id, [Bind("mID,Name")] Metals metals) { if (id != metals.mID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(metals); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MetalsExists(metals.mID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(metals)); }
protected override void updateMaterialCost() { double stairCost = 0; double normCost = 0; double nl = Nails / 100; double addOnMetalCost = 0; if (Metals.Count > 0 && MiscMetals.Count > 0) { IEnumerable <Metal> stairMetals = Metals.Where(x => x.IsStairMetalChecked == true); if (stairMetals.Count() > 0) { stairCost = stairMetals.Select(x => x.MaterialExtension).Sum(); } IEnumerable <AddOnMetal> selectedAddOnMetals = AddOnMetals.Where(x => x.IsMetalChecked == true); if (selectedAddOnMetals.Count() > 0) { addOnMetalCost = selectedAddOnMetals.Select(x => x.MaterialExtension).Sum(); } //IEnumerable<Metal> normMetals = Metals.Where(x => x.Name.Contains("STAIR") == false); //if (normMetals.Count() > 0) //{ // normCost = normMetals.Select(x => x.MaterialExtension).Sum(); //} //double misSum = Metals.Select(x => x.MaterialExtension).Sum() * nl; TotalMaterialCost = Math.Round((normCost + stairCost) * (1 + nl) + addOnMetalCost * (1 + nl) + MiscMetals.Select(x => x.MaterialExtension).Sum(), 2); } }
public Bot() { Version = "0.2.1"; PlayerDatabase = new PlayerDatabase("player.db"); Items = new ItemList(); Words = new WordList(); DotPuzzles = new PuzzleList(); AllMetals = new Metals(); }
public async Task <IActionResult> Create([Bind("mID,Name")] Metals metals) { if (ModelState.IsValid) { _context.Add(metals); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(metals)); }
private async Task LoadProductLookupAsync() { Metals.Clear(); //Metals.Add(new NullLookupItem { DisplayMember = " - " }); var lookup = await _productLookupDataService.GetMetalLookupAsync(); foreach (var lookupItem in lookup) { Metals.Add(lookupItem); } }
public override void updateLaborCost() { double stairCost = 0; double addOnMetalCost = 0; double normCost = 0; IEnumerable <Metal> stairMetals = Metals.Where(x => x.IsStairMetalChecked == true); if (stairMetals.Count() > 0) { stairCost = stairMetals.Select(x => x.LaborExtension).Sum(); } //IEnumerable<Metal> normMetals = Metals.Where(x => x.Name.Contains("STAIR") == false); //if (normMetals.Count() > 0) //{ // normCost = normMetals.Select(x => x.LaborExtension).Sum(); //} //New Changes for Addon Metals IEnumerable <AddOnMetal> selectedAddOnMetals = AddOnMetals.Where(x => x.IsMetalChecked); if (selectedAddOnMetals.Count() > 0) { addOnMetalCost = selectedAddOnMetals.Select(x => x.LaborExtension).Sum(); } normCost = Math.Round(normCost + stairCost + addOnMetalCost + MiscMetals.Select(x => x.LaborExtension).Sum(), 2); if (isPrevailingWage) { if (isDiscount) { TotalLaborCost = Math.Round(normCost * (1 + prevailingWage + deductionOnLargeJob), 2); } else { TotalLaborCost = Math.Round(normCost * (1 + prevailingWage), 2); } } else { if (isDiscount) { TotalLaborCost = Math.Round(normCost * (1 + deductionOnLargeJob), 2); } else { TotalLaborCost = Math.Round(normCost, 2); } } }
public virtual double getUnits(int unitNo) { double unit = 0; if (unitNo == 0) { //double.TryParse(metalDetails[2][0].ToString(), out unit); unit = riserCount * 2.25 * 2; } else if (unitNo == 1) { //double.TryParse(metalDetails[3][0].ToString(), out unit); unit = riserCount * stairWidth * 2; } else if (unitNo == 2) { double addOnMetalUnits = 0; for (int z = 0; z < AddOnMetals.Count; z++) { if (AddOnMetals[z].IsMetalChecked == true) { addOnMetalUnits = addOnMetalUnits + AddOnMetals[z].Units; } } //changed how pins and load are calculated ,removed Chivon as per mail on 12th Sept 2019. //unit = isFlash ? (Metals[0].Units+ Metals[1].Units + Metals[2].Units + Metals[3].Units // + addOnMetalUnits) *stairWidth : 0; unit = isFlash ? (Metals.Sum(x => x.Units) + +addOnMetalUnits) * 4 : 0; //double.TryParse(metalDetails[37][0].ToString(), out unit); } else if (unitNo == 3) { unit = isFlash ? riserCount : 0; //double.TryParse(metalDetails[38][0].ToString(), out unit); } return(unit); }
public MyClass(Metals metal) { _metal = metal; }
public BullionAccount(string number, string owner, decimal balance, Metals metal, decimal course) : base(number, owner, balance) { Metal = metal; Course = course; }
protected Metal(Metals metal) { _metal = metal; }
protected Metal(Metals metal) { MetalType = metal; }