Exemplo n.º 1
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"));
    }
Exemplo n.º 2
0
 /// <summary>
 /// ����ʵ�������
 /// </summary>
 public wgiAdUnionSystem.Model.wgi_cash ReaderBind(IDataReader dataReader)
 {
     wgiAdUnionSystem.Model.wgi_cash model=new wgiAdUnionSystem.Model.wgi_cash();
     object ojb;
     ojb = dataReader["id"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.id=(int)ojb;
     }
     ojb = dataReader["userid"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.userid=(int)ojb;
     }
     ojb = dataReader["cash"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.cash=(decimal)ojb;
     }
     ojb = dataReader["applydate"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.applydate=(DateTime)ojb;
     }
     ojb = dataReader["status"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.status=(int)ojb;
     }
     ojb = dataReader["leftcash"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.leftcash=(decimal)ojb;
     }
     model.memo_user=dataReader["memo_user"].ToString();
     model.memo_admin=dataReader["memo_admin"].ToString();
     return model;
 }