public CuentaObjetivo seleccionarCAObj(int?id) { var cuentaObj = new CuentaObjetivo(); using (SqlConnection con = new SqlConnection(connectionString)) { SqlCommand cmd = new SqlCommand("selCO", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", id); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { cuentaObj.id = Convert.ToInt32(dr["id"]); cuentaObj.FechaInicio = Convert.ToDateTime(dr["FechaInicio"]).ToString("d"); cuentaObj.FechaFin = Convert.ToDateTime(dr["FechaFin"]).ToString("d"); cuentaObj.Costo = Convert.ToDouble(dr["Costo"]); cuentaObj.Objetivo = dr["Objetivo"].ToString(); cuentaObj.Saldo = Convert.ToDouble(dr["Saldo"]); cuentaObj.InteresesAcumulados = Convert.ToDouble(dr["InteresesAcumulados"]); cuentaObj.CuentaAhorroid = Convert.ToInt32(dr["CuentaAhorroid"]); } con.Close(); } return(cuentaObj); }
public IEnumerable <CuentaObjetivo> verCuentaObjetivo(int?CuentaAhorroid) //El signo de pregunta sirve para generar un error si el contenido es NULL { var cuentaObjLista = new List <CuentaObjetivo>(); using (SqlConnection con = new SqlConnection(connectionString)) { SqlCommand cmd = new SqlCommand("VerCuentaObj", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@inCuentaAhorroid", CuentaAhorroid); cmd.Parameters.AddWithValue("@outCuentaObjId", 0); cmd.Parameters.AddWithValue("@OutResultCode", 0); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { var cuentaObj = new CuentaObjetivo(); cuentaObj.id = Convert.ToInt32(dr["id"]); cuentaObj.FechaInicio = Convert.ToDateTime(dr["FechaInicio"]).ToString("d"); cuentaObj.FechaFin = Convert.ToDateTime(dr["FechaFin"]).ToString("d"); cuentaObj.Costo = Convert.ToDouble(dr["Costo"]); cuentaObj.Objetivo = dr["Objetivo"].ToString(); cuentaObj.Saldo = Convert.ToDouble(dr["Saldo"]); cuentaObj.InteresesAcumulados = Convert.ToDouble(dr["InteresesAcumulados"]); cuentaObj.CuentaAhorroid = Convert.ToInt32(dr["CuentaAhorroid"]); cuentaObjLista.Add(cuentaObj); } con.Close(); } return(cuentaObjLista); }
public ActionResult editarCuentaObj([Bind] CuentaObjetivo cuentaObj) { if (ModelState.IsValid) { SP_ProcedureCuentaObjetivo.editarDescripcion(cuentaObj); return(RedirectToAction("volverIndex")); } return(NotFound()); }
public ActionResult crearCuentaObjetivo([Bind] CuentaObjetivo caObjetivo) { if (ModelState.IsValid) { SP_ProcedureCuentaObjetivo.AgregarCuentaObjetivo(caObjetivo); return(RedirectToAction("volverIndex")); } return(NotFound()); }
public ActionResult editarCuentaObj(int id) { CuentaObjetivo cuentaObj = SP_ProcedureCuentaObjetivo.seleccionarCAObj(id); if (cuentaObj != null) { return(View()); } else { return(NotFound()); } }
public void editarDescripcion(CuentaObjetivo cuentaObj) { using (SqlConnection con = new SqlConnection(connectionString)) { SqlCommand cmd = new SqlCommand("ModificarDescripcionCuentaObjetivo", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", cuentaObj.id); cmd.Parameters.AddWithValue("@inObjetivo", cuentaObj.Objetivo); cmd.Parameters.AddWithValue("@outCuentaObjetivoId", 0); cmd.Parameters.AddWithValue("@OutResultCode", 0); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } }
public void AgregarCuentaObjetivo(CuentaObjetivo cuentaObj) { using (SqlConnection con = new SqlConnection(connectionString)) { SqlCommand cmd = new SqlCommand("CrearCuentaObjetivo", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@inFechaInicio", cuentaObj.FechaInicio); cmd.Parameters.AddWithValue("@inFechaFin", cuentaObj.FechaFin); cmd.Parameters.AddWithValue("@inCosto", cuentaObj.Costo); cmd.Parameters.AddWithValue("@inObjetivo", cuentaObj.Objetivo); cmd.Parameters.AddWithValue("@inSaldo", cuentaObj.Saldo); cmd.Parameters.AddWithValue("@inInteresesAcumulados", cuentaObj.InteresesAcumulados); cmd.Parameters.AddWithValue("@inCuentaAhorroid", cuentaObj.CuentaAhorroid); cmd.Parameters.AddWithValue("@outCuentaObjetivoId", 0); cmd.Parameters.AddWithValue("@OutResultCode", 0); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { BeginContext(44, 2, true); WriteLiteral("\r\n"); EndContext(); #line 3 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" ViewData["Title"] = "Edit"; CuentaObjetivo cuenta = (CuentaObjetivo)ViewBag.cuenta; #line default #line hidden BeginContext(148, 112, true); WriteLiteral("\r\n\r\n<h1>Editar</h1>\r\n\r\n<h4>Cuenta Objetivo</h4>\r\n<hr />\r\n<div class=\"row\">\r\n <div class=\"col-md-4\">\r\n "); EndContext(); BeginContext(260, 886, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2f4df3fe435a6106d7253b7e79c27669c6444b856834", async() => { BeginContext(300, 14, true); WriteLiteral("\r\n "); EndContext(); BeginContext(314, 66, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2f4df3fe435a6106d7253b7e79c27669c6444b857228", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationSummaryTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper); #line 16 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary = global::Microsoft.AspNetCore.Mvc.Rendering.ValidationSummary.ModelOnly; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-summary", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(380, 14, true); WriteLiteral("\r\n "); EndContext(); BeginContext(394, 36, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "2f4df3fe435a6106d7253b7e79c27669c6444b859095", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_1.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); #line 17 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.ID); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(430, 56, true); WriteLiteral("\r\n <div class=\"form-group\">\r\n "); EndContext(); BeginContext(486, 54, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2f4df3fe435a6106d7253b7e79c27669c6444b8511038", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper); #line 19 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Nombre); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(540, 18, true); WriteLiteral("\r\n "); EndContext(); BeginContext(558, 47, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "2f4df3fe435a6106d7253b7e79c27669c6444b8512821", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); #line 20 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Nombre); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(605, 18, true); WriteLiteral("\r\n "); EndContext(); BeginContext(623, 61, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("span", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2f4df3fe435a6106d7253b7e79c27669c6444b8514598", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationMessageTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper); #line 21 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Nombre); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-for", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(684, 76, true); WriteLiteral("\r\n </div>\r\n <div class=\"form-group\">\r\n "); EndContext(); BeginContext(760, 59, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2f4df3fe435a6106d7253b7e79c27669c6444b8516515", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper); #line 24 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Descripcion); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(819, 18, true); WriteLiteral("\r\n "); EndContext(); BeginContext(837, 52, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "2f4df3fe435a6106d7253b7e79c27669c6444b8518303", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); #line 25 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Descripcion); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(889, 18, true); WriteLiteral("\r\n "); EndContext(); BeginContext(907, 66, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("span", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2f4df3fe435a6106d7253b7e79c27669c6444b8520085", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationMessageTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper); #line 26 "C:\Users\Edgar\Desktop\Importante\TEC\IV SEMESTRE\BASES DE DATOS I\Progra1-Bases\Progra1-Bases\Progra1-bases\Views\Account\EditarCuentaObjetivo.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Descripcion); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-for", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(973, 166, true); WriteLiteral("\r\n </div>\r\n <div class=\"form-group\">\r\n <input type=\"submit\" value=\"Save\" class=\"btn btn-primary\" />\r\n </div>\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Action = (string)__tagHelperAttribute_4.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1146, 35, true); WriteLiteral("\r\n </div>\r\n</div>\r\n\r\n<div>\r\n "); EndContext(); BeginContext(1181, 38, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2f4df3fe435a6106d7253b7e79c27669c6444b8523416", async() => { BeginContext(1203, 12, true); WriteLiteral("Back to List"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_5.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1219, 12, true); WriteLiteral("\r\n</div>\r\n\r\n"); EndContext(); }