/// <summary> /// 加载支付数据 /// </summary> /// <param name="paymentID"></param> private void LoadData(string paymentID) { RegPaymentManager manager = new RegPaymentManager(); EtNet_Models.RegPayment regpayment = manager.GetModel(paymentID); if (regpayment != null) { lblIsPay.Text = regpayment.payStatus == 1 ? "已支付" : "未支付"; //是否支付 if (regpayment.payStatus == 1) { lblPayer.Text = regpayment.payerName; //支付人 lblPaymentDate.Text = regpayment.paymentDate.ToString("yyyy-MM-dd"); //支付时间 } else { lblPayer.Text = ""; lblPaymentDate.Text = ""; } lblHasInvoice.Text = regpayment.hasInvoice == 1 ? "已收到" : "未收到"; //是否收到发票 if (regpayment.hasInvoice == 1) { lblHasInvoiceDate.Text = regpayment.hasInvoiceDate.ToString("yyyy-MM-dd"); //收到发票日期 } else { lblHasInvoiceDate.Text = ""; } lblpz.Text = regpayment.payRemark; //凭证 } }
/// <summary> /// 保存数据 /// </summary> /// <param name="nodes"></param> /// <returns></returns> protected void btnSave_Click(object sender, ImageClickEventArgs e) { RegPaymentManager bRegP = new RegPaymentManager(); RegPaymentInvoiceManager regPaymentInvoiceManager = new RegPaymentInvoiceManager(); To_PaymentManager to_PaymentManager = new To_PaymentManager(); //更新财务支付 to_PaymentManager.UpdateReg(Request.QueryString["payid"], chkIsPay.Checked ? "1" : "0"); //财务登记页面数据赋值 LoginInfo currentUser = Session["login"] as LoginInfo; #region 发票信息的更新。目前不需要。 ////删除数据 //int num = regPaymentInvoiceManager.GetCount(Request.QueryString["payid"]); //if (num != 0) //{ // regPaymentInvoiceManager.DeleteByRegID(Request.QueryString["payid"]); //} ////添加数据 //string jsonString = hidInvoice.Value; //List<InvoiceData> invoiceList = ReadJson(jsonString); //RegPaymentInvoice regPaymentInvoice = new RegPaymentInvoice(); //for (int i = 0, len = invoiceList.Count(); i < len; i++) //{ // InvoiceData invoiceData = invoiceList[i]; // if (invoiceData.Num != "" || invoiceData.Remark != "") // { // regPaymentInvoice.id = Request.QueryString["payid"]; // regPaymentInvoice.invoiceNum = invoiceData.Num; // regPaymentInvoice.remark = invoiceData.Remark; // regPaymentInvoiceManager.Add(regPaymentInvoice); // } //} #endregion if (!string.IsNullOrEmpty(Request.QueryString["payid"])) { string paymentID = Request.QueryString["payid"].ToString().Trim(); EtNet_Models.RegPayment regpay = bRegP.GetModel(paymentID); bool isAdd = true; if (regpay != null) { isAdd = false; } else { regpay = new EtNet_Models.RegPayment(); regpay.id = Guid.NewGuid().ToString(); } regpay.hasInvoice = int.Parse(ddlHasInvoiceNum.SelectedValue.Trim()); regpay.hasInvoiceDate = txtHasInvoceDate.Text.Trim() != "" ? DateTime.Parse(txtHasInvoceDate.Text.Trim()) : DateTime.Parse("1900-01-01"); regpay.makerID = LoginInfoManager.getLoginIDByname(lblMaker.Text.Trim()); //制单人员的关联id regpay.makerName = lblMaker.Text; //该付款申请单的制单人员 regpay.makeTime = DateTime.Parse(lblRequestDate.Text.Trim()); //制单日期 regpay.payerID = currentUser.Id; //支付人员管理id regpay.payerName = currentUser.Cname; //支付人员 regpay.paymentDate = DateTime.Parse(txtPaymentDate.Text.Trim()); //支付日期 regpay.payRemark = txtpz.Value; //支付凭证 regpay.paymentID = paymentID; regpay.payStatus = chkIsPay.Checked ? 1 : 0; if (isAdd) { bRegP.Add(regpay); } else { bRegP.Update(regpay); } } ClientScript.RegisterStartupScript(Page.GetType(), "a", "alert('保存成功');self.location.href='RegPaymentList.aspx';", true); }