//添加申请单 private void shenqingdantianjiaUI_Click(object sender, RoutedEventArgs e) { var xindan = new Shujuku.HLA_shenqingdan(); xindan.bianhao = "临时编号"; var tianjia = new Tianjiashenqingdan(); tianjia.shujuyuan = xindan; var queding = tianjia.ShowDialog(); if (queding == true) { shujuku.HLA_shenqingdan.Add(xindan); shujuku.SaveChanges(); xindan.gengxinbianhao(shujuku); fenyeshenqingdanUI.Dangqianye = 1; fenyeshenqingdanUI_Fenye_Click(null, null); } }
//修改申请单 private async void shenqingdanxiugaiUI_Click(object sender, RoutedEventArgs e) { if (xuanzedeshenqingdan == null) { await Gongju.tanchutishi("请先选择申请单!"); return; } shujuku.SaveChanges(); var xiugai = new Tianjiashenqingdan(); xiugai.shujuyuan = xuanzedeshenqingdan; var queding = xiugai.ShowDialog(); if (queding == true) { shujuku.SaveChanges(); } else { shujuku.Entry(xuanzedeshenqingdan).Reload(); shujuyuan_shenqingdan = shujuyuan_shenqingdan.ToList(); } }