Beispiel #1
0
 /// <summary>
 /// 页面加载事件
 /// </summary>
 /// <param name="sender">事件源</param>
 /// <param name="e">事件参数</param>
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(moldNR))
     {
         ConditionServiceClient conditionclient = new ConditionServiceClient();
         if (!conditionclient.MoldExist(moldNR))
         {
             MessageBox.Show("此磨具不存在");
             return;
         }
         MoldPartInfoServiceClient client = new MoldPartInfoServiceClient();
         MoldBaseInfo moldBaseInfo        = client.GetMoldBaseInfoByNR(moldNR);
         BasicInfoGrid.DataContext = moldBaseInfo;
         List <Attachment> attach = moldBaseInfo.Attach;
         int i = 1;
         foreach (Attachment at in attach)
         {
             Label link = new Label()
             {
                 Content = i.ToString() + ". " + at.Name + "  ", Foreground = System.Windows.Media.Brushes.DarkGreen
             };
             link.MouseLeftButtonUp  += new MouseButtonEventHandler(link_MouseLeftButtonUp);
             link.MouseRightButtonUp += new MouseButtonEventHandler(link_MouseRightButtonUp);
             link.MouseEnter         += new MouseEventHandler(link_MouseEnter);
             link.MouseLeave         += new MouseEventHandler(link_MouseLeave);
             link.DataContext         = at;
             AttachmentTB.Inlines.Add(link);
             i += 1;
         }
     }
 }
 /// <summary>
 /// 页面加载事件
 /// </summary>
 /// <param name="sender">事件源</param>
 /// <param name="e">事件参数</param>
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(moldNR))
     {
         ConditionServiceClient conditionclient = new ConditionServiceClient();
         if (!conditionclient.MoldExist(moldNR))
         {
             MessageBox.Show("此磨具不存在");
             return;
         }
         MoldPartInfoServiceClient client = new MoldPartInfoServiceClient();
         MoldBaseInfo moldBaseInfo = client.GetMoldBaseInfoByNR(moldNR);
         BasicInfoGrid.DataContext = moldBaseInfo;
         List<Attachment> attach = moldBaseInfo.Attach;
         int i = 1;
         foreach (Attachment at in attach)
         {
             Label link = new Label() { Content =i.ToString()+". "+ at.Name + "  ", Foreground = System.Windows.Media.Brushes.DarkGreen };
             link.MouseLeftButtonUp +=new MouseButtonEventHandler(link_MouseLeftButtonUp);
             link.MouseRightButtonUp+=new MouseButtonEventHandler(link_MouseRightButtonUp);
             link.MouseEnter+=new MouseEventHandler(link_MouseEnter);
             link.MouseLeave+=new MouseEventHandler(link_MouseLeave);
             link.DataContext = at;
             AttachmentTB.Inlines.Add(link);
             i += 1;
         }
     }
 }