public static void GetServiceMenu() { Console.WriteLine("_____________________________________________________________________"); Console.WriteLine("_____________________________________________________________________"); Console.WriteLine(" "); Console.WriteLine("Manage services"); Console.WriteLine("1. Get all services"); Console.WriteLine("2. Add new service"); Console.WriteLine("3. Update service"); Console.WriteLine("4. Delete service"); Console.WriteLine("5. Back to EF menu"); Console.WriteLine("Type number of action you want to do:"); string input = Console.ReadLine(); switch (input) { case "1": ManageServices.GetList(); GetServiceMenu(); break; case "2": ManageServices.Add(); GetServiceMenu(); break; case "3": ManageServices.Update(); GetServiceMenu(); break; case "4": ManageServices.Delete(); GetServiceMenu(); break; case "5": EfMenu.GetMenu(); break; default: Console.WriteLine("Wrong number, try again!"); GetServiceMenu(); break; } }
protected void Submit(object sender, EventArgs e) { try { ManageServices serv = new ManageServices(); string service = cmbservice.SelectedItem.Value; double rent = Convert.ToDouble(txtcharge.Text); if (serv.AddService(service, rent)) { value = 1; } else { value = 0; } } catch (Exception) { value = 0; } if (value == 1) { message = "Service charges stored successfully.."; title = "Success Report"; } else if (value == 0) { message = "Service charges storage failed.."; title = "Failure Report"; } string script = "window.onload = function(){ alert('"; script += message; script += "')};"; ClientScript.RegisterStartupScript(this.GetType(), title, script, true); }