public Result FindTypeByName(string typeName) { if (Compounds.TryGetValue(typeName, out var compoundSchema)) { return new Result.Compound() { Schema = compoundSchema } } ; if (Basics.TryGetValue(typeName, out var basicSchema)) { return new Result.Basic() { Schema = basicSchema } } ; if (NiObjects.TryGetValue(typeName, out var niObjectSchema)) { return new Result.NiObject() { Schema = niObjectSchema } } ; throw new Exception(); } } }
public ActionResult EnterCompound(string compName, float compWeight, int compQuant) { Work_Order work = new Work_Order(); work.custWeight = compWeight; work.Quantity = compQuant; ViewBag.whatever = Session["CustomerID"]; work.CustomerID = ViewBag.whatever; // work.LTNumber = random.Next(100000, 999999); Compounds comp = new Compounds(); //comp.LTNumber = work.LTNumber; comp.compoundName = compName; db.Work_Order.Add(work); //db.Compounds.Add(comp); //db.SaveChanges(); Session["CompNames"] = comp.compoundName; ViewBag.compoundName = comp.compoundName; return(RedirectToAction("EnterAssay")); }
public async Task <IActionResult> Edit(int id, [Bind("Id,IngredientId,Amount,CoctailId")] Compounds compounds) { if (id != compounds.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(compounds); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompoundsExists(compounds.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CoctailId"] = new SelectList(_context.Coctails, "Id", "Name", compounds.CoctailId); ViewData["IngredientId"] = new SelectList(_context.Ingredients, "Id", "Name", compounds.IngredientId); return(View(compounds)); }
public override string ToString() { if (Compounds.Count > 1) { return(string.Format("({0})", Compounds.ConcatWithSeparator(","))); } else { return(string.Format("{0}", Compounds.ConcatWithSeparator(","))); } }
public async Task <IActionResult> Create([Bind("Id,IngredientId,Amount,CoctailId")] Compounds compounds) { if (ModelState.IsValid) { _context.Add(compounds); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CoctailId"] = new SelectList(_context.Coctails, "Id", "Name", compounds.CoctailId); ViewData["IngredientId"] = new SelectList(_context.Ingredients, "Id", "Name", compounds.IngredientId); return(View(compounds)); }
protected EatPattern(BreakDownHandler howBreakdown, BreakDownsHandler howBreakdowns, EatPatternConfig config) { _howBreakDown = howBreakdown; _howBreakDowns = howBreakdowns; _config = config; _rubbish = new Rubbish(); _stomach = new OneByOnePipeline(Digest); _enzyme = new AutoResetPipeline(Breakdown); _lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); _outputElapsedStopwatch = new Stopwatch(); _foods = new Compounds <F>(config.MaxFoodStock, config.ReplaceMode, _rubbish); //食物 _nutrients = new Compounds <N>(config.MaxNutrientStock, config.ReplaceMode, _rubbish); //养分 _delapyer = new MediaDelayer(); }
// GET: Labs public ActionResult WorkOrdersCom(int workOrderID) { ViewBag.type = "CO"; Stack <Compounds> compounds = new Stack <Compounds>(); IEnumerable <int> list = db.Database.SqlQuery <int>("SELECT LTNum FROM Compounds WHERE workOrderID = " + workOrderID).ToList(); foreach (var item in list) { Compounds compound = new Compounds(); compound.LTNum = item; var comName = db.Database.SqlQuery <string>("SELECT compoundName FROM Compounds INNER JOIN CompoundsFinite ON Compounds.compoundFinID = CompoundsFinite.compoundFinID WHERE LTNum = " + item).FirstOrDefault(); compound.compoundName = comName; compounds.Push(compound); } ViewBag.compounds = compounds; ViewBag.workOrderID = workOrderID; return(View("WorkOrders")); }
private void CompoundGroupSelectionChanged(ICompoundGroup obj) { Compounds.Clear(); if (obj == null) { return; } IDictionary <string, ICompound> sampleWiseICompounds = obj.SampleWiseDataDictionary; if (sampleWiseICompounds == null) { return; } IEnumerator <ICompound> enumerator = sampleWiseICompounds.Values.GetEnumerator(); while (enumerator.MoveNext()) { Compounds.Add(enumerator.Current); } }
private Vector3 DoBaseMovementForce(float delta) { var cost = (Constants.BASE_MOVEMENT_ATP_COST * HexCount) * delta; var got = Compounds.TakeCompound(atp, cost); float force = Constants.CELL_BASE_THRUST; // Halve speed if out of ATP if (got < cost) { // Not enough ATP to move at full speed force *= 0.5f; } if (IsPlayerMicrobe) { force *= CheatManager.Speed; } return(Transform.basis.Xform(MovementDirection * force) * MovementFactor * (Species.MembraneType.MovementFactor - (Species.MembraneRigidity * Constants.MEMBRANE_RIGIDITY_MOBILITY_MODIFIER))); }
public ActionResult OrderEntry(FormCollection form) { string compound = form["Compound"].ToString(); List <string> assayTests = new List <string>(); List <string> otherTests = new List <string>(); if (form["option1"].ToString() == "true,false") { assayTests.Add("Biochemical Pharmacology"); } if (form["option2"].ToString() == "true,false") { assayTests.Add("DiscoveryScreen"); } if (form["option3"].ToString() == "true,false") { assayTests.Add("ImmunoScreen"); } if (form["option4"].ToString() == "true,false") { assayTests.Add("ProfilingScreen"); } if (form["option5"].ToString() == "true,false") { assayTests.Add("PharmaScreen"); } if (form["option6"].ToString() == "true,false") { assayTests.Add("CustomScreen"); } if (form["option7"].ToString() == "true,false") { otherTests.Add("Spot Analysis"); } if (form["option8"].ToString() == "true,false") { otherTests.Add("Salicylate Testing"); } if (form["option9"].ToString() == "true,false") { otherTests.Add("Permanganate Index"); } WorkOrders workOrder = new WorkOrders(); Compounds compounds = new Compounds(); Invoices invoice = new Invoices(); invoice.accID = 5; compounds.LTNum = 553645; compounds.compoundFinID = 2; if (ModelState.IsValid) { db.WorkOrders.Add(workOrder); db.SaveChanges(); compounds.workOrderID = workOrder.workOrderID; db.Compounds.Add(compounds); db.SaveChanges(); invoice.workOrderID = workOrder.workOrderID; db.Invoices.Add(invoice); db.SaveChanges(); } foreach (string item in assayTests) { Samples sample = new Samples(); sample.assayID = db.Database.SqlQuery <int>("SELECT assayID FROM Assays WHERE Assays.name = @p0", item).FirstOrDefault(); sample.LTNum = compounds.LTNum; if (ModelState.IsValid) { db.Samples.Add(sample); db.SaveChanges(); } IEnumerable <Tests> tests = db.Database.SqlQuery <Tests>("SELECT Tests.testID FROM Tests INNER JOIN Assay_Tests on Assay_Tests.testID = Tests.testID INNER JOIN Assays on Assays.assayID = Assay_Tests.assayID WHERE Assays.assayID = @p0", sample.assayID).ToList(); foreach (var item2 in tests) { testTube testTube = new testTube(); Serialized_Tests serializedTest = new Serialized_Tests(); testTube.sampleID = sample.sampleID; serializedTest.testID = item2.testID; serializedTest.testName = "Prototype test"; if (ModelState.IsValid) { db.Serialized_Tests.Add(serializedTest); db.SaveChanges(); testTube.serialID = serializedTest.SerialTestID; db.testTube.Add(testTube); db.SaveChanges(); } } foreach (var item3 in otherTests) { testTube testTube = new testTube(); testTube.sampleID = sample.sampleID; Serialized_Tests serializedTest = new Serialized_Tests(); serializedTest.testID = db.Database.SqlQuery <int>("SELECT Tests.testID FROM Tests WHERE Tests.testName = @p0", item3).FirstOrDefault(); serializedTest.testName = "Prototype test"; if (ModelState.IsValid) { db.Serialized_Tests.Add(serializedTest); db.SaveChanges(); testTube.serialID = serializedTest.SerialTestID; db.testTube.Add(testTube); db.SaveChanges(); } } } return(RedirectToAction("confirmationPage", "Customer")); }
public override string ToString() { return(string.Format("{{{0}}}", Compounds.ConcatWithSeparator(","))); }