Exemplo n.º 1
0
    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);
        }
    }
Exemplo n.º 2
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string strparentId = this.Request.QueryString["parentId"] ?? "";//上级栏目ID

        foreach (RepeaterItem item in rptList.Items)
        {
            //获取选择框
            CheckBox check = item.FindControl("Check_Select") as CheckBox;
            if (check.Checked)
            {
                HiddenField field = item.FindControl("Fielddocid") as HiddenField;

                int id = int.Parse(field.Value);
                //删除文档的同时删除静态文档
                adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), blluser.GetModel(id).username); //记录日志
                blluser.Delete(id);
            }
        }
        JscriptMsg("删除信息成功!", "userlist.aspx", "Success");
    }