Example #1
0
        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);
        }
Example #2
0
        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);
        }