Example #1
0
 public IActionResult AddInf(AddInformation addInformation)
 {
     if (ModelState.IsValid)
     {
         db.AddInf(addInformation);
         return(RedirectToAction("Index", "Home"));
     }
     return(RedirectToAction("Index", "Home"));
 }
Example #2
0
 public void AddInf(AddInformation addInformation)
 {
     using (SqlConnection connection = new SqlConnection(connectionString))
     {
         connection.Open();
         string     sql     = "INSERT INTO Informations VALUES (" + addInformation.Id + ", '" + addInformation.Hobby + "', '" + addInformation.Text + "', '" + addInformation.Img + "')";
         SqlCommand command = new SqlCommand(sql, connection);
         command.ExecuteNonQuery();
     }
 }
Example #3
0
 public override IResult Add(AddInformation info)
 {
     throw new NotImplementedException();
 }