private void GetLogs()
        {
            DbContext = new Service1Client(Service1Client.EndpointConfiguration.BasicHttpBinding_IService1);
            var result = DbContext.GetCarPreSalesMaintenanceLog(Application.Current.Properties["UN"].ToString(), Application.Current.Properties["PW"].ToString(),
                                                                Application.Current.Properties["Ucid"].ToString(), IniId);
            Employee emp;
            ObservableCollection <PreSalesMaintenanceLog> temp = new ObservableCollection <PreSalesMaintenanceLog>();

            foreach (CarPreSalesLogData row in result)
            {
                PreSalesMaintenanceLog psmLog = new PreSalesMaintenanceLog();
                psmLog.BegId         = row.CarPreSaleMaintenanceBegId;
                psmLog.LagerId       = row.CarPreSaleMaintenanceLagerId;
                psmLog.DateCreated   = row.Created;
                psmLog.Description   = row.Description;
                psmLog.DocName       = row.DocName;
                psmLog.DocPath       = row.DocPath;
                psmLog.Header        = row.Header;
                psmLog.Id            = row.Id;
                psmLog.IsMaintenance = row.IsMaintenance;
                psmLog.PreSalesId    = row.CarPreSalesId;

                if (row.CreatedBy != null)
                {
                    emp             = new Employee();
                    emp.Id          = row.CreatedBy.Id;
                    emp.Name        = row.CreatedBy.FName + " " + row.CreatedBy.LName;
                    psmLog.Employee = emp;
                }

                temp.Add(psmLog);
            }
            AllLogs = new ObservableCollection <PreSalesMaintenanceLog>(temp.OrderBy(o => o.DateCreated));
        }
 public MaintenanceStandardVM(PreSalesMaintenanceLog log)
 {
     IsEnabled        = false;
     InfoCheckedColor = Color.Black;
     SelectedDate     = log.DateCreated;
     SelectedEmployee = log.Employee;
     Text_info        = log.Description;
     FilePath         = log.DocPath;
 }