public void update(TaiKhoanDTO info) { string updateCommand = "UPDATE TaiKhoan " + "SET MatKhau = '" + info.MatKhau + "', " + " QuyenTruyCap = '" + info.QuyenTruyCap + "', " + " WHERE TenDangNhap = '" + info.TenDangNhap + "'"; executeNonQuery(updateCommand); }
protected override object GetDataFromDataRow(DataTable dt, int i) { TaiKhoanDTO tk = new TaiKhoanDTO(); tk.TenDangNhap = dt.Rows[i]["TenDangNhap"].ToString(); tk.MatKhau = dt.Rows[i]["MatKhau"].ToString(); tk.QuyenTruyCap = dt.Rows[i]["QuyenTruyCap"].ToString(); return (object)tk; }
public void insert(TaiKhoanDTO info) { string insertCommand = "INSERT INTO TaiKhoan VALUES('" + info.TenDangNhap + "', '" + info.MatKhau + "', '" + info.QuyenTruyCap + ")"; executeNonQuery(insertCommand); }