using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace norke
{
    public partial class Company_company : System.Web.UI.Page
    {
        public string imgname;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    jieshao();
                    gy();
                    qg();
                    zs();
                    upphb();
                }
                catch
                { }
            }
        }
        private void upphb()
        {           
            DBConn mydb = new DBConn();
            string sql = "update muser set phb=(select phb from muser where hyname='" + Request.QueryString["name"].ToString() + "') +1 where hyname='" + Request.QueryString["name"].ToString() + "'";
            mydb.Update(sql);
            mydb.Close();
        }
        void jieshao()
        {
            DBConn mydb = new DBConn();
            string sql = "select gsjs,cimg from muser where hyname='" + Request.QueryString["name"].ToString() + "'";
            SqlDataReader dr = mydb.getDataReader(sql);
            if (dr.Read())
            {
                Label1.Text = dr["gsjs"].ToString();
                imgname = dr["cimg"].ToString();
            }
            dr.Close();
            mydb.Close();
        }
        void gy()
        {
            DBConn mydb = new DBConn();
            string sql = "select count(*) as yj from Products where uname='" + Request.QueryString["name"].ToString() + "'";
            SqlDataReader dr = mydb.getDataReader(sql);
            if (dr.Read())
            {
                Label2.Text = dr["yj"].ToString();
                if (Label2.Text == "")
                {
                    Label2.Text = "0";
                }
            }
            dr.Close();
            mydb.Close();
        }
        void qg()
        {
            DBConn mydb = new DBConn();
            string sql = "select count(*) as yj from qqproduct where uname='" + Request.QueryString["name"].ToString() + "'";
            SqlDataReader dr = mydb.getDataReader(sql);
            if (dr.Read())
            {
                Label3.Text = dr["yj"].ToString();
                if (Label3.Text == "")
                {
                    Label3.Text = "0";
                }
            }
            dr.Close();
            mydb.Close();
        }
        void zs()
        {
            DBConn mydb = new DBConn();
            string sql = "select count(*) as yj from zhaoshang where hyname='" + Request.QueryString["name"].ToString() + "'";
            SqlDataReader dr = mydb.getDataReader(sql);
            if (dr.Read())
            {
                Label4.Text = dr["yj"].ToString();
                if (Label4.Text == "")
                {
                    Label4.Text = "0";
                }
            }
            dr.Close();
            mydb.Close();
        }
    }
}
