예제 #1
0
        public List <ClientDAO> GetClients()
        {
            var s = new List <ClientDAO>();

            foreach (var client in ef.GetClients())
            {
                s.Add(ClientMapper.MapToClientDAO(client));
            }
            return(s);
        }
예제 #2
0
        public static ScheduleJob MapToJob(JobDAO job)
        {
            var c = new ScheduleJob();

            c.Id            = job.Id;
            c.ServiceTypeID = job.ServiceType.Id;
            c.ServiceType   = ServiceTypeMapper.MapToServiceType(job.ServiceType);
            c.ClientID      = job.Client.Id;
            c.Client        = ClientMapper.MapToClient(job.Client);
            c.UserID        = job.User.Id;
            //c.AspNetUser = UserMapper.MapToUser(job.User);
            c.StartDate         = job.StartDate;
            c.EndDate           = job.EndDate;
            c.EstimatedDuration = job.EstimatedDuration;
            c.Notes             = job.Notes;
            c.Hours             = job.Hours;
            c.Complete          = job.Complete;

            return(c);
        }
예제 #3
0
        public static JobDAO MapToJobDAO(ScheduleJob job)
        {
            var ef = new EfData();
            var c  = new JobDAO();

            c.Id                = job.Id;
            c.ServiceTypeID     = job.ServiceTypeID;
            c.ServiceType       = ServiceTypeMapper.MapToServiceTypeDAO(job.ServiceType);
            c.ClientID          = job.ClientID;
            c.Client            = ClientMapper.MapToClientDAO(job.Client);
            c.User              = UserMapper.MapToUserDAO(ef.GetUsers().Where(x => x.Id == job.UserID).FirstOrDefault());
            c.UserID            = job.UserID;
            c.StartDate         = job.StartDate;
            c.EndDate           = job.EndDate;
            c.EstimatedDuration = job.EstimatedDuration;
            c.Notes             = job.Notes;
            c.Hours             = job.Hours;
            c.Complete          = job.Complete;

            return(c);
        }
예제 #4
0
 public bool DeleteClient(ClientDAO client)
 {
     return(ef.DeleteClient(ClientMapper.MapToClient(client)));
 }
예제 #5
0
 public bool UpdateClient(ClientDAO client)
 {
     return(ef.UpdateClient(ClientMapper.MapToClient(client)));
 }
예제 #6
0
 public bool AddClient(ClientDAO client)
 {
     return(ef.AddClient(ClientMapper.MapToClient(client)));
 }