You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
3.6 KiB
104 lines
3.6 KiB
using SchedulingSystem.EntityClass; |
|
using SchedulingSystemClient; |
|
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Windows; |
|
using System.Windows.Controls; |
|
using System.Windows.Data; |
|
using System.Windows.Documents; |
|
using System.Windows.Input; |
|
using System.Windows.Media; |
|
using System.Windows.Media.Imaging; |
|
using System.Windows.Shapes; |
|
|
|
namespace SchedulingSystem |
|
{ |
|
/// <summary> |
|
/// XGYSWindow.xaml 的交互逻辑 |
|
/// </summary> |
|
public partial class XGYSWindow : Window |
|
{ |
|
SurgerySchedulingEntities myModel = new SurgerySchedulingEntities(); |
|
public XGYSWindow(int ysid) |
|
{ |
|
InitializeComponent(); |
|
id = ysid; |
|
} |
|
|
|
int id = 0; |
|
private void Window_Loaded(object sender, RoutedEventArgs e) |
|
{ |
|
// Cus_YsLb ys = new Cus_YsLb(); |
|
//ys = (from tbysb in myModel.SYS_YSZCB |
|
// join tbyszcb in myModel.SYS_YSZCB on tbysb.YSJB equals tbyszcb.ID |
|
// where tbysb.ID == id |
|
// select new Cus_YsLb |
|
// { |
|
// ID = tbysb.ID, |
|
// YSMC = tbysb.YSXM, |
|
// YSBM = tbysb.YSBM, |
|
// YSJB = tbyszcb.YSZC, |
|
// intYSJB = tbyszcb.ID, |
|
// bitSFQY = tbysb.SFQY |
|
// }).FirstOrDefault(); |
|
//ysmc.Text = ys.YSMC; |
|
//ysbm.Text = ys.YSBM; |
|
//List<ComboBoxBinding> listsfqy = new List<ComboBoxBinding>(); |
|
//listsfqy.Add(new ComboBoxBinding() { ID = 0, Name = "是" }); |
|
//listsfqy.Add(new ComboBoxBinding() { ID = 1, Name = "否" }); |
|
//sfqy.ItemsSource = listsfqy; |
|
//sfqy.SelectedValuePath = "ID"; |
|
//sfqy.DisplayMemberPath = "Name"; |
|
//sfqy.SelectedIndex = ys.bitSFQY == true ? 0 : 1; |
|
//List<ComboBoxBinding> listyszc = new List<ComboBoxBinding>(); |
|
//listyszc = (from tbyszcb in myModel.SYS_YSZCB |
|
// select new ComboBoxBinding |
|
// { |
|
// ID = tbyszcb.ID, |
|
// Name = tbyszcb.Name, |
|
// }).ToList(); |
|
//yszc.ItemsSource = listyszc; |
|
//yszc.SelectedValuePath = "ID"; |
|
//yszc.DisplayMemberPath = "Name"; |
|
//yszc.SelectedValue = ys.intYSJB; |
|
} |
|
|
|
private void btn_bc_Click(object sender, RoutedEventArgs e) |
|
{ |
|
if (ysbm.Text == null || ysbm.Text == string.Empty) |
|
{ |
|
MessageBox.Show("请填写医生编码"); |
|
return; |
|
} |
|
if (ysmc.Text == null || ysmc.Text == string.Empty) |
|
{ |
|
MessageBox.Show("请填写医生姓名"); |
|
return; |
|
} |
|
if (yszc.SelectedIndex<0) |
|
{ |
|
MessageBox.Show("请选择医生职称"); |
|
return; |
|
} |
|
//SYS_YSB ysb = new SYS_YSB(); |
|
//ysb.ID = id; |
|
//ysb.YSXM = ysmc.Text; |
|
//ysb.YSBM = ysbm.Text; |
|
//ysb.YSJB =Convert.ToInt32(yszc.SelectedValue); |
|
//ysb.SFQY = sfqy.SelectedValue.ToString() == "0" ? true : false; |
|
//try |
|
//{ |
|
// myModel.Entry(ysb).State = System.Data.Entity.EntityState.Modified; |
|
// myModel.SaveChanges(); |
|
// MessageBox.Show("修改成功"); |
|
// this.Close(); |
|
//} |
|
//catch (Exception) |
|
//{ |
|
// MessageBox.Show("修改失败"); |
|
//} |
|
} |
|
} |
|
}
|
|
|