Ejemplo n.º 1
0
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        int     tradeclient = 0, agentstaff = 0, paymode = 0;
        decimal amount = 0;

        int.TryParse(select_Client.SelectValue, out tradeclient);
        int.TryParse(ddl_AgentStaff.SelectedValue, out agentstaff);
        int.TryParse(ddl_PayMode.SelectedValue, out paymode);
        decimal.TryParse(tbx_Amount.Text, out amount);

        if (tradeclient == 0)
        {
            MessageBox.Show(this, "请选择收款客户!");
            return;
        }

        if (agentstaff == 0)
        {
            MessageBox.Show(this, "请选择收款经办人!");
            return;
        }

        if (paymode == 0)
        {
            MessageBox.Show(this, "请选择收款方式!");
            return;
        }

        if (amount == 0)
        {
            MessageBox.Show(this, "请选择收款金额!");
            return;
        }

        int ret = AC_CashFlowListBLL.Receipt_PreReceived((int)Session["OwnerClient"], tradeclient, agentstaff, paymode, amount, 0, tbx_Remark.Text, (int)Session["UserID"], 0);

        if (ret < 0)
        {
            MessageBox.Show(this, "收款失败!Ret=" + ret.ToString());
            return;
        }
        else
        {
            Response.Redirect("CashFlowList.aspx?Classify=1&TradeClient=" + tradeclient.ToString());
        }
    }