public PerformerTimeFree convert(EntityFrameworkContext context)
        {
            var output = new PerformerTimeFree();

            Mapper.CreateMap<PerformerTimeFreeView, PerformerTimeFree>();
            Mapper.Map<PerformerTimeFreeView, PerformerTimeFree>(this, output);

            return output;
        }
        public Knowledge convert(EntityFrameworkContext context)
        {
            var output = new Knowledge();

            Mapper.CreateMap<KnowledgeView, Knowledge>();
            Mapper.Map<KnowledgeView, Knowledge>(this, output);

            return output;
        }
        public Administrator convert(EntityFrameworkContext context)
        {
            var output = new Administrator();

            Mapper.CreateMap<AdministratorView, Administrator>();
            Mapper.Map<AdministratorView, Administrator>(this, output);

            return output;
        }
 public AssignmentController()
 {
     this._context = new EntityFrameworkContext();
 }
        public Performer convert(EntityFrameworkContext context)
        {
            var performer = new Performer();

            AutoMapper.Mapper.CreateMap<PerformerView, Performer>();
            AutoMapper.Mapper.Map<PerformerView, Performer>(this, performer);

            if (this.assignmentIds != null)
                foreach (var assignment in context.assignments.Where(a => this.assignmentIds.Contains(a.id)))
                    performer.assignments.Add(assignment);
            if (this.timeReportIds != null)
                foreach (var assignmentTimeReport in context.performerTimeReports.Where(a => this.timeReportIds.Contains(a.id)))
                    performer.timeReports.Add(assignmentTimeReport);

            return performer;
        }
 public PerformerTimeFreeController(EntityFrameworkContext context)
 {
     this._context = context;
 }
 public PerformerTimeFreeController()
 {
     this._context = new EntityFrameworkContext();
 }
Ejemplo n.º 8
0
        public Client convert(EntityFrameworkContext context)
        {
            //var client = new Client();

            //AutoMapper.Mapper.CreateMap<ClientView, Client>();
            //AutoMapper.Mapper.Map<ClientView, Client>(this, client);

            //if (this.assignmentIds != null)
            //    foreach (var assignment in context.assignments.Where(a => this.assignmentIds.Contains(a.id)))
            //        client.assignments.Add(assignment);

            //return client;

            return null;
        }
 public ClientController()
 {
     this._context = new EntityFrameworkContext();
 }
 public KnowledgeController(EntityFrameworkContext context)
 {
     this._context = context;
 }
 public KnowledgeController()
 {
     this._context = new EntityFrameworkContext();
 }
 public AdministratorController(EntityFrameworkContext context)
 {
     this._context = context;
 }
 public AdministratorController()
 {
     this._context = new EntityFrameworkContext();
 }
 public AssignmentController(EntityFrameworkContext context)
 {
     this._context = context;
 }
 public ClientController(EntityFrameworkContext context)
 {
     this._context = context;
 }
        public Assignment convert(EntityFrameworkContext context)
        {
            var assignment = new Assignment();

            AutoMapper.Mapper.CreateMap<AssignmentView, Assignment>();
            AutoMapper.Mapper.Map<AssignmentView, Assignment>(this, assignment);

            if (this.performerIds != null)
                foreach (var performer in context.performers.Where(p => this.performerIds.Contains(p.id)))
                    assignment.performers.Add(performer);
            if (this.timeReportsIds != null)
                foreach (var assignmentTimeReport in context.performerTimeReports.Where(a => this.timeReportsIds.Contains(a.id)))
                    assignment.timeReports.Add(assignmentTimeReport);
            if (this.clientId != null)
                assignment.client = context.clients.FirstOrDefault(c => c.id == this.clientId);

            return assignment;
        }
        public PerformerTimeReport convert(EntityFrameworkContext context)
        {
            var assignmentTimeReport = new PerformerTimeReport();

            AutoMapper.Mapper.CreateMap<PerformerTimeReportView, PerformerTimeReport>();
            AutoMapper.Mapper.Map<PerformerTimeReportView, PerformerTimeReport>(this, assignmentTimeReport);

            return assignmentTimeReport;
        }