Пример #1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(TravelAgent.Model.ClubPoints model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ClubPoints(");
            strSql.Append("clubid,Content,points,remark,pType,adddate)");
            strSql.Append(" values (");
            strSql.Append("@clubid,@Content,@points,@remark,@pType,@adddate)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@clubid",  SqlDbType.Int),
                new SqlParameter("@Content", SqlDbType.VarChar),
                new SqlParameter("@points",  SqlDbType.Int),
                new SqlParameter("@remark",  SqlDbType.VarChar),
                new SqlParameter("@pType",   SqlDbType.Int),
                new SqlParameter("@adddate", SqlDbType.DateTime)
            };
            parameters[0].Value = model.clubid;
            parameters[1].Value = model.Content;
            parameters[2].Value = model.points;
            parameters[3].Value = model.remark;
            parameters[4].Value = model.pType;
            parameters[5].Value = model.adddate;
            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "会员注册-" + Master.webinfo.WebName;
            if (!this.IsPostBack)
            {
                TravelAgent.Model.InfoSetting info = new TravelAgent.Model.InfoSetting();
                info.ds            = bll.GetList();
                strMemberAgreement = info.getValue("RegFWTK");
                if (Request["type"] != null)
                {
                    string strTag = Request["type"];
                    TravelAgent.Model.Club model = new TravelAgent.Model.Club();
                    if (strTag.Equals("mobile"))
                    {
                        model.clubMobile = Request["mobile"];
                        model.clubName   = "club" + model.clubMobile;
                    }
                    else
                    {
                        model.clubEmail = Request["email"];
                        model.clubName  = "club" + model.clubEmail;
                    }
                    model.clubPwd = Request["password"];
                    model.isLock  = 1;

                    int userid = ClubBll.Add(model);
                    if (userid > 0)
                    {
                        //积分开始
                        TravelAgent.Model.ClubPoints points = new TravelAgent.Model.ClubPoints();
                        points.clubid  = userid;
                        points.Content = "首次注册";
                        points.points  = Master.webinfo.FristReg;
                        points.remark  = "";
                        points.pType   = Convert.ToInt32(TravelAgent.Tool.EnumSummary.PointsType.注册);
                        points.adddate = DateTime.Now;
                        PointsBll.Add(points);

                        string strsql = "update Club set currentPoints=currentPoints+" + Master.webinfo.FristReg + " where Id=" + userid;
                        //Access
                        //TravelAgent.Tool.DbHelperOleDb.ExecuteSql(strsql);
                        //SQL
                        TravelAgent.Tool.DbHelperSQL.ExecuteSql(strsql);
                        //积分结束

                        TravelAgent.Tool.CookieHelper.SetCookie("uid", userid.ToString());
                        TravelAgent.Tool.CookieHelper.SetCookie("username", model.clubName);
                        Response.Redirect("/member/Index.aspx");
                    }
                    else
                    {
                        Response.Redirect("/Opr.aspx?t=error&msg=opr", false);
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "验证成功-" + Master.webinfo.WebName;
            string strUid = TravelAgent.Tool.CookieHelper.GetCookieValue("uid");

            if (string.IsNullOrEmpty(strUid))
            {
                Response.Redirect("/member/Login.aspx");
            }
            else
            {
                club = clubBll.GetModel(Convert.ToInt32(strUid));
            }
            if (!this.IsPostBack)
            {
                if (Request["email"] != null)
                {
                    string strEmail = Server.UrlDecode(Request["email"]);
                    this.ltEmail.Text = strEmail;
                    string strsql = "update Club set clubEmail='" + strEmail + "',emailIsValid=1 where Id=" + club.id + ";";
                    try
                    {
                        //第一次验证赠送
                        if (club.emailIsValid == 0)
                        {
                            //积分开始
                            TravelAgent.Model.ClubPoints points = new TravelAgent.Model.ClubPoints();
                            points.clubid  = club.id;
                            points.Content = "验证邮箱";
                            points.points  = webinfo.EmailValidate;
                            points.remark  = "";
                            points.pType   = Convert.ToInt32(TravelAgent.Tool.EnumSummary.PointsType.邮箱验证);
                            points.adddate = DateTime.Now;
                            PointsBll.Add(points);

                            strsql += "update Club set currentPoints=currentPoints+" + webinfo.EmailValidate + " where Id=" + club.id;
                            //TravelAgent.Tool.DbHelperOleDb.ExecuteSql(strsql);
                            //积分结束
                        }
                        //Access
                        //TravelAgent.Tool.DbHelperOleDb.ExecuteSql(strsql);
                        //SQL
                        TravelAgent.Tool.DbHelperSQL.ExecuteSql(strsql);
                    }
                    catch
                    {
                        Response.Redirect("/Opr.aspx?t=error&msg=opr");
                    }
                }
                else
                {
                    Response.Redirect("/Opr.aspx?t=error&msg=opr");
                }
            }
        }
Пример #4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public TravelAgent.Model.ClubPoints GetModel(int Id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 * from ClubPoints ");
            strSql.Append(" where id=@Id ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Id", SqlDbType.Int, 4)
            };
            parameters[0].Value = Id;

            TravelAgent.Model.ClubPoints model = new TravelAgent.Model.ClubPoints();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["clubid"].ToString() != "")
                {
                    model.clubid = int.Parse(ds.Tables[0].Rows[0]["clubid"].ToString());
                }

                model.Content = ds.Tables[0].Rows[0]["Content"].ToString();
                if (ds.Tables[0].Rows[0]["points"].ToString() != "")
                {
                    model.points = int.Parse(ds.Tables[0].Rows[0]["points"].ToString());
                }
                model.remark = ds.Tables[0].Rows[0]["remark"].ToString();
                if (ds.Tables[0].Rows[0]["pType"].ToString() != "")
                {
                    model.pType = int.Parse(ds.Tables[0].Rows[0]["pType"].ToString());
                }
                model.adddate = DateTime.Parse(ds.Tables[0].Rows[0]["adddate"].ToString());
                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(TravelAgent.Model.ClubPoints model)
 {
     dal.Add(model);
 }