private void tbs_delete_Click(object sender, EventArgs e) { if (txtten.Text == "") { MessageBox.Show("Chưa chọn thông tin"); return; } quanlinguoidung qlng = new quanlinguoidung(); qlng.STT = txtstt.Text; qlng.tendangnhap = txtten.Text; qlng.matkhau = txtpass.Text; if (MessageBox.Show(string.Format("xóa người dùng"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.DeleteProfile(qlng) > 0) { MessageBox.Show("Đã xóa"); Quanlynguoidung_Load(sender, e); } else { MessageBox.Show("Thông tin chưa được xóa"); } } }
public static int DeleteProfile(quanlinguoidung ql) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("STT", ql.STT), }; return(DataProvider.ExcuteNonQuerry("xoand", para)); }
public static int InsertProfile(quanlinguoidung ql) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@tendangnhap", ql.tendangnhap), new SqlParameter("@matkhau", ql.matkhau), }; return(DataProvider.ExcuteNonQuerry("themnd", para)); }
private void tbs_save_Click(object sender, EventArgs e) { if (txtten.Text == "") { MessageBox.Show("Chưa chọn thông tin"); return; } quanlinguoidung qlng = new quanlinguoidung(); qlng.tendangnhap = txtten.Text; qlng.matkhau = txtpass.Text; if (MessageBox.Show(string.Format("Thêm người dùng"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.InsertProfile(qlng) > 0) { MessageBox.Show("Đã thêm"); Quanlynguoidung_Load(sender, e); } else { MessageBox.Show("Tên người dùng đã tồn tại"); } } }
public static int DeleteProfile(quanlinguoidung ql) { return(Dao.DeleteProfile(ql)); }
public static int UpdateProfile(quanlinguoidung ql) { return(Dao.UpdateProfile(ql)); }
public static int InsertProfile(quanlinguoidung ql) { return(Dao.InsertProfile(ql)); }