private void BindGridView() { DataTable dt = PaibanDal.GetOsAndSSYS(); var list = ListHelper <UpdDoctorModel> .ConvertToList(dt); dgvChoice.DataSource = list; }
private void SelectYSorHS_Load(object sender, EventArgs e) { if (Type == 1) { groupBox1.Text = "麻醉医生待选列表"; DataTable dt = PaibanDal.GetPiabanOA(_PatId); DoctotList = ListHelper <OperDoctorModel> .ConvertToList(dt); } else if (Type == 2) { groupBox1.Text = "护士待选列表"; DataTable dt = PaibanDal.GetPiabanON(_PatId); DoctotList = ListHelper <OperDoctorModel> .ConvertToList(dt); } else { groupBox1.Text = "护士待选列表"; DataTable dt = PaibanDal.GetPiabanSN(_PatId); DoctotList = ListHelper <OperDoctorModel> .ConvertToList(dt); } BindSSYS(); BinSelectedDgv(); }
private void SelectSSYS_Load(object sender, EventArgs e) { BindSSYS(); //绑定已选列表 DataTable dt = PaibanDal.GetPiabanOsAndNo(_PatId); DoctotList = ListHelper <OperDoctorModel> .ConvertToList(dt); BinSelectedDgv(); }
private void TaskMethod() { var list = dgvChoice.DataSource as List <UpdDoctorModel>; int i = 0; foreach (var item in list) { if (!item.SSYS.IsNullOrEmpty()) { string sql = string.Empty; var spit = item.SSYS.Split('、'); if (spit.Count() == 1) { sql = $@"UPDATE Adims_OTypesetting SET OS='{spit[0]}' WHERE PatId='{item.PatID}'"; PaibanDal.ExecuteUpdate(sql); } if (spit.Count() == 2) { sql = $@"UPDATE Adims_OTypesetting SET OS='{spit[0]}',OA1='{spit[1]}' WHERE PatId='{item.PatID}'"; PaibanDal.ExecuteUpdate(sql); } if (spit.Count() == 3) { sql = $@"UPDATE Adims_OTypesetting SET OS='{spit[0]}',OA1='{spit[1]}',OA2='{spit[2]}' WHERE PatId='{item.PatID}'"; PaibanDal.ExecuteUpdate(sql); } if (spit.Count() >= 4) { sql = $@"UPDATE Adims_OTypesetting SET OS='{spit[0]}',OA1='{spit[1]}',OA2='{spit[2]}',OA3='{spit[3]}' WHERE PatId='{item.PatID}'"; PaibanDal.ExecuteUpdate(sql); } } else { string sql = $@"UPDATE Adims_Mzjld SET SSYS='{item.OS}' WHERE PatId='{item.PatID}'"; PaibanDal.ExecuteUpdate(sql); } i++; } BindGridView(); MessageBox.Show("修正完毕"); button1.Enabled = true; button2.Enabled = true; button3.Enabled = true; }