示例#1
0
 public ActionResult Create(User user)
 {
     if (ModelState.IsValid)
     {
         Users.AddUser(user);
         return RedirectToAction("Index", "Data");
     }
     else
         return View(user);
 }
示例#2
0
文件: Users.cs 项目: ffblk/epam
 public static void AddUser(User p)
 {
     OleDbConnection conn = MyConnection.GetConnection();
     OleDbCommand cmd = new OleDbCommand(AddQuery, conn);
     cmd.Parameters.AddWithValue("@name", p.name);
     cmd.Parameters.AddWithValue("@pass", p.pass);
     cmd.Parameters.AddWithValue("@isadmin", 0);
     cmd.Parameters.AddWithValue("@mail", p.mail);
     cmd.Parameters.AddWithValue("@phone", p.phone);
     cmd.ExecuteNonQuery();
 }