📄 xwcsunit.pas
字号:
unit xwcsunit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DB, DBTables;
type
Txwcs = class(TForm)
Panel1: TPanel;
Button2: TButton;
GroupBox1: TGroupBox;
ListBox2: TListBox;
Button1: TButton;
Button3: TButton;
ListBox1: TListBox;
GroupBox2: TGroupBox;
Label1: TLabel;
ComboBox1: TComboBox;
Label2: TLabel;
ComboBox2: TComboBox;
qry: TQuery;
DataSource1: TDataSource;
qry1: TQuery;
DataSource2: TDataSource;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ComboBox1Exit(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
xwcs: Txwcs;
implementation
uses datadomule, xwpsunit;
{$R *.dfm}
procedure Txwcs.Button1Click(Sender: TObject);
var a:string;
i,j:integer;
begin
i:=0;
j:=0;
while i<6 do
begin
if listbox1.Selected[i]=true then
a:=listbox1.Items[i];
i:=i+1;
end;
while j<listbox2.count do
begin
if listbox2.items.Text<>'' then
begin
if listbox2.Items[j]=a then
begin
application.MessageBox('该项条件已经存在了!','提示',mb_ok+mb_iconinformation);
exit;
end;
j:=j+1;
end;
end;
listbox2.AddItem(a,listbox2);
end;
procedure Txwcs.Button3Click(Sender: TObject);
var i:integer;
begin
i:=0;
while i<listbox2.count do
begin
if listbox2.Selected[i]=true then
begin
listbox2.Items.Delete(i);
end;
i:=i+1;
end;
end;
procedure Txwcs.FormCreate(Sender: TObject);
begin
combobox1.Items.clear;
with datamodule1.qry_bycp do
begin
close;
sql.clear;
sql.add('select * from zyb0') ;
open;
first;
if recordcount>0 then
// combobox1.text:=Fields[1].asstring;
repeat
combobox1.items.add(fields[1].asstring);
until findnext=false;
end;
end;
procedure Txwcs.ComboBox1Exit(Sender: TObject);
begin
combobox2.Items.Clear;
with datamodule1.qry_bycp do
begin
close;
sql.Clear;
sql.add('select * from bjb0 where zymc=:name');
parambyname('name').asstring:=combobox1.text;
open;
if recordcount>0 then
combobox2.text:=Fields[0].asstring;
repeat
combobox2.items.add(fields[0].asstring);
until findnext=false;
end;
end;
procedure Txwcs.Button2Click(Sender: TObject);
var xfs:string ;
i,bjg:integer ;
xf:real;
begin
if (combobox1.text='') or (combobox2.text='') then
begin
application.MessageBox('请输入需评审的班级!','提示',mb_ok+mb_iconinformation);
exit;
end;
if listbox2.Items.text='' then
begin
application.MessageBox('请输入评审的条件!','提示',mb_ok+mb_iconinformation);
exit;
end;
with datamodule1.qry_xwcs do
begin
close;
sql.Clear ;
sql.Add('delete from xwcs');
execsql;
sql.Clear ;
sql.Add('insert into xwcs(xsxh_id,xm00) select xsxh_id,xm00 from xsmc where bjh0=:id');
parambyname('id').asstring:=combobox2.Text ;
execsql;
sql.Clear ;
sql.Add('select * from xwcs');
execsql;
open;
first;
end;
i:=0;
xf:=0;
while i<listbox2.Count do
begin //1
//////////////////////////////////////////////////////////
if listbox2.Items[i]='不及格学分数小于25' then
begin//3o
datamodule1.qry_xwcs.First;
while not datamodule1.qry_xwcs.Eof do
begin //4o
xf:=0;
with qry do
begin
close;
sql.Clear ;
sql.Add('select * from cjb0 where xsxh_id=:id and kclb='+''''+'必修'+'''');
parambyname('id').asstring:=datamodule1.qry_xwcs.Fields[0].AsString;
open;
first;
while not qry.Eof do
begin
if (qry.Fields[10].asstring='优秀') or (qry.Fields[10].asstring='良好') or (qry.Fields[10].asstring='中等') or (qry.Fields[10].asstring='及格') or (qry.Fields[10].asstring='不及格') then
begin
if qry.Fields[10].asstring='不及格' then
begin
xf:=xf+StrToFloat(qry.Fields[9].AsString);
xfs:=floattostr(xf);
end;
end
else
begin
if strtofloat(qry.Fields[10].asstring)<60 then
begin
xf:=xf+StrToFloat(qry.Fields[9].AsString);
xfs:=floattostr(xf);
end;
end;
qry.Next ;
end;
if xf>25 then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*不及格学分数为'+xfs;
datamodule1.qry_xwcs.post;
end;
end;
datamodule1.qry_xwcs.Next ;
end;//4o
end; //3o
//////////////////////////////////////////////////////////////////////
if listbox2.Items[i]='通过大学英语四级' then //条件2
begin//2o
datamodule1.qry_xwcs.first;
while not datamodule1.qry_xwcs.Eof do
begin//3o
with qry do
begin
close;
sql.Clear ;
sql.Add('select * from cjb0 where xsxh_id=:id and kcmc='+''''+'CET-4级'+'''');
parambyname('id').asstring:=datamodule1.qry_xwcs.Fields[0].AsString;
open;
first;
while not qry.Eof do
begin
if strtofloat(qry.Fields[10].asstring)<60 then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*未通过CET-4';
datamodule1.qry_xwcs.post;
end;
qry.Next ;
end;
datamodule1.qry_xwcs.Next;
end;//3o
end;
end; //2o
//////////////////////////////////////////////////////
if listbox2.Items[i]='通过计算机二级' then
begin
datamodule1.qry_xwcs.first;
while not datamodule1.qry_xwcs.Eof do
begin//3o
with qry do
begin
close;
sql.Clear ;
sql.Add('select * from cjb0 where xsxh_id=:id and kcmc='+''''+'计算机二级'+'''');
parambyname('id').asstring:=datamodule1.qry_xwcs.Fields[0].AsString;
open;
first;
while not qry.Eof do
begin
if strtofloat(qry.Fields[10].asstring)<60 then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*未通过计算机二级';
datamodule1.qry_xwcs.post;
end;
qry.Next ;
end;
datamodule1.qry_xwcs.Next;
end;//3o
end;
end;
/////////////////////////////////////////////////////////////////////
if listbox2.Items[i]='未受记过以上处分' then
begin
datamodule1.qry_xwcs.first;
while not datamodule1.qry_xwcs.Eof do
begin//3o
with qry do
begin
close;
sql.Clear ;
sql.Add('select * from cfb0 where xsxh_id=:id');
parambyname('id').asstring:=datamodule1.qry_xwcs.Fields[0].AsString;
open;
while not qry.Eof do
begin
if (qry.Fields[1].asstring='记过') or (qry.Fields[1].asstring='留校察看') or (qry.Fields[1].asstring='勒令退学') or (qry.Fields[1].asstring='开除学籍') then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*曾受到'+qry.Fields[1].AsString+'处分';
datamodule1.qry_xwcs.post;
end;
qry.Next;
end;
datamodule1.qry_xwcs.Next;
end;//3o
end;
end;
/////////////////////////////////////////////////////////////////////
if listbox2.Items[i]='不及格课程少于5门' then
begin//3o
datamodule1.qry_xwcs.First;
while not datamodule1.qry_xwcs.Eof do
begin //4o
bjg:=0;
with qry do
begin
close;
sql.Clear ;
sql.Add('select * from cjb0 where xsxh_id=:id and kclb='+''''+'必修'+'''');
parambyname('id').asstring:=datamodule1.qry_xwcs.Fields[0].AsString;
open;
first;
while not qry.Eof do
begin
if (qry.Fields[10].asstring='优秀') or (qry.Fields[10].asstring='良好') or (qry.Fields[10].asstring='中等') or (qry.Fields[10].asstring='及格') or (qry.Fields[10].asstring='不及格') then
begin
if qry.Fields[10].asstring='不及格' then
begin
bjg:=bjg+1;
end;
end
else
begin
if strtofloat(qry.Fields[10].asstring)<60 then
begin
bjg:=bjg+1;
end;
end;
qry.Next ;
end;
if bjg>4 then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*不及格课程数为'+inttostr(bjg);
datamodule1.qry_xwcs.post;
end;
end;
datamodule1.qry_xwcs.Next ;
end;//4o
end; //3o
///////////////////////////////////////////////////////////////////////
{
if listbox2.Items[i]='无重修仍未通过的课程' then
begin
datamodule1.qry_xwcs.first;
while not datamodule1.qry_xwcs.Eof do
begin//3o
with qry do
begin
close;
sql.Clear ;
sql.Add('select * from cxcj where xsxh_id=:id');
parambyname('id').asstring:=datamodule1.qry_xwcs.Fields[0].AsString;
open;
first;
while not qry.Eof do
begin
if strtofloat(qry.Fields[9].asstring)<60 then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*'+qry.Fields[5].asstring+'未通过';
datamodule1.qry_xwcs.post;
end;
qry.Next ;
end;
datamodule1.qry_xwcs.Next;
end;//3o
end;
end; }
if listbox2.Items[i]='无重修仍未通过的课程' then
begin
datamodule1.qry_xwcs.first;
while not datamodule1.qry_xwcs.Eof do
begin//3o
with qry do
begin
close;
sql.Clear ;
sql.Add('select * from cjb0 where xsxh_id=:id');
parambyname('id').asstring:=datamodule1.qry_xwcs.Fields[0].AsString;
open;
first;
while not qry.Eof do
begin
if (qry.Fields[10].asstring='优秀') or (qry.Fields[10].asstring='良好') or (qry.Fields[10].asstring='中等') or (qry.Fields[10].asstring='及格') or (qry.Fields[10].asstring='不及格') then
begin
if qry.Fields[10].asstring='不及格' then
begin
qry1.Close;
qry1.SQL.Clear ;
qry1.SQL.Add('select * from bkcj where xsxh_id=:id and kcbh=:bh');
qry1.ParamByName('id').AsString:=datamodule1.qry_xwcs.Fields[0].AsString;
qry1.ParamByName('bh').AsString:=qry.Fields[4].AsString;
qry1.open;
if (qry1.Fields[9].asstring<>'优秀') and (qry1.Fields[9].asstring<>'良好') and (qry1.Fields[9].asstring<>'中等') and (qry1.Fields[9].asstring<>'及格') then //成绩不存在 或者 是不及格
begin
qry1.Close;
qry1.SQL.Clear ;
qry1.SQL.Add('select * from cxcj where xsxh_id=:id and kcbh=:bh');
qry1.ParamByName('id').AsString:=datamodule1.qry_xwcs.Fields[0].AsString;
qry1.ParamByName('bh').AsString:=qry.Fields[4].AsString;
qry1.open;
if (qry1.Fields[9].asstring<>'优秀') and (qry1.Fields[9].asstring<>'良好') and (qry1.Fields[9].asstring<>'中等') and (qry1.Fields[9].asstring<>'及格') then //成绩不存在 或者 是不及格
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*'+qry.Fields[5].asstring+'未通过';
datamodule1.qry_xwcs.post;
end;
end;
end;
end
else
begin
if strtofloat(qry.Fields[10].asstring)<60 then
begin
qry1.Close;
qry1.SQL.Clear ;
qry1.SQL.Add('select * from bkcj where xsxh_id=:id and kcbh=:bh');
qry1.ParamByName('id').AsString:=datamodule1.qry_xwcs.Fields[0].AsString;
qry1.ParamByName('bh').AsString:=qry.Fields[4].AsString;
qry1.open;
if (qry1.Fields[9].asstring='') or (strtofloat(qry1.Fields[9].asstring)<60) then
begin
qry1.Close;
qry1.SQL.Clear ;
qry1.SQL.Add('select * from cxcj where xsxh_id=:id and kcbh=:bh');
qry1.ParamByName('id').AsString:=datamodule1.qry_xwcs.Fields[0].AsString;
qry1.ParamByName('bh').AsString:=qry.Fields[4].AsString;
qry1.open;
if (qry1.Fields[9].asstring='') or (strtofloat(qry1.Fields[9].asstring)<60) then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:=datamodule1.qry_xwcs.Fields[2].AsString+'*'+qry.Fields[5].asstring+'未通过';
datamodule1.qry_xwcs.post;
end;
end;
end;
end;
qry.Next ;
end;
datamodule1.qry_xwcs.Next;
end;//3o
end;
end;
//////////////////////////////////////////////////////////////////////
i:=i+1; //评审结束
end; //1
with datamodule1.qry_xwcs do
begin
close;
sql.Clear ;
sql.Add('select * from xwcs');
open;
first;
while not eof do
begin
if fields[2].asstring='' then
begin
datamodule1.qry_xwcs.Edit;
datamodule1.qry_xwcs.Fields[2].AsString:='可以获得学位';
datamodule1.qry_xwcs.post;
end;
next;
end;
end;
with datamodule1.qry_xwcs do
begin
close;
sql.Clear ;
sql.Add('select * from xwcs');
open;
end;
xwps:=txwps.create(self);
xwps.showmodal;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -