Question: C# programming. i need help In OrderOptionDB.CS, add the following two things using the codes provided below 1. In the btnSave_Click() event handler, move the
C# programming. i need help In OrderOptionDB.CS, add the following two things using the codes provided below 1. In the btnSave_Click() event handler, move the existing code within a try clause. Add a catch clause that handles the SqlException exception. Within that catch block, write code that displays the exception message to the user. 2.. In the btnSave_Click() event handler, make sure the code that calls the UpdateOrderOptions() method only updates the form and displays a success message if that method returned a Boolean value of true. Then, update the code to display a concurrency message if that Boolean value is false.



Order Options Maintenance x Sales tax rate: Shipping charge - first book: Shipping charge - each add'l book: Save Exit OrderOption.cs Validator.cs* + x frmOptionsMaint.cs* C# OrderOptions Maintenance OrderOpti Orde Server Explorer Toolbox 1 2 3 4 using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; 5 6 7 8 9 le namespace OrderOptions Maintenance { 6 frances public static class Validator { private static string title - "Entry Error"; public static string Title 1 get -> title; set -> title - value; } 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3a 31 32 33 public static bool Is Present (TextBox textBox) { if (textBox. Text -- "") { MessageBox.Show(textBox.Tag" is a required field.", Title); + textBox.Focus(); return false; } return true; } 3 references public static bool IsDecimal(textBox textBox) { decimal number - Bm; if (Decimal. TryParse(textBox.Text, out number)) { return true; } else 1 MessageBox.Show(textBox.Tag must be a decimal value.", Title); textBox.Focus(); return false; } } Orcas public static bool IsInt32(TextBox textBox) { int number - B; if (Int32. TryParse(textBox.Text, out number)) { return true; } else 35 36 37 38 39 40 41 42 43 45 46 47 48 49 se 51 52 53 54 55 must be an integer. Title); MessageBox.Show(textBox.Tag + textBox.Focus(); return false; } } public static bool IsWithinRange(TextBox textBox, decinal min, decimal max) decimal number - Convert.ToDecimal(textBox.Text); if (number nin ll number > max) 56 57 58 59 be 61 62 63 64 65 66 MessageBox.Show(textBox.Tag must be between min + " and "max+ .". Title); textBox.Focus(): return false; } return true; 68 69 7a frmOptionsMaint.cs* OrderOption.cs + x OrderOptionDB.cs* C# OrderOptionsMaintenance 1 using System; 2 using System.Collections.Generic; frmOptionsMaint.cs (Design)* Validator.cs OrderOptionsMaintenance Models OrderOption 3 4 5 6 7 8 namespace OrderOptionsMaintenance Models { 3 references public partial class OrderOption { O references public int OptionId { get; set; } O references public decimal Sales TaxRate { get; set; } O references public decimal FirstBookShipCharge { get; set; } O references public decimal Additional BookShipCharge { get; set; } 9 10 11 12 13 14 } frmOptionsMaint.cs* OrderOption.cs OrderOptionDB.cs* + C# OrderOptions Maintenance 1 [namespace OrderOptionsMaintenance Models x frm OptionsMaint.cs (Design)* Validator.cs* OrderOptionsMaintenance Models.OrderOptionDB UpdateOrderOption(Orde 3 O references public static class OrderOptionDB 4 6 7 8 9 O references public static OrderOption GetorderOptions() { return null; } O references public static bool UpdateOrderOption(OrderOption oldoptions, OrderOption newOptions) { return false; guggbbgh8 10 11 12 13 14 15 16 17 18 } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
