public DataTable DanhSachChuDe() { DataTable dtbl = sql.GetDataTable("select taikhoannguoidung, a.machude, tenchude, a.ngaytao from tblchude a, tblnguoidung b, tblNguoiDung_tblChuDe c where a.machude = c.machude and b.manguoidung = c.manguoidung and c.taochude = 1 order by a.NgayTao desc"); dtbl.Columns.Add(new DataColumn("ngay", typeof(string))); foreach (DataRow dr in dtbl.Rows) { dr["ngay"] = MyFunction.NgayVietNam(Convert.ToDateTime(dr["ngaytao"])); } return(dtbl); }
public bool KiemTraDangNhap() { DataTable dtbl = sql.GetDataTable("select * from tblnguoidung where TaiKhoanNguoiDung = N'" + MyFunction.KillSqlInjection(this.TaiKhoanNguoiDung) + "' and matkhau = '" + MyFunction.KillSqlInjection(this.MatKhau) + "'"); if (dtbl.Rows.Count > 0) { this.Quyen = Convert.ToInt32(dtbl.Rows[0]["Quyen"]); this.MaNguoiDung = Convert.ToInt32(dtbl.Rows[0]["MaNguoiDung"]); return(true); } else { return(false); } }
public DataTable GetData() { string query = string.Format("select TaiKhoanNguoiDung, NoiDungChat " + "from tblChatCaNhan cnn join tblNguoiDung as nd on cnn.NguoiChat = nd.MaNguoiDung" + " where MaNguoiDung1 = {0} and MaNguoiDung2 = {1} order by cnn.NgayTao desc", maNguoiDung1, maNguoiDung2); DataTable dtbl = sql.GetDataTable(query); return(dtbl); }