コード例 #1
0
        protected void submit_form_Click(object sender, EventArgs e)
        {
            string msg = "";

            var r = new Entities.Ruta(
                Nombre.Text,
                DireccionInicio.Text,
                Convert.ToDouble(hdlatIni.Value.Replace('.', ',')),
                Convert.ToDouble(hdlngIni.Value.Replace('.', ',')),
                DireccionDestino.Text,
                Convert.ToDouble(hdlatFin.Value.Replace('.', ',')),
                Convert.ToDouble(hdlngFin.Value.Replace('.', ',')),
                Convert.ToInt32(Session["pk"]));

            r.FkVehiculo = Convert.ToInt32(VehiculoDropdown.SelectedValue);

            if (Controlador.ValidarNombreRuta(r.Nombre, Convert.ToInt32(Session["pk"])))
            {
                msg = (Controlador.CrearRuta(r) == "1") ? "Registro exitoso!" : "Error en el registro.";
            }
            else
            {
                msg = "El nombre de la ruta ya existe";
            }

            Result.Text    = msg;
            Result.Visible = true;
        }
コード例 #2
0
ファイル: Draw.cs プロジェクト: Superbrain1337/Lab4
 //This is called each time the player or the enemies moves on the board. Also sets the position for the treasures
 public static void Plot(int x, int y, Entities.Ruta c, ConsoleColor f)
 {
     Console.BackgroundColor = ConsoleColor.Black;
     Console.SetCursorPosition(x, y);
     Console.ForegroundColor = f;
     Console.Write((char)c);
     Console.ForegroundColor = ConsoleColor.White;
 }