Пример #1
0
        public void EditAgencyPlan(AgencyPlanViewModel model)
        {
            var data = (from plan in ContextPerRequest.CurrentData.AgencyPlanSchedules
                        where plan.AgencyPlanID == model.AgencyPlanID
                        select plan).FirstOrDefault();

            data.NumberParticipants = model.NumberParticipants;
            data.PlanAssetsCurrent  = model.PlanAssetsCurrent;
            data.PlanAssetsPrior    = model.PlanAssetsPrior;
            data.PlanName           = model.PlanName;
            data.PlanType           = model.PlanType;

            ContextPerRequest.CurrentData.SaveChanges();
        }
Пример #2
0
        public void AddAgencyPlan(AgencyPlanViewModel model)
        {
            AgencyPlanSchedule plan = new AgencyPlanSchedule
            {
                DateAdded          = DateTime.Now,
                IsActive           = true,
                MemberID           = model.MemberID,
                NumberParticipants = model.NumberParticipants,
                PlanAssetsCurrent  = model.PlanAssetsCurrent,
                PlanAssetsPrior    = model.PlanAssetsPrior,
                PlanName           = model.PlanName,
                PlanType           = model.PlanType
            };

            ContextPerRequest.CurrentData.AgencyPlanSchedules.Add(plan);
            ContextPerRequest.CurrentData.SaveChanges();
        }