public ARAPInfo(AC_ARAPList m) { if (m != null) FillModel(m); }
private void FillModel(AC_ARAPList m) { if (m == null) return; ID = m.ID; TradeClient = m.TradeClient; Type = m.Type; Amount = m.Amount; OpStaff = m.OpStaff; RelateDeliveryId = m.RelateDeliveryId; BalanceFlag = m.BalanceFlag; BalanceDate = m.BalanceDate; CashFlowId = m.CashFlowId; Remark = m.Remark; InsertTime = m.InsertTime; TypeName = m.Type == 1 ? "应收" : "应付"; if (m.TradeClient > 0) { CM_Client c = new CM_ClientBLL(m.TradeClient).Model; if (c != null) TradeClientName = c.FullName; } if (m.OpStaff > 0) { Org_Staff s = new Org_StaffBLL(m.OpStaff).Model; if (s != null) OpStaffName = s.RealName; } if (m.RelateDeliveryId > 0) { PBM_Delivery d = new PBM_DeliveryBLL(m.RelateDeliveryId).Model; RelateDeliveryCode = d.SheetCode == "" ? d.ID.ToString() : d.SheetCode; } }