资源描述:
《【精品】短号码管理代码》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、unitUnitl;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,Menus,StdCtrls,Grids,DBGrids,DB,ADODB;typeTForm1=class(TForm)MainMenu1:TMainMenu;Nl:TMcnuItcm;N2:TMenuItem;N3:TMenuItem;N4:TMenuItem;N5:TMenuItem;N6:TMcnu
2、Itcm;N7:TMenuItem;ComboBox1:TComboBox;Label1:TLabel;Label2:TLabel;Editl:TEdit;DBGridl:TDBGrid;QueryButton:TButton;ADOQueryl:TADOQuery;DataSource1:TDataSource;DataSourcc2:TDataSourcc;DataSource3:TDataSource;ADOQuery2:TADOQuery;ADOQuery3:TADOQuery;DBGrid
3、2:TDBGrid;DBGrid3:TDBGrid;AddButton:TButton;ModButton:TButton;DelButton:TButton;N8:TMenuItem;procedureFormCrcatc(Scndcr:TObjcct);procedureQueryButtonClick(Sender:TObject);procedureN4Click(Sender:TObject);procedureAddButtonClick(Sender:TObject);procedur
4、eDelButtonClick(Sender:TObject);procedureModButtonClick(Scndcr:TObjcct);procedureN8Click(Sender:TObject);procedureComboBoxIChange(Sender:TObject);procedureDBGrid3CellClick(Column:TColumn);private{Privatedeclarations}public//vara,b,c,d,e,f:string;{Publi
5、cdeclarations}end;varForml:TForml;implementationusesunit2,unit3;{$R*.dfm}procedureTForml.FormCrcatc(Scndcr:TObjcct);begincombobox1.items.Add(*手机号码');combobox1.items.Add(°员工工号J;combobox1.items.Add('员工姓名');combobox1.ItcmIndcx:=O;end;procedureTForm1.Query
6、ButtonClick(Sender:TObject);beginifedit1.Text—'thenbeginshowmessage('请输入要查询的内容!');editl.SetFocus;endelseifcombobox1.Text二手机号码'thenbegintrydbgrid1・Visible:=true;dbgrid2.Visiblc:=falsc;dbgrid3.Visible:=false;adoqueryl.Close;adoquery1.SQL.Clear;adoqueryl.
7、SQL.Add(Tselect*fromstel_infowheretelnum=:v_telnum,);adoquery1.Parameters.ParamByNamc(,v_tclnum,).Valuc:=trim(cdit1.Text);adoquery1.Prepared;adoqueryl.Open;exceptonc:cxccptiondoshowmessage('请确认是否正确连接数据库!');ifadoquery1.IsEmptythenbeginshowmessage('查询的资料
8、不存在;editl.SetFocus;endelsebeginform3.cditl.Tcxt:=adoqucry1.ficldbynamcCtclnum^.AsString;formS.editZ.Text^adoqueryl.fieldbynameCopid^.AsString;form3.edit3.Text:=adoqueiy1.fieldbyname(,opnmt).AsString;form3.edit4.Text:=adoqueryl.fieldbyna