Example #1
0
        /// <summary>
        /// 加载产品明细
        /// </summary>
        /// <param name="info"></param>
        protected virtual void FillPaidsByPurchaseIds(PayoutEntity info)
        {
            if (string.IsNullOrEmpty(hfPurchases.Value))
            {
                return;
            }
            var paids = hfPurchases.Value.DeserializeJson <List <PayoutItemEntity> >();

            if (paids != null)
            {
                foreach (var subpaid in paids)
                {
                    var paid = new PurchasePayEntity
                    {
                        Purchase = new PurchaseEntity {
                            Id = subpaid.Id
                        },
                        Amount   = subpaid.Amount,
                        Remark   = subpaid.Remark,
                        Payout   = info,
                        SaveType = SaveType.Add
                    };
                    info.Pays.Add(paid);
                }
            }
        }
Example #2
0
        protected override IList <TEntityType> GetSaveEntities <TEntityType>(SaveType saveType, bool isBindDataKey = true,
                                                                             DropDownList dropDownList             = null)
        {
            var infos = new List <PurchasePayEntity>();

            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 txtRemark = gvr.FindControl("txtRemark") as System.Web.UI.HtmlControls.HtmlInputText;
                if (txtRemark == null)
                {
                    continue;
                }
                var txtAmount = gvr.FindControl("txtPayout") as System.Web.UI.HtmlControls.HtmlInputText;
                if (txtAmount == null)
                {
                    continue;
                }
                var info = new PurchasePayEntity
                {
                    Amount   = txtAmount.Value.Convert <decimal>(),
                    Purchase = new PurchaseEntity {
                        Id = ckSelect.Value.Convert <long>()
                    },
                    Payout = new PayoutEntity {
                        Id = Request.QueryString["id"].Convert <long>()
                    },
                    SaveType = SaveType.Add,
                    Remark   = txtRemark.Value,
                };
                infos.Add(info);
            }
            return(infos as IList <TEntityType>);
        }
Example #3
0
 /// <summary>
 /// 设置付款
 /// </summary>
 protected virtual void SetPays(bool isStatus)
 {
     InvokeItemLoader("PayoutItems");
     if (PayoutItems == null)
     {
         return;
     }
     foreach (var payoutItem in PayoutItems)
     {
         var pay = new PurchasePayEntity
         {
             Purchase = payoutItem.Purchase,
             Amount   = isStatus ? payoutItem.Amount : 0 - payoutItem.Amount,
             Number   = OriginalNumber,
             PayType  = PayType,
             Remark   = "",
             SaveType = SaveType.Add
         };
         Pays.Add(pay);
     }
 }