public VisitPlan(VST_VisitPlan m) { if (m != null) { FillModel(m.ID); } }
private void FillModel(int ID) { VST_VisitPlanBLL bll = new VST_VisitPlanBLL(ID); if (bll.Model == null) { return; } VST_VisitPlan m = bll.Model; ID = m.ID; Route = m.Route; RelateStaff = m.RelateStaff; PlanVisitDate = m.PlanVisitDate; IsMustSequenceVisit = m.IsMustSequenceVisit; Remark = m.Remark; ApproveFlag = m.ApproveFlag; Items = new List <VisitPlanDetail>(bll.Items.Count); foreach (var item in bll.Items) { Items.Add(new VisitPlanDetail(item)); } if (m.Route > 0) { VST_Route r = new VST_RouteBLL(m.Route).Model; if (r != null) { RouteName = r.Name; } Org_Staff s = new Org_StaffBLL(m.RelateStaff).Model; if (s != null) { RelateStaffName = s.RealName; } } }