Ejemplo n.º 1
0
 public static void UpdateStaff(staffModel staff)
 {
     using (IDbConnection cnn = new SqlConnection("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=rockBottomHigh_DB;Integrated Security=True;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"))
     {
         cnn.Query <staffModel>("update staff set fname=(@fname), lname=(@lname), age=(@age), dateOfHire=(@dateOfHire), jobTitle=(@jobTitle) where StaffId=(@StaffId)", staff);
     }
 }
Ejemplo n.º 2
0
 public static void CreateNewStaff(staffModel staff)
 {
     using (IDbConnection cnn = new SqlConnection("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=rockBottomHigh_DB;Integrated Security=True;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"))
     {
         cnn.Query <staffModel>("insert into staff (fname, lname,age, dateOfHire,jobTitle) values(@fname, @lname, @age, @dateOfHire, @jobTitle)", staff);
     }
 }
Ejemplo n.º 3
0
 public IActionResult StaffCreate(staffModel m)
 {
     StaffDataAccess.CreateNewStaff(m);
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 4
0
 public IActionResult UpdateStaff(staffModel m)
 {
     StaffDataAccess.UpdateStaff(m);
     return(RedirectToAction("Index"));
 }