Example #1
0
    public string RecordOrderInfo(int shopid, int userid, string orderno, string comsumer, string itemno, int siteid, double price, double amount, double total, string itemurl)
    {
        wgiAdUnionSystem.Model.wgi_orders model = new wgiAdUnionSystem.Model.wgi_orders();
        model.cash = Convert.ToDecimal(total);
        model.companyid = shopid;
        model.consumer = comsumer;
        model.ischeck = 0;
        model.itemamount = Convert.ToDecimal(amount);
        model.itemno = itemno;
        model.itemprice = Convert.ToDecimal(price);
        //model.orderid = orderid;
        model.orderno = orderno;
        model.reason = "";
        model.siteid = siteid;
        model.time = DateTime.Now;//或传入
        model.userid = userid;

        //计算佣金
        model.pay = Convert.ToDecimal(22);

        //添加订单记录
        new wgiAdUnionSystem.BLL.wgi_orders().Add(model);

        //把佣金计入广告主
        wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();
        wgiAdUnionSystem.Model.wgi_sitehost host= bll.GetModel(userid);
        decimal newBlance= Convert.ToDecimal(host.balance) + Convert.ToDecimal(model.pay);
        bll.UpdateBlance(userid, newBlance);

        return newBlance.ToString();
    }
    private void checkpwd()
    {
        Response.ContentType = "txt/html";
        Response.Clear();

        wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();
        int userid = Convert.ToInt32(Request["userid"]);
        string pwd = Request["pwd"];
        string orignal = bll.GetModel(userid).password;
        if (orignal == pwd) Response.Write("1");

        else Response.Write("0");
        Response.End();
    }
Example #3
0
    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);
    }
Example #4
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"));
    }
Example #5
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);
    }
Example #6
0
 private void ShowInfo(int userid)
 {
     wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();
     wgiAdUnionSystem.Model.wgi_sitehost model = bll.GetModel(userid);
     this.txtemail.Text = model.email;
     this.txtmobile.Text = model.mobile;
     this.txtcontact.Text = model.contact;
     this.txtqq.Text = model.qq;
     this.txtidcard.Text = model.idcard;
     this.txtaddress.Text = model.address;
     this.txtzipcode.Text = model.zipcode;
     this.txttel.Text = model.tel;
     this.txtregdate.Text = model.regdate.ToString();
     this.txtregip.Text = model.regip;
     this.txtlastdate.Text = model.lastdate.ToString();
     this.txtlastip.Text = model.lastip;
     this.txtstatus.Text = CommonData.getAccountStatusByValue(model.status.ToString());
 }
    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);
            }

        }
    }
    /// <summary>
    /// 编辑/查看时绑定数据
    /// </summary>
    /// <param name="action">编辑传入edit,查看传入show</param>
    private void caseEdit(string action)
    {
        uid = Request.QueryString["uid"];
        if (uid == "")
        {
            Response.Write("非法进入");
            Response.End();
        }

        //绑定数据

        wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();
        wgiAdUnionSystem.Model.wgi_sitehost model = bll.GetModel(int.Parse(uid));

        this.txtusername.Text = model.username;
        this.txtpassword.Attributes.Add("value",model.password);
        this.txtpwd2.Attributes.Add("value", model.password);
        this.txtemail.Text = model.email;
        this.txtmobile.Text = model.mobile;

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

        //this.txtusertype.Text = model.usertype.ToString();

        this.txtcontact.Text = model.contact;
        this.txtqq.Text = model.qq;
        this.txtidcard.Text = model.idcard;
        this.txtaddress.Text = model.address;
        this.txtzipcode.Text = model.zipcode;
        this.txttel.Text = model.tel;

        //以下为只显示,不编辑,不新增的字段
        this.hiduid.Value = model.userid.ToString();
        this.txtbalance.Text = model.balance.ToString()+"&nbsp;元";
        this.txtregdate.Text = model.regdate.ToString();
        this.txtregip.Text = model.regip;
        this.txtlastdate.Text = model.lastdate.ToString();
        this.txtlastip.Text = model.lastip;
        this.txtstatus.Text = CommonData.getAccountStatusByValue(model.status.ToString());

        //网站信息

        if (action == "edit")
        {
            lblusername.Text = model.username;
            lblusername.Visible = true;
            txtusername.Visible = false;
            fdst_bank.Visible = false;//不允许编辑用户银行账户资料
            btnsubmit.CommandArgument = "edit";
            btncancel.Visible = false;//编辑状态下尽量不给“重置”的功能,以免误清空原用户数据

            Helper.HelperDropDownList.BindData(ddlstatus, CommonData.getAccountStatus(), "name", "value", model.status.ToString());
            ddlstatus.Visible = true;
            txtstatus.Visible = false;
        }
        else if (action == "show")
        {
            btnsubmit.Visible = false;
            btncancel.Visible = false;
            fdst_site.Visible = true;//只有查看状态下才有必要看网站信息
            trpwd1.Visible = false;//密码不允许查看,但有权更改
            trpwd2.Visible = false;

            odsData.SelectParameters["userid"].DefaultValue = uid;
            lvsite.DataSourceID = "odsData";
            lvsite.DataBind();

            foreach (Control item in this.form.Controls)
            {
                if (item is TextBox)
                {
                    (item as TextBox).Enabled = false;
                }
                else if (item.Controls.Count>0)
                {
                    foreach (Control v in item.Controls)
                    {
                        if (v is TextBox)
                        {
                            (v as TextBox).Enabled = false;
                        }

                    }
                }
            }
            txtusername.Enabled = false;

        }
    }
Example #9
0
 private void ShowInfo(int userid)
 {
     wgiAdUnionSystem.BLL.wgi_sitehost bll = new wgiAdUnionSystem.BLL.wgi_sitehost();
     wgiAdUnionSystem.Model.wgi_sitehost model = bll.GetModel(userid);
     this.txtaccountname.Text = model.accountname;
     this.txtaccountno.Text = model.accountno;
     this.txtbank.Text = model.bank;
     this.txtbranch.Text = model.branch;
 }