Example #1
0
 //修改 板
 private async void xiugaibanUI_Click(object sender, RoutedEventArgs e)
 {
     if (xuanzedeban == null)
     {
         await Gongju.tanchutishi("请先选择板!");
         return;
     }
     shujuku.SaveChanges();
     var tianjia = new Tianjiaban();
     tianjia.hangshuUIcomboBox.IsEnabled = false;
     tianjia.lieshuUIcomboBox.IsEnabled = false;
     tianjia.leixingUIcomboBox.IsEnabled = false;
     tianjia.banxinxiUI.DataContext = xuanzedeban;
     tianjia.shujuku = shujuku;
     var queding = tianjia.ShowDialog();
     if (queding == true)
     {
         shujuku.SaveChanges();
     }
     else
     {
         shujuku.Entry(xuanzedeban).Reload();
         shujuyuan_banliebiao = shujuyuan_banliebiao.ToList();
     }
 }
Example #2
0
 //添加 板
 private void tianjiabanUI_Click(object sender, RoutedEventArgs e)
 {
     var tianjia = new Tianjiaban();
     var banxinxi = new Shujuku.HLA_banxinxi();
     banxinxi.riqi = DateTime.Now;
     tianjia.banxinxi = banxinxi;
     tianjia.shujuku = shujuku;
     var queding = tianjia.ShowDialog();
     if (queding == true)
     {
         shujuku.HLA_banxinxi.Add(banxinxi);
         shujuku.SaveChanges();
         fenyechaxunUI_Fenye_Click(sender, e);
     }
 }