protected void UserRegisterSubmit_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");//ID Cms.BLL.C_user bll = new Cms.BLL.C_user(); Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); wxuser.UserSale wu = new wxuser.UserSale(); wxuser.userinfo xw = new wxuser.userinfo(); wu = wxuser.getUserRegister(model.openid, model.username, model.sex, model.useraddress, string.Format("{0:yyyy-MM-dd}", model.birthday), string.Format("{0:yyyy-MM-dd}", model.marryday), model.telphone, ""); if (wu.result == "更新成功") { xw = wxuser.getuserinfo(model.openid); if (xw.result == "获取成功") { model = bll.GetModel(model.id); model.usercard = xw.usercard; model.userallscore = Convert.ToInt32(Math.Round(Convert.ToDecimal(xw.userallscore)).ToString()); model.userscore = Convert.ToInt32(Math.Round(Convert.ToDecimal(xw.userscore)).ToString()); model.userYesScore = Convert.ToInt32(Math.Round(Convert.ToDecimal(xw.userallscore)).ToString()) - Convert.ToInt32(Math.Round(Convert.ToDecimal(xw.userscore)).ToString()); model.userlevel = xw.userlevel; model.shopname = xw.shopname; bll.Update(model); Literal1.Text = wu.content + "-" + wu.result; ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"注册会员\", \"" + Literal1.Text + "\", \"back\",\"Success\",\"\")", true); } else { ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"注册失败\", \"" + Literal1.Text + "\", \"back\",\"Error\",\"\")", true); } } else { ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"注册失败\", \"" + Literal1.Text + "\", \"back\",\"Error\",\"\")", true); } }
protected void btnSearch_Click(object sender, EventArgs e) { string Keywords = this.txtKeywords.Text.Trim(); wxuser.userinfo xw = new wxuser.userinfo(); xw = wxuser.getuserinfo(Keywords); Literal1.Text = xw.content + "-" + xw.result + "-" + xw.openid + "-" + xw.sex + "-" + xw.shopname + "-" + xw.telephone + "-" + xw.useraddress + "-" + xw.userallscore + "-" + xw.usercard + "-" + xw.userlevel + "-" + xw.username + "-" + xw.userscore + "-" + xw.allbuy + "-" + xw.birthday + "-" + xw.buytimes; }
protected void UserScoreSubmit_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");//ID Cms.BLL.C_user bll = new Cms.BLL.C_user(); Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); wxuser.UserSale wu = new wxuser.UserSale(); wxuser.userinfo xw = new wxuser.userinfo(); // wu = wxuser.getUserScore(model.usercard, model.openid, "1", "产品购买", "100"); // Literal1.Text = wu.content + "-" + wu.result; }
protected void UserBindSubmit_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");//ID Cms.BLL.C_user bll = new Cms.BLL.C_user(); Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); wxuser.UserSale wu = new wxuser.UserSale(); wxuser.userinfo xw = new wxuser.userinfo(); xw = wxuser.getUserBind(model.openid, model.telphone, model.usercard); Literal1.Text = xw.content + "-" + xw.result; ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"会员绑定验证\", \"" + Literal1.Text + "\", \"back\",\"Success\",\"\")", true); }
protected void UserInfoSubmit_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");//ID Cms.BLL.C_user bll = new Cms.BLL.C_user(); Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); wxuser.UserSale wu = new wxuser.UserSale(); wxuser.userinfo xw = new wxuser.userinfo(); xw = wxuser.getuserinfo(model.openid); Literal1.Text = "内容:" + xw.content + ";结果:" + xw.result + ";微信openid:" + xw.openid + ";性别:" + xw.sex + ";门店:" + xw.shopname + ";手机:" + xw.telephone + ";地址:" + xw.useraddress + ";所有积分:" + xw.userallscore + ";<br>会员卡:" + xw.usercard + ";会员等级:" + xw.userlevel + ";姓名:" + xw.username + ";未使用积分:" + xw.userscore + ";消费金额:" + xw.allbuy + ";生日:" + xw.birthday + ";结婚日期" + xw.marryday + ";消费次数:" + xw.buytimes; model.userallscore = Convert.ToInt32(xw.userallscore); model.userscore = Convert.ToInt32(xw.userscore); model.userYesScore = Convert.ToInt32(xw.userallscore) - Convert.ToInt32(xw.userscore); model.userlevel = xw.userlevel; // bll.Update(model); ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"获取会员信息\", \"" + Literal1.Text + "\", \"back\",\"Success\",\"\")", true); }
protected void UserSignSubmit_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");//ID Cms.BLL.C_user bll = new Cms.BLL.C_user(); Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); wxuser.UserSale wu = new wxuser.UserSale(); wxuser.userinfo xw = new wxuser.userinfo(); DateTime todaybegin = DateTime.Parse(DateTime.Now.ToShortDateString()); DateTime mingtianBegin = todaybegin.AddDays(1); if (!Cms.DBUtility.DbHelperSQL.Exists("select count(1) from C_integral_rec where scorename='签到领取积分' and user_id=" + model.id + "and updateTime>='" + todaybegin + "' and updateTime<'" + mingtianBegin + "'")) { wxuser.userinfo userinfo = new wxuser.userinfo(); xw = wxuser.getUserSign(model.openid, model.usercard); Literal1.Text = xw.content + "-" + xw.result; xw = wxuser.getuserinfo(model.openid); model.userallscore = Convert.ToInt32(xw.userallscore); model.userscore = Convert.ToInt32(xw.userscore); model.userYesScore = Convert.ToInt32(xw.userallscore) - Convert.ToInt32(xw.userscore); bll.Update(model); Cms.BLL.C_integral_rec integral_BLL = new Cms.BLL.C_integral_rec(); Cms.Model.C_integral_rec integral_model = new Cms.Model.C_integral_rec(); integral_model.article_id = 1; integral_model.user_id = model.id; integral_model.usercard = model.usercard; integral_model.openid = model.openid; integral_model.numberid = "2"; integral_model.scorename = "签到领取积分"; integral_model.title = "签到领取积分"; integral_model.wescore = 2000; integral_model.quantity = 1; integral_model.type = 0; integral_model.updateTime = DateTime.Now; integral_BLL.Add(integral_model); ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"会员签到\", \"" + Literal1.Text + "\", \"back\",\"Success\",\"\")", true); } else { ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"您今日已经签到过了\", \"您今日已经签到过了\", \"back\",\"Error\",\"\")", true); } }
protected void UserSaleSubmit_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");//ID Cms.BLL.C_user bll = new Cms.BLL.C_user(); Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); wxuser.UserSale wu = new wxuser.UserSale(); wxuser.userinfo xw = new wxuser.userinfo(); List <wxuser.UserSale> list = new List <wxuser.UserSale>(); list = wxuser.getUserSale(model.openid, model.usercard); for (int i = 0; i < list.Count; i++) { wxuser.UserSale ux = new wxuser.UserSale(); ux = list[i]; Literal1.Text = ux.content + "-" + ux.result + "||"; } ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"消费列表\", \"" + Literal1.Text + "\", \"back\",\"Success\",\"\")", true); }
protected void UserUpdateSubmit_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");//ID Cms.BLL.C_user bll = new Cms.BLL.C_user(); Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); wxuser.userinfo xw = new wxuser.userinfo(); xw = wxuser.getUserUpdate(model.openid, model.usercard, model.username, model.sex, model.useraddress, string.Format("{0:yyyy-MM-dd}", model.birthday), string.Format("{0:yyyy-MM-dd}", model.marryday), model.telphone, model.shopcode); if (xw.result == "更新成功") { Literal1.Text = xw.content + "-" + xw.result; ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"更新会员信息\", \"" + Literal1.Text + "\", \"back\",\"Success\",\"\")", true); } else { Literal1.Text = xw.content + "-" + xw.result; ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", "parent.jsdialog(\"更新会员信息\", \"" + Literal1.Text + "\", \"back\",\"Success\",\"\")", true); } }
public void UpdateUser(int user_id) { Cms.Model.C_user muser = new Cms.BLL.C_user().GetModel(user_id); //设置更新会员 wxuser.UserSale wu = new wxuser.UserSale(); wxuser.userinfo xw = new wxuser.userinfo(); xw = wxuser.getuserinfo(muser.openid); if (xw.result == "获取失败") { wu = wxuser.getUserRegister(muser.openid, muser.username, muser.sex, muser.useraddress, string.Format("{0:yyyy-MM-dd}", muser.birthday), string.Format("{0:yyyy-MM-dd}", muser.marryday), muser.telphone, muser.shopcode); //Literal1.Text = wu.content + "-" + wu.result + "-" + wu.usercard; xw = wxuser.getuserinfo(muser.openid); string UpdateSql = "update C_user set usercard='" + xw.usercard + "' where id=" + user_id; int counts = Cms.DBUtility.DbHelperSQL.ExecuteSql(UpdateSql);//修改 if (counts > 0) { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), muser.username); //记录日志 JscriptMsg("绑定成功!", "userlist.aspx", "Success"); } else { JscriptMsg("绑定失败!", "userlist.aspx", "Success"); } } else { string UpdateSql = "update C_user set usercard='" + xw.usercard + "' where id=" + user_id; int counts = Cms.DBUtility.DbHelperSQL.ExecuteSql(UpdateSql);//修改 if (counts > 0) { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), muser.username); //记录日志 JscriptMsg("绑定成功!", "userlist.aspx", "Success"); } else { JscriptMsg("绑定失败!", "userlist.aspx", "Success"); } } }