Example #1
0
        //修改样本
        private async void xiugaiyangbenjieshouUIMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (xuanzhedeyangbenjieshou == null)
            {
                await Gongju.tanchutishi("请先选择样本接受!");
                return;
            }
            shujuku.SaveChanges();

            var tianjia = new Tianjiayangben();
            tianjia.leixingUIcomboBox1.IsEnabled = false;
            tianjia.yangbenjieshouUI.DataContext = xuanzhedeyangbenjieshou;
            var queding = tianjia.ShowDialog();
            if (queding == true)
            {
                shujuku.SaveChanges();
            }
            else
            {
                shujuku.Entry(xuanzhedeyangbenjieshou).Reload();
            }
            shujuyuan_yangbenjieshou = xuanzedeshenqingdan.HLA_yangbenjieshous.ToList();
        }
Example #2
0
 //添加 样本
 private void tianjiayangbenjieshouUIMenuItem_Click(object sender, RoutedEventArgs e)
 {
     var tianjia = new Tianjiayangben();
     var xinyangben = new Shujuku.HLA_yangbenjieshou();
     xinyangben.bianhao = "临时编号";
     tianjia.yangbenjieshouUI.DataContext = xinyangben;
     var queding = tianjia.ShowDialog();
     if (queding == true)
     {
         xuanzedeshenqingdan.HLA_yangbenjieshous.Add(xinyangben);
         shujuku.SaveChanges();
         xinyangben.gengxinbianhao(shujuku);
         shujuyuan_yangbenjieshou = xuanzedeshenqingdan.HLA_yangbenjieshous.ToList();
     }
 }