Exemple #1
0
 //取消付款
 protected void Button_Sena(object sender, EventArgs e)
 {
     TextBox3.Text = "";
     DropDownList1.SelectedValue = "请选择";
     TextBox5.Text        = "";
     Panel_NewPay.Visible = false;
     UpdatePanel_NewPay.Update();
 }
Exemple #2
0
 protected void Gridview7_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Foin")//付款
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Gridview7.SelectedIndex    = row.RowIndex;
         label_PurchaseOrderID.Text = e.CommandArgument.ToString();
         label7.Text          = Gridview7.Rows[row.RowIndex].Cells[1].Text.ToString() + "付款";
         Panel_NewPay.Visible = true;
         UpdatePanel_NewPay.Update();
     }
 }
Exemple #3
0
    protected void Button_Sh2(object sender, EventArgs e)
    {
        string condition = Getcondition();

        BindGridview1(condition);
        UpdatePanel_PayBill.Update();
        Panel_NewPayBill.Visible = false;
        UpdatePanel_NewPayBill.Update();
        Panel_Supply.Visible = false;
        UpdatePanel_Supply.Update();

        Panel_Pay.Visible = false;
        UpdatePanel_Pay.Update();

        Panel_NewPay.Visible = false;
        UpdatePanel_NewPay.Update();
    }
Exemple #4
0
 //付款详细表
 protected void Gridview2_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Morise")//修改
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Gridview2.SelectedIndex     = row.RowIndex;
         label_PayID.Text            = e.CommandArgument.ToString();
         label_Pay.Text              = "修改";
         TextBox3.Enabled            = false;
         TextBox3.Text               = Gridview2.Rows[row.RowIndex].Cells[1].Text.ToString();
         label_PayMoney.Text         = TextBox3.Text;
         DropDownList1.SelectedValue = Gridview2.Rows[row.RowIndex].Cells[2].Text.ToString();
         TextBox5.Text               = Gridview2.Rows[row.RowIndex].Cells[3].Text.ToString();
         //PMPaymentBillinfo.PMSI_ID = new Guid(this.label_SupplyID.Text.ToString());
         //BindGridview5(PMPaymentBillinfo);
         Panel_NewPay.Visible = true;
         UpdatePanel_NewPay.Update();
     }
 }
Exemple #5
0
    //提交付款
    protected void Button_Kity(object sender, EventArgs e)
    {
        if (TextBox3.Text != "")
        {
            PMPaymentBillinfo.PMPD_Pay = Convert.ToDecimal(TextBox3.Text.ToString());
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewPay, GetType(), "alert", "alert('请填写付款金额!')", true);
            return;
        }
        if (DropDownList1.SelectedValue != "请选择")
        {
            PMPaymentBillinfo.PMPD_PayWay = DropDownList1.SelectedValue.ToString();
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewPay, GetType(), "alert", "alert('请选择付款方式!')", true);
            return;
        }
        if (TextBox5.Text != "")
        {
            PMPaymentBillinfo.PMPD_PayTime = Convert.ToDateTime(TextBox5.Text.ToString());
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewPay, GetType(), "alert", "alert('请填写付款日期!')", true);
            return;
        }


        bool    temp = false;
        Decimal dl   = 0;

        Decimal dml = Convert.ToDecimal(TextBox3.Text.ToString());

        //foreach (GridViewRow item in Gridview5.Rows)
        //{
        //CheckBox rb = item.FindControl("CheckBoxMarry") as CheckBox;
        //if (rb.Checked)
        //{
        dl   = Convert.ToDecimal(Gridview7.Rows[Gridview7.SelectedIndex].Cells[6].Text.ToString());
        temp = true;

        if (dml == dl)        //金额相等
        {
            label_PurchaseOrderID.Text             = Gridview7.DataKeys[Gridview7.SelectedIndex].Value.ToString();
            PMPaymentBillinfo.PMPO_PurchaseOrderID = new Guid(label_PurchaseOrderID.Text);
            PMPaymentBillinfo.PMPO_AlreadyPay      = "是";
            PMPaymentBillinfo.PMPO_ResidueMoney    = 0;
            ppb.UpdatePMPO_AlreadyPay(PMPaymentBillinfo);
        }
        if (dml < dl)        //付款金额小于勾选订单的剩余付款
        {
            label_PurchaseOrderID.Text             = Gridview7.DataKeys[Gridview7.SelectedIndex].Value.ToString();
            PMPaymentBillinfo.PMPO_PurchaseOrderID = new Guid(label_PurchaseOrderID.Text);
            PMPaymentBillinfo.PMPO_AlreadyPay      = "否";
            PMPaymentBillinfo.PMPO_ResidueMoney    = dl - dml;
            ppb.UpdatePMPO_AlreadyPay(PMPaymentBillinfo);
        }
        if (dml > dl)        //付款金额大于采购订单的剩余付款
        {
            ScriptManager.RegisterClientScriptBlock(Page, GetType(), "aa", "alert('付款金额大于采购订单剩余付款金额!')", true);
            return;
        }
        //dml = dml - dl;
        //}
        //}
        string    stg = "and PMPO_PurchaseOrderID='" + new Guid(Gridview7.DataKeys[Gridview7.SelectedIndex].Value.ToString()) + "'";
        DataSet   dss = ppb.SelectPMPurchaseOrder(stg);
        DataTable dtt = dss.Tables[0];

        if (dtt.Rows.Count > 0)
        {
            label_SupplyID.Text = dtt.Rows[0][1].ToString();
        }
        string    condition = "and PMPaymentBill.PMSI_ID='" + new Guid(label_SupplyID.Text) + "'";
        DataSet   ds        = ppb.SelectPMPaymentBill(condition);
        DataTable dt        = ds.Tables[0];

        if (dt.Rows.Count > 0)
        {
            label_PayBillID.Text = dt.Rows[0][0].ToString();
        }

        PMPaymentBillinfo.PMPB_ID = new Guid(label_PayBillID.Text);
        if (label_Pay.Text == "新增")
        {
            //if (!temp)
            //{
            //    ScriptManager.RegisterClientScriptBlock(this.UpdatePanel_NewPay, this.GetType(), "aa", "alert('请选择采购订单')", true);
            //    return;
            //}
            //else
            //{
            ppb.UpdatePMPaymentBill_Payment(PMPaymentBillinfo);
            PMPaymentBillinfo.PMPD_Man = Session["UserName"].ToString();
            ppb.InsertPMPaymentIDetail(PMPaymentBillinfo);
            //}
        }
        if (label_Pay.Text == "修改")
        {
            PMPaymentBillinfo.PMPD_ID = new Guid(label_PayID.Text);

            PMPaymentBillinfo.PMPB_ID = new Guid(label_PayBillID.Text);
            BindGridview2(PMPaymentBillinfo);
            UpdatePanel_Pay.Update();
            PMPaymentBillinfo.PMPD_Pay = Convert.ToDecimal(Convert.ToDecimal(TextBox3.Text.ToString()) - Convert.ToDecimal(label_PayMoney.Text));
            ppb.UpdatePMPaymentIDetail(PMPaymentBillinfo);
        }

        TextBox3.Text = "";
        DropDownList1.SelectedValue = "请选择";
        TextBox5.Text        = "";
        Panel_NewPay.Visible = false;
        UpdatePanel_NewPay.Update();
        BindGridview1("");
        UpdatePanel_PayBill.Update();
        BindGridview7("");
        UpdatePanel3.Update();
    }