Пример #1
0
        public bool login(string userid, string userpwd)
        {
            DataProviders providers = new DataProviders();

            userid  = new system().ChkSql(userid);
            userpwd = new system().ChkSql(userpwd);
            SqlDataReader reader = providers.ExecuteSqlDataReader("select * from mhcmember.dbo.chr_log_info where id_loginid='" + userid + "' and id_passwd='" + userpwd + "'");

            if (reader.Read())
            {
                /* if (userid == "w1g2i3n4u5i6")
                 * {
                 *   this.Session["admin_id"] = "wginui";
                 * }*/
                this.Session["useridx"]   = reader["propid"].ToString();
                this.Session["commendid"] = reader["webcommendid"].ToString();
                this.Session["userid"]    = userid;
                this.Session["webgold"]   = reader["webgold"].ToString();
                this.Session["weblevel"]  = reader["weblevel"].ToString();
                this.Session["webbank"]   = reader["webbank"].ToString();
                reader.Close();
                providers.CloseConn();
                return(true);
            }
            reader.Close();
            providers.CloseConn();
            return(false);
        }
Пример #2
0
 private void Page_Load(object sender, EventArgs e)
 {
     new system().loadConfig(0);
     if (this.Session["userid"] == null)
     {
         base.Response.Redirect("login.aspx?returnurl=" + base.Request.ServerVariables["SCRIPT_NAME"]);
     }
     if (base.Request.QueryString["id"] != null)
     {
         DataProviders providers = new DataProviders();
         SqlDataReader reader    = providers.ExecuteSqlDataReader("select * from web_publicsale" + (" where id=" + int.Parse(base.Request.QueryString["id"]).ToString()));
         if (reader.Read())
         {
             this.strtitle     = reader["title"].ToString();
             this.stradddate   = reader["adddate"].ToString();
             this.strenddate   = reader["enddate"].ToString();
             this.strwinuserid = reader["winuserid"].ToString();
             string str2 = this.strwinuserid.Substring(0, 1).ToString();
             string str3 = this.strwinuserid.Substring(3).ToString();
             this.strwinuserid = str2 + "**" + str3;
             this.strwinprice  = reader["winprice"].ToString();
             this.strcontent   = reader["content"].ToString();
             reader.Close();
             providers.CloseConn();
         }
         else
         {
             reader.Close();
             providers.CloseConn();
             base.Response.Redirect("publicsale.aspx");
         }
     }
     else
     {
         base.Response.Redirect("publicsale.aspx");
     }
 }
Пример #3
0
Файл: buy.cs Проект: tbs005/---
 private void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["useridx"] != null)
     {
         if (!this.Page.IsPostBack)
         {
             this.DropDownList1.DataSource     = new DataProviders().ExecuteSqlDs("select character_idx,character_name from mhgame..tb_character  where substring(character_name,1,1)!='@' and user_idx=" + this.Session["useridx"].ToString(), "DropDownList1");
             this.DropDownList1.DataTextField  = "character_name";
             this.DropDownList1.DataValueField = "character_idx";
             this.DropDownList1.DataBind();
             for (int i = 0; i < this.DropDownList1.Items.Count; i++)
             {
                 this.DropDownList1.Items[i].Text = new system().ConvertToBig5(this.DropDownList1.Items[i].Text.ToString(), 950);
             }
         }
     }
     else
     {
         base.Response.Redirect("login.aspx?returnurl=/shop.aspx");
     }
     if (base.Request.QueryString["id"] != null)
     {
         DataProviders providers = new DataProviders();
         id = int.Parse(base.Request.QueryString["ID"]);
         SqlDataReader reader = providers.ExecuteSqlDataReader("select a.*,b.isbb from web_item a,web_itemtype b where a.type=b.id and a.id=" + id);
         if (reader.Read())
         {
             this.name       = reader["name"].ToString();
             this.comment    = reader["comment"].ToString();
             itemid          = int.Parse(reader["itemid"].ToString());
             this.isbb       = int.Parse(reader["isbb"].ToString());
             this.pic        = reader["pic"].ToString();
             this.price      = float.Parse(reader["price"].ToString());
             this.gold       = float.Parse(reader["gold"].ToString());
             this.iprice     = (int)this.price;
             this.igold      = (int)this.gold;
             this.priceoffer = (int)(this.price * float.Parse(base.Application["game.vipoffer"].ToString()));
             this.goldoffer  = (int)(this.gold * float.Parse(base.Application["game.vipoffer"].ToString()));
             p = (int)this.price;
             g = (int)this.gold;
             if (this.Session["weblevel"].ToString() == "1")
             {
                 p        = this.priceoffer;
                 g        = this.goldoffer;
                 this.vip = "黃金會員";
             }
             if (this.Session["weblevel"].ToString() == "2")
             {
                 p        = this.priceoffer;
                 g        = this.goldoffer;
                 this.vip = "白金會員";
             }
             if (this.Session["weblevel"].ToString() == "3")
             {
                 p        = this.priceoffer;
                 g        = this.goldoffer;
                 this.vip = "鑽石會員";
             }
             else if (this.Session["weblevel"].ToString() == "0")
             {
                 p        = (int)this.price;
                 g        = (int)this.gold;
                 this.vip = "普通會員";
             }
         }
         else
         {
             reader.Close();
             providers.CloseConn();
             base.Response.Redirect("shop.aspx");
         }
         reader.Close();
         providers.CloseConn();
     }
     else
     {
         base.Response.Redirect("shop.aspx");
     }
 }