Пример #1
0
 /// <summary>
 /// 获取派工单信息
 /// </summary>
 /// <param name="dr">The dr.</param>
 public DispatchInfo(DataRow dr)
     : this()
 {
     this.ID                 = SQLUtil.ConvertInt(dr["ID"]);
     this.Request.ID         = SQLUtil.ConvertInt(dr["RequestID"]);
     this.RequestType.ID     = SQLUtil.ConvertInt(dr["RequestType"]);
     this.RequestType.Name   = LookupManager.GetRequestTypeDesc(this.RequestType.ID);
     this.Urgency.ID         = SQLUtil.ConvertInt(dr["UrgencyID"]);
     this.Urgency.Name       = LookupManager.GetUrgencyDesc(this.Urgency.ID);
     this.MachineStatus.ID   = SQLUtil.ConvertInt(dr["EquipmentStatus"]);
     this.MachineStatus.Name = MachineStatuses.GetMachineStatusesDesc(this.MachineStatus.ID);
     this.Engineer.ID        = SQLUtil.ConvertInt(dr["EngineerID"]);
     this.ScheduleDate       = SQLUtil.ConvertDateTime(dr["ScheduleDate"]);
     this.LeaderComments     = SQLUtil.TrimNull(dr["LeaderComments"]);
     this.Status.ID          = SQLUtil.ConvertInt(dr["StatusID"]);
     this.Status.Name        = LookupManager.GetDispatchStatusDesc(this.Status.ID);
     this.CreateDate         = SQLUtil.ConvertDateTime(dr["CreateDate"]);
     this.StartDate          = SQLUtil.ConvertDateTime(dr["StartDate"]);
     this.EndDate            = SQLUtil.ConvertDateTime(dr["EndDate"]);
     if (dr.Table.Columns.Contains("DispatchJournalID"))
     {
         this.DispatchJournal.ID = SQLUtil.ConvertInt(dr["DispatchJournalID"]);
     }
     if (dr.Table.Columns.Contains("DispatchJournalStatusID"))
     {
         this.DispatchJournal.Status.ID   = SQLUtil.ConvertInt(dr["DispatchJournalStatusID"]);
         this.DispatchJournal.Status.Name = LookupManager.GetDispatchDocStatusDesc(this.DispatchJournal.Status.ID);
     }
     if (dr.Table.Columns.Contains("DispatchReportID"))
     {
         this.DispatchReport.ID = SQLUtil.ConvertInt(dr["DispatchReportID"]);
     }
     if (dr.Table.Columns.Contains("DispatchReportStatusID"))
     {
         this.DispatchReport.Status.ID   = SQLUtil.ConvertInt(dr["DispatchReportStatusID"]);
         this.DispatchReport.Status.Name = LookupManager.GetDispatchDocStatusDesc(this.DispatchReport.Status.ID);
     }
 }