Example #1
0
        /// <summary>
        /// 获取表体
        /// </summary>
        private void GetJobDetail()
        {
            try
            {
                if (string.IsNullOrWhiteSpace(jobID))
                {
                    return;
                }

                // 清空数据
                DGdetail.ItemsSource = null;

                string sql = @"select ID,
			 JOB_ID 作业单号,
			 AREA 作业区域,
			 TASK_ID	WMS任务号,
			 CONCAT(TASK_STATUS)	任务状态,
			 DEV_TYPE	设备类型,
			 DEVICE	设备名,
			 TAKE_NUM	接货数量,
			 CONCAT(TAKE_SITE_X,'-',TAKE_SITE_Y,'-',TAKE_SITE_Z) 接货点,
			 DEV_FROM	来源对接设备,
			 DEV_TO	目的对接设备,
			 GIVE_NUM	送货数量,
			 CONCAT(GIVE_SITE_X,'-',GIVE_SITE_Y,'-',GIVE_SITE_Z) 送货点,
			 DATE_FORMAT(CREATION_TIME,'%Y/%m/%d %T')	创建时间,
			 DATE_FORMAT(UPDATE_TIME,'%Y/%m/%d %T')	更新时间
  from wcs_job_detail;";

                // 获取数据
                DataTable dt = CommonSQL.mysql.SelectAll(sql);
                DGdetail.ItemsSource = dt.DefaultView;

                // 中文释义
                foreach (DataRowView dr in DGdetail.ItemsSource)
                {
                    dr.Row[4]  = GetTaskStatus((TaskStatus)Convert.ToInt32(dr.Row[4]));
                    dr.Row[5]  = DeviceType.GetDevTypeName(dr.Row[5].ToString());
                    dr.Row[9]  = DeviceType.GetDevTypeName(dr.Row[9].ToString());
                    dr.Row[10] = DeviceType.GetDevTypeName(dr.Row[10].ToString());
                }
            }
            catch (Exception e)
            {
                Notice.Show(e.Message, "错误", 3, MessageBoxIcon.Error);
            }
        }