示例#1
0
        /// <summary>
        /// 按钮点击事件-模具警报信息搜索
        /// </summary>
        /// <param name="sender">事件源</param>
        /// <param name="e">事件参数</param>
        private void SearchBtn_Click(object sender, RoutedEventArgs e)
        {
            MoldPartInfoServiceClient client    = new MoldPartInfoServiceClient();
            List <MoldWarnInfo>       warnInfos = client.GetMoldWarnInfo((MoldWarnType)(int.Parse(WarnCB.SelectedValue.ToString())));

            MoldBaseInfoDG.ItemsSource = warnInfos;
        }
示例#2
0
 private void ExportBtn_Click(object sender, RoutedEventArgs e)
 {
     saveFileDialog.FileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
     if ((bool)saveFileDialog.ShowDialog())
     {
         MoldPartInfoServiceClient client    = new MoldPartInfoServiceClient();
         List <MoldWarnInfo>       warnInfos = client.GetMoldWarnInfo((MoldWarnType)(int.Parse(WarnCB.SelectedValue.ToString())));
         string[] headers = { "模具号", "借出员工", "成本中心", "当前位置", "维护周期", "借出时间", "应还时间", "相距时间" };
         string[] pathes  = { "MoldNR", "ApplicantId", "ProjectName", "CurrentPosition", "MaxLendHour", "LendTime", "ShouldReTime", "DisTimeText" };
         if (warnInfos.Count > 0)
         {
             if (GenExcelHelper.GenExcel <MoldWarnInfo>(saveFileDialog.FileName, "超期数据", headers, pathes, warnInfos))
             {
                 MessageBox.Show("数据导出成功,请到保存路径查看");
             }
             else
             {
                 MessageBox.Show("数据导出失败(可能指定文件已经打开),请重试");
             }
         }
         else
         {
             MessageBox.Show("不存在记录数据");
         }
     }
 }
示例#3
0
 private void DataTimer_Tick(object sender, EventArgs e)
 {
     if (!WarnAlert.Shown)
     {
         MoldPartInfoServiceClient client    = new MoldPartInfoServiceClient();
         List <MoldWarnInfo>       warnInfos = client.GetMoldWarnInfo(MoldWarnType.OutTime);
         if (warnInfos.Count > 0)
         {
             new WarnAlert(warnInfos).Show();
         }
     }
 }
示例#4
0
 private void DataTimer_Tick(object sender, EventArgs e)
 {
     if (!WarnAlert.Shown)
     {
         MoldPartInfoServiceClient client = new MoldPartInfoServiceClient();
         List<MoldWarnInfo> warnInfos = client.GetMoldWarnInfo(MoldWarnType.OutTime);
         if (warnInfos.Count > 0)
         {
             new WarnAlert(warnInfos).Show();
         }
     }
 }
 private void ExportBtn_Click(object sender, RoutedEventArgs e)
 {
     saveFileDialog.FileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
      if ((bool)saveFileDialog.ShowDialog())
      {
          MoldPartInfoServiceClient client = new MoldPartInfoServiceClient();
          List<MoldWarnInfo> warnInfos = client.GetMoldWarnInfo((MoldWarnType)(int.Parse(WarnCB.SelectedValue.ToString())));
          string[] headers = { "模具号","借出员工", "成本中心", "当前位置", "维护周期","借出时间","应还时间","相距时间"};
          string[] pathes = { "MoldNR", "ApplicantId", "ProjectName", "CurrentPosition", "MaxLendHour", "LendTime", "ShouldReTime", "DisTimeText" };
          if (warnInfos.Count > 0)
              if (GenExcelHelper.GenExcel<MoldWarnInfo>(saveFileDialog.FileName, "超期数据", headers, pathes, warnInfos))
                  MessageBox.Show("数据导出成功,请到保存路径查看");
              else
                  MessageBox.Show("数据导出失败(可能指定文件已经打开),请重试");
          else
              MessageBox.Show("不存在记录数据");
      }
 }
 /// <summary>
 /// 按钮点击事件-模具警报信息搜索
 /// </summary>
 /// <param name="sender">事件源</param>
 /// <param name="e">事件参数</param>
 private void SearchBtn_Click(object sender, RoutedEventArgs e)
 {
     MoldPartInfoServiceClient client = new MoldPartInfoServiceClient();
     List<MoldWarnInfo> warnInfos=client.GetMoldWarnInfo((MoldWarnType)(int.Parse(WarnCB.SelectedValue.ToString())));
     MoldBaseInfoDG.ItemsSource = warnInfos;
 }