コード例 #1
0
ファイル: bank.aspx.cs プロジェクト: TheProjecter/wgiadunion
    public void btnUpdate_Click(object sender, EventArgs e)
    {
        string strErr = "";
        if (this.txtaccountname.Text == "")
        {
            strErr += "accountname不能为空!\\n";
        }
        if (this.txtaccountno.Text == "")
        {
            strErr += "accountno不能为空!\\n";
        }
        if (this.txtbank.Text == "")
        {
            strErr += "bank不能为空!\\n";
        }
        if (this.txtbranch.Text == "")
        {
            strErr += "branch不能为空!\\n";
        }

        if (strErr != "")
        {
            MessageBox.Show(this, strErr);
            return;
        }

        string accountname = this.txtaccountname.Text;
        string accountno = this.txtaccountno.Text;
        string bank = this.txtbank.Text;
        string branch = this.txtbranch.Text;

        wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();

        wgiAdUnionSystem.Model.wgi_sitehost model = bll.GetModel(userid);
        model.accountname = accountname;
        model.accountno = accountno;
        model.bank = bank;
        model.branch = branch;

        ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('资料修改成功');", true);
        bll.Update(model);
    }
コード例 #2
0
    protected void applyclick(object sender, EventArgs e)
    {
        decimal amount = 0.00M;
        try
        {
            amount = Convert.ToDecimal(txtapplyamount.Text);
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('请输入合理的数字金额');", true);
            return;
        }
        if (amount < 100)
        {
            ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('最少提取100元');", true);
            return;
        }

        wgiAdUnionSystem.Model.wgi_cash model = new wgiAdUnionSystem.Model.wgi_cash();
        model.status = 1;
        model.applydate = DateTime.Now;
        model.cash = amount;
        model.memo_user = txtapplyremark.Text;
        model.userid = userid;

        new wgiAdUnionSystem.BLL.wgi_cash().Add(model);

        //成功递交申请后,可支付佣金送去相应数目
        wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();
        wgiAdUnionSystem.Model.wgi_sitehost model2 = bll.GetModel(userid);
        model2.balance -= amount;
        bll.Update(model2);

        //Response.Redirect("applyfee.aspx");
        Response.Write(Helper.HelperString.getAlertJumpString("申请成功", "applyfee.aspx"));
    }
コード例 #3
0
    public void btnUpdate_Click(object sender, EventArgs e)
    {
        string strErr = "";
        if (this.txtemail.Text == "")
        {
            strErr += "email不能为空!\\n";
        }
        if (this.txtmobile.Text == "")
        {
            strErr += "mobile不能为空!\\n";
        }
        if (this.txtcontact.Text == "")
        {
            strErr += "contact不能为空!\\n";
        }
        if (this.txtqq.Text == "")
        {
            strErr += "qq不能为空!\\n";
        }
        if (this.txtidcard.Text == "")
        {
            strErr += "idcard不能为空!\\n";
        }
        if (this.txtaddress.Text == "")
        {
            strErr += "address不能为空!\\n";
        }
        if (this.txtzipcode.Text == "")
        {
            strErr += "zipcode不能为空!\\n";
        }
        if (this.txttel.Text == "")
        {
            strErr += "tel不能为空!\\n";
        }

        if (strErr != "")
        {
            MessageBox.Show(this, strErr);
            return;
        }

        string email = this.txtemail.Text;
        string mobile = this.txtmobile.Text;
        string contact = this.txtcontact.Text;
        string qq = this.txtqq.Text;
        string idcard = this.txtidcard.Text;
        string address = this.txtaddress.Text;
        string zipcode = this.txtzipcode.Text;
        string tel = this.txttel.Text;

        wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();

        wgiAdUnionSystem.Model.wgi_sitehost model = bll.GetModel(userid);
        model.email = email;
        model.mobile = mobile;
        model.contact = contact;
        model.qq = qq;
        model.idcard = idcard;
        model.address = address;
        model.zipcode = zipcode;
        model.tel = tel;

        ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('资料修改成功');", true);
        bll.Update(model);
    }
コード例 #4
0
    protected void dosubmit(object sender, CommandEventArgs e)
    {
        wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();

        string username = "";

        if (e.CommandArgument.ToString() == "add")
        {
            username = this.txtusername.Text;
            if (bll.GetListByUsername(username).Tables[0].Rows.Count > 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('用户名已被使用');", true);
                return;
            }
        }

        string password = this.txtpassword.Text;
        string email = this.txtemail.Text;
        string mobile = this.txtmobile.Text;
        string accountname = this.txtaccountname.Text;
        string accountno = this.txtaccountno.Text;
        string bank = this.txtbank.Text;
        string branch = this.txtbranch.Text;
        int usertype = 1;//usertype是个人/网站/博客等,因为已经在usersite里面可以多重定义,所以改为用户在系统里的类型,如网站主,广告主
        string contact = this.txtcontact.Text;
        string qq = this.txtqq.Text;
        string idcard = this.txtidcard.Text;
        string address = this.txtaddress.Text;
        string zipcode = this.txtzipcode.Text;
        string tel = this.txttel.Text;
        decimal balance = Convert.ToDecimal(0.00);
        DateTime regdate = DateTime.Now;
        string regip = CommonData.GetIp(this.Page);
        //DateTime lastdate = DateTime.Now;
        //string lastip = "";
        int status = 1;//0表示尚未审核通过,暂时默认网站主注册即通过

        if (e.CommandArgument.ToString() == "add")
        {
            wgiAdUnionSystem.Model.wgi_sitehost model = new wgiAdUnionSystem.Model.wgi_sitehost();
            model.username = username;
            model.password = password;
            model.email = email;
            model.mobile = mobile;
            model.contact = contact;
            model.qq = qq;
            model.idcard = idcard;
            model.address = address;
            model.zipcode = zipcode;
            model.tel = tel;

            //银行账户信息允许管理员添加,却不允许管理员更改
            model.accountname = accountname;
            model.accountno = accountno;
            model.bank = bank;
            model.branch = branch;

            //账号状态信息自动读取,不允许编辑
            //model.balance = balance;
            //model.lastdate = lastdate;
            //model.lastip = lastip;
            model.regdate = regdate;
            model.regip = regip;
            model.usertype = usertype;
            model.status = status;

            try
            {
                bll.Add(model);

                ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('添加成功');top.location=top.location;", true);
            }
            catch (Exception)
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('内部错误');", true);
            }
        }
        else if (e.CommandArgument.ToString() == "edit")
        {
            try
            {
                int userid = int.Parse(this.hiduid.Value);

                wgiAdUnionSystem.Model.wgi_sitehost model = bll.GetModel(userid);

                model.password = password;
                model.email = email;
                model.mobile = mobile;
                model.contact = contact;
                model.qq = qq;
                model.idcard = idcard;
                model.address = address;
                model.zipcode = zipcode;
                model.tel = tel;
                if (ddlstatus.Visible = true) model.status = int.Parse(ddlstatus.Text);

                bll.Update(model);

                ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('修改成功');top.location=top.location;", true);
            }
            catch (Exception)
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('内部错误');", true);
            }

        }
    }