/// <summary> /// 填充发票 /// </summary> /// <param name="info"></param> protected virtual void FillReceiveds(PayinEntity info) { info.PayinItems = new List <PayinItemEntity>(); foreach (GridViewRow gvr in gvReceived.Rows) { if (gvr.RowType != DataControlRowType.DataRow) { continue; } var ckSelect = gvr.FindControl("hfId") as System.Web.UI.HtmlControls.HtmlInputHidden; if (ckSelect == null) { continue; } var txtReceivedAmount = gvr.FindControl("txtAmount") as System.Web.UI.HtmlControls.HtmlInputText; var txtReceivedRemark = gvr.FindControl("txtRemark") as System.Web.UI.HtmlControls.HtmlInputText; if (txtReceivedAmount == null || txtReceivedRemark == null) { continue; } var PayinItem = new PayinItemEntity { Order = new OrderEntity { Id = ckSelect.Value.Convert <long>() }, Amount = txtReceivedAmount.Value.Convert <decimal>(), Remark = txtReceivedRemark.Value, Payin = info, SaveType = SaveType.Add }; info.PayinItems.Add(PayinItem); } FillReceivedsByOrderIds(info); }
/// <summary> /// 加载产品明细 /// </summary> /// <param name="info"></param> protected virtual void FillReceivedsByOrderIds(PayinEntity info) { if (string.IsNullOrEmpty(hfOrders.Value)) { return; } var payinItems = hfOrders.Value.DeserializeJson <List <PayinItemEntity> >(); if (payinItems != null) { foreach (var subreceived in payinItems) { var payinItem = new PayinItemEntity { Order = new OrderEntity { Id = subreceived.Id }, Amount = subreceived.Amount, Remark = subreceived.Remark, Payin = info, SaveType = SaveType.Add }; info.PayinItems.Add(payinItem); } } }
/// <summary> /// 得到价格实体 /// </summary> protected virtual IList <PayinItemEntity> GetPriceProductEntities() { var infos = new List <PayinItemEntity>(); foreach (GridViewRow gvr in GridView.Rows) { if (gvr.RowType != DataControlRowType.DataRow) { continue; } var ckSelect = gvr.FindControl("ckSelect") as System.Web.UI.HtmlControls.HtmlInputCheckBox; if (ckSelect == null || !ckSelect.Checked) { continue; } var txtPrice = gvr.FindControl("txtPrice") as System.Web.UI.HtmlControls.HtmlInputText; var txtRemark = gvr.FindControl("txtRemark") as System.Web.UI.HtmlControls.HtmlInputText; if (txtPrice == null || txtRemark == null) { continue; } var info = new PayinItemEntity { Id = ckSelect.Value.Convert <long>(), Order = new OrderEntity { Id = ckSelect.Value.Convert <long>() }, Amount = txtPrice.Value.Convert <decimal>(), Remark = txtRemark.Value, SaveType = SaveType.Add }; infos.Add(info); } return(infos); }