//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "fwserver_TLB.h"
#include "quanxianserverImpl.h"
#include "Unit1.h"
#include "Unit2.h"
#include "Unit3.h"
#include "Unit4.h"
#include "Unit5.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
IquanxianserverDisp fwserv;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::dengluClick(TObject *Sender)
{
/*
// DataModule2->DCOMConnection1->Connected = true;
if(yonghuming->Text!=""&& mima->Text!="" )
{
DataModule2->ClientDataSet1->Active=false;
DataModule2->ClientDataSet1->Params->ParamByName("username")->Value=yonghuming->Text;
DataModule2->ClientDataSet1->Params->ParamByName("yonghumima")->Value=mima->Text;
DataModule2->ClientDataSet1->Active=true;
/* AnsiString name1 = "Select * from memberdata where Name =";
name1 += yonghuming->Text;
//AnsiString mima1 = "Select * from memberdata where Name =";
// mima1 += mima->Text;
if(DataModule2->ClientDataSet1->Active)
DataModule2->ClientDataSet1->Close();
DataModule2->ClientDataSet1->CommandText = name1;
//DataModule2->ClientDataSet1->CommandText = mima1;
try
{
DataModule2->ClientDataSet1->Open();
}
catch(...)
{
Application->MessageBoxA(" 错误~~!","",MB_OK);
return;
}
if(DataModule2->ClientDataSet1->RecordCount>0)
{
if(DataModule2->ClientDataSet1->FieldByName("Quanxian")->Value==1)
{
Form1->Hide();
Form3->ShowModal();
}
if(DataModule2->ClientDataSet1->FieldByName("Quanxian")->Value==2)
{
Form1->Hide();
Form4->ShowModal();
}
if(DataModule2->ClientDataSet1->FieldByName("Quanxian")->Value==3)
{
Form1->Hide();
Form5->ShowModal();
}
}
else
{
//表示没有该用户名
MessageBox(NULL,"用户名不存在请从新输入","登录数据库错误",MB_OK);
yonghuming->Text="";
yonghuming->SetFocus();
mima->Text = "";
ModalResult = mrNone;
}
}
else
{
MessageBox(NULL,"请输入用户名和密码","登录数据库错误",MB_OK);
yonghuming->Text="";
yonghuming->SetFocus();
mima->Text = "";
ModalResult = mrNone;
} */
AnsiString str;
DataModule2->DCOMConnection1->Connected = true;
if(!fwserv.IsBound())
fwserv.Bind(DataModule2->DCOMConnection1->GetServer());//获得接口;
//midasserv->Query1->First();
str = fwserv->yanzheng(WideString(yonghuming->Text),WideString(mima->Text));
//ShowMessage(str+"123132");
if(str=="1")
{ Form1->Hide();
Form3->Show();
}
else if(str=="2")
{ Form1->Hide();
Form4->Show();
}
else if(str=="3")
{Form1->Hide();
Form5->Show();
}
else if(str=="4")
{ ShowMessage("请输入完整的用户名和密码!");
yonghuming->Text="";
yonghuming->SetFocus();
mima->Text = "";
}
else if(str=="5")
{
ShowMessage("输入的用户名不存在!请重新输入!");
yonghuming->Text="";
yonghuming->SetFocus();
mima->Text = "";
}
else if(str=="6")
{
ShowMessage("输入的密码错误!请重新输入!");
mima->SetFocus();
mima->Text="";
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::tuichuClick(TObject *Sender)
{
exit(EXIT_SUCCESS);
}
//---------------------------------------------------------------------------
- 1
- 2
- 3
- 4
- 5
前往页