public async Task IzmeniPuk(int idVojske, int idPuka, [FromBody] Puk puk) { var entityV = Context.vojske.SingleOrDefault(e => e.ID == idVojske); var entityP = Context.pukovi.SingleOrDefault(e => e.ID == idPuka); entityP.Tip = puk.Tip; entityP.BrBataljona = puk.BrBataljona; entityP.MaxBataljona = puk.MaxBataljona; //entityP.Vojska = entityV; await Context.SaveChangesAsync(); }
public async Task <ActionResult> UpisiPuk(int idVojske, [FromBody] Puk puk) { var vojska = await Context.vojske.FindAsync(idVojske); puk.Vojska = vojska; Context.pukovi.Add(puk); await Context.SaveChangesAsync(); var id = puk.ID; return(Ok(id)); }
private void buttonOk_Click(object sender, EventArgs e) { if (this.radioButtonRBF.Checked) { RBFKernel MyGeneratedKernel = new RBFKernel(); ((RBFKernel)MyGeneratedKernel).setGamma((double)this.numericUpDownRBFGamma.Value); GeneratedKernel = (Kernel)(MyGeneratedKernel); } if (this.radioButtonPearson.Checked) { Puk MyGeneratedKernel = new Puk(); ((Puk)MyGeneratedKernel).setSigma((double)this.numericUpDownPearsonSigma.Value); ((Puk)MyGeneratedKernel).setOmega((double)this.numericUpDownPearsonOmega.Value); GeneratedKernel = (Kernel)(MyGeneratedKernel); } if (this.radioButtonPolyKernel.Checked) { PolyKernel MyGeneratedKernel = new PolyKernel(); MyGeneratedKernel.setExponent((double)this.numericUpDownPolyExponent.Value); GeneratedKernel = (Kernel)(MyGeneratedKernel); } }