showmessage('已经存在相同的学号!');
edit1.SetFocus;
end;
end;
删除学生信息的窗体:
procedure TForm_infos_del.Button3Click(Sender: TObject);
begin
  if RadioButton1.Checked then
  begin
    if edit1.Text='' then
      begin
        showmessage('请填写学号!');
        edit1.SetFocus;
      end
      else
        if MessageDlg('确认删除'+edit1.Text,mtConfirmation,mbOkCancel,0)=mrOk then
         begin
           query1.Close;
           query1.SQL.Clear;
           query1.SQL.Add('delete from student where sno=:sno');
           query1.ParamByName('sno').AsString:=edit1.Text;
           query1.ExecSQL;
           query2.ParamByName('Num_room').AsString:=Num_room;
           query2.ExecSQL;
           edit1.Text:='';
         end;
  end;
  if RadioButton3.Checked then
  begin
    if edit2.Text='' then
      begin
        showmessage('请填写寝室号!');
        edit2.SetFocus;
      end
      else
        if edit3.Text='' then
          begin
            showmessage('请填写床位号!');
            edit3.SetFocus;
          end
          else
        if MessageDlg('确认删除?',mtConfirmation,mbOkCancel,0)=mrOk then
         begin
           query1.Close;
           query1.SQL.Clear;
           query1.SQL.Add('delete from student where Num_room=:Num_room and Num_bed=:Num_bed');
           query1.ParamByName('Num_room').AsString:=edit2.Text;
           query1.ParamByName('Num_bed').AsString:=edit3.Text;
           query1.ExecSQL;
         &nbs
首页 上一页 1 2 3 4 5 6 下一页 尾页 4/6/6
sql2000+公寓管理系统+delphi[开题报告+文档+源代码+答辩ppt+外文翻译](四)由毕业论文网(www.huoyuandh.com)会员上传。

