public void InsertVasca(Vasca v) { using (var connection = new SqlConnection(this._connectionString)) { connection.Open(); connection.Execute(@"USE[tick] INSERT INTO [dbo].[Vasca] ([vsc_Altezza] ,[vsc_Nome] ,[vsc_Coperta] ,[vsc_Interrata] ,[vsc_Riscaldata] ,[vsc_Recupero] ,[vsc_Interramento] ,[vsc_NSoffiantine] ,[vsc_Diametro] ,[vsc_Impianto]) VALUES (@vsc_Altezza ,@vsc_Nome ,@vsc_Coperta ,@vsc_Interrata ,@vsc_Riscaldata ,@vsc_Recupero ,@vsc_Interramento ,@vsc_NSoffiantine ,@vsc_Diametro ,@vsc_Impianto)", v); } }
public IActionResult UpdateVasca(UpdateVascaViewModel model) { Vasca vsc = new Vasca(model.vsc_Nome, model.vsc_Id, model.vsc_Altezza, model.vsc_Coperta, model.vsc_Riscaldata, model.vsc_Recupero, model.vsc_Interrata, model.vsc_Interramento, model.vsc_NSoffiantine, model.vsc_Diametro, model.vsc_Impianto); this._data.UpdateVasca(vsc); return(RedirectToAction("ImpiantoFullInfo", "Impianto", new { ipt_Id = model.ipt_Id, clt_Id = model.clt_id })); }
public void UpdateVasca(Vasca v) { using (var connection = new SqlConnection(_connectionString)) { connection.Open(); connection.Execute(@" USE [tick] UPDATE [dbo].[Vasca] SET [vsc_Nome]=@vsc_Nome ,[vsc_Altezza]=@vsc_Altezza ,[vsc_Coperta]=@vsc_Coperta ,[vsc_Riscaldata]=@vsc_Riscaldata ,[vsc_Recupero]=@vsc_Recupero ,[vsc_Interrata]=@vsc_Interrata ,[vsc_Interramento]=@vsc_Interramento ,[vsc_NSoffiantine]=@vsc_NSoffiantine ,[vsc_Diametro]=@vsc_Diametro ,[vsc_Impianto]=@vsc_Impianto WHERE [vsc_Id] = @vsc_Id", v); } }
public InsertVascaViewModel() { v = new Vasca(); v.vsc_Impianto = new int(); }