////没有结款的采购订单 //private void BindGridview5(PMPaymentBillinfo PMPaymentBillinfo) //{ // this.Gridview5.DataSource = ppb.SelectPMPurchaseOrder_NBill(PMPaymentBillinfo); // this.Gridview5.DataBind(); //} //供应商付款开票表 protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Paid")//付款详细 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview1.SelectedIndex = row.RowIndex; PMPaymentBillinfo.PMPB_ID = new Guid(e.CommandArgument.ToString()); label_PayBillID.Text = e.CommandArgument.ToString(); label_SupplyID.Text = Gridview1.DataKeys[row.RowIndex]["PMSI_ID"].ToString(); BindGridview2(PMPaymentBillinfo); label5.Text = Gridview1.Rows[row.RowIndex].Cells[2].Text.ToString(); Panel_Pay.Visible = true; UpdatePanel_Pay.Update(); } //if (e.CommandName == "Payment")//付款 //{ // GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; // Gridview1.SelectedIndex = row.RowIndex; // this.label_SupplyID.Text = this.Gridview1.DataKeys[row.RowIndex]["PMSI_ID"].ToString(); // this.label_PayBillID.Text = e.CommandArgument.ToString(); // this.label7.Text = this.Gridview1.Rows[row.RowIndex].Cells[2].Text.ToString(); // this.label_Pay.Text = "新增"; // this.TextBox3.Enabled = true; // PMPaymentBillinfo.PMSI_ID = new Guid(this.label_SupplyID.Text.ToString()); // BindGridview5(PMPaymentBillinfo); // this.Panel_NewPay.Visible = true; // this.UpdatePanel_NewPay.Update(); //} }
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(); }
//提交付款 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(); }
//关闭付款详细表 protected void Button_CPay(object sender, EventArgs e) { Panel_Pay.Visible = false; UpdatePanel_Pay.Update(); }