public void EditProfille(Pearson p) { string s = "UPDATE Users " + "set FirstName = '" + p.FirstName + "' , LastName = '" + p.LastName + "' , Email = '" + p.Email + "' , Address = '" + p.Adress + "' , PhoneNumber = '" + p.Phone + "' " + "where Login_name = '" + p.UserName + "'"; SqlCommand cmd = new SqlCommand(s, con.connect); cmd.ExecuteNonQuery(); }
public void Register(Pearson p) { string s = "INSERT INTO Login (Login_name, Password, Block, Type)" + "VALUES ('" + p.UserName + "','" + p.Password + "', 'No' , '" + p.Type + "');"; SqlCommand cmd = new SqlCommand(s, con.connect); cmd.ExecuteNonQuery(); s = "INSERT INTO Users(Login_name , FirstName , LastName , PhoneNumber , Address , Email ,Password, Type) " + "VALUES ('" + p.UserName + "','" + p.FirstName + "', '" + p.LastName + "' , '" + p.Phone + "' , '" + p.Adress + "' , '" + p.Email + "','" + p.Password + "', '" + p.Type + "');"; cmd = new SqlCommand(s, con.connect); cmd.ExecuteNonQuery(); }
public Edit_profile(Pearson user1) { InitializeComponent(); user = user1; }