public bool insTho(Accounts thoacc, ThoInfo thoinfo) { bool kt = true; try { dbProvider.ExecuteNonQueryIncludeImage("EXEC dbo.proc_insTho @uname = '" + thoacc.uname + "', @passwd = '" + thoacc.upasswd + "', @acctype = " + thoacc.vaitro + ", @fname = N'" + thoinfo.fname + "', @lname = N'" + thoinfo.lname + "', @img = ", thoinfo.hinhanh); } catch (Exception) { kt = false; throw; } return(kt); }
public ThoInfo getThoInfo(int thoid) { ThoInfo tho = new ThoInfo(); try { DataTable tblOneTho = new DataTable(); tblOneTho = dbProvider.ExecuteQuery("SELECT * FROM dbo.tho_infos WHERE userid = " + thoid); tho.fname = tblOneTho.Rows[0][1].ToString(); tho.lname = tblOneTho.Rows[0][2].ToString(); tho.hinhanh = new MemoryStream((byte[])tblOneTho.Rows[0][3]); } catch (Exception) { throw; } return(tho); }