/* * 根据实验室编号,获取实验室信息**/ private void classroomInfo(string classroomID) { string[] info = new BLL.ClassRoom().getClassroomInfo(classroomID); txtClassroomName.Text = info[0]; cmBoxClassroomType.Text = info[1]; txtClassFunction.Text = info[2]; txtClassroomLocation.Text = info[3]; txtClassDescription.Text = info[4]; txtClassroomRemark.Text = info[5]; txtRemark.Text = info[6]; }
private void btnSraech_Click(object sender, RoutedEventArgs e) { if (txtSearchLabo.Text.Trim() == "") { new FailureWindows("请输入查询内容!").ShowDialog(); loadData(); return; } List<T_ClassRoom> classroom = new List<T_ClassRoom>(); classroom = new BLL.ClassRoom().getPartClassRoomInfo("F_ClassRoomName", txtSearchLabo.Text); test(classroom.Count, classroom); }
public LaboratoryEnvironment(string classroomID) { InitializeComponent(); this.classroomID = classroomID; string[] info = new BLL.ClassRoom().getClassroomInfo(classroomID); txtClassroomName.Text = info[0]; cmBoxClassroomType.Text = info[1]; txtClassFunction.Text = info[2]; txtClassroomLocation.Text = info[3]; txtClassDescription.Text = info[4]; txtClassroomRemark.Text = info[5]; txtRemark.Text = info[6]; }
private void btnAdd_Click(object sender, RoutedEventArgs e) { if (txtClassroomName.Text.Trim() == "") { new FailureWindows("请输入实验室名称!").ShowDialog(); return; } string[] info = new string[8]; bool isDelete = false; info[0] = Guid.NewGuid().ToString(); info[1] = txtClassroomName.Text.Trim(); info[2] = cmBoxClassroomType.Text; info[3] = txtClassFunction.Text; if (radioBtnYes.IsChecked == true) { isDelete = true; } else { isDelete = false; } info[4] = cmBoxBuilding.Text + txtClassroomLocation.Text; info[5] = txtClassDescription.Text; info[6] = txtClassroomRemark.Text; info[7] = txtRemark.Text; string message = new BLL.ClassRoom().addClassRoom(info, isDelete); if (message.Equals(SystemVar.Failure)) { new FailureWindows("添加失败!").ShowDialog(); return; } MessageBox.Show("添加成功!"); btnCancel_Click(sender, e); reloadData(); }
/* * 删除实验室**/ private void btnDeleteClassroom_Click(object sender, RoutedEventArgs e) { try { int count = 0; for (int i = 0; i < ckBox.Length; i++) { if (ckBox[i].IsChecked == true) { string message = new BLL.ClassRoom().deleteClassroom(ckBox[i].Tag.ToString()); if (message == SystemVar.Success) { count++; } } } MessageBox.Show("共删除" + count + "间实验室!"); loadData(); } catch (Exception exc) { new FailureWindows("部分实验室删除失败!").ShowDialog(); } }
public int getCount() { int count = new BLL.ClassRoom().getClassRoomCount(); return count; }
public List<T_ClassRoom> Load() { List<T_ClassRoom> classroom = new BLL.ClassRoom().getAllClassRoomInfo(); return classroom; }