c++builder,下面是具体问题的补充。我想问这代代码需要用什么控件、并且属性值怎么设置???
if(Edit1->Text==""&&Edit2->Text==""){Label2->Caption="用户名和密码不能为空";}elseif(Edit1->Text...
if(Edit1->Text==""&&Edit2->Text==""){Label2->Caption="用户名和密码不能为空";}else if(Edit1->Text==""){Label2->Caption="用户名不能为空";}else if(Edit2->Text==""){Label2->Caption="密码不能为空";}else{//数据连接TADOQuery?*select1=new?TADOQuery(this);//数据过滤select1->Connection=ADOConnection1;
if(Edit1->Text==""&&Edit2->Text==""){Label2->Caption="用户名和密码不能为空";}else if(Edit1->Text==""){Label2->Caption="用户名不能为空";}else if(Edit2->Text==""){Label2->Caption="密码不能为空";}else{select1->Connection=ADOConnection1;if(RadioButton1->Checked==true){select1->SQL->Add("select password,adminID from Admins,Power where Admins.powerID=Power.powerIDand Power.name='营业员' and adminID="+Edit1->Text);select1->Open();if(select1->Eof){Label2->Caption="不存在此用户名";FormActivate(Sender);}else{if(Edit2->Text==select1->FieldByName("password")->AsString){AdminID=select1->FieldByName("adminID")->AsString.ToInt();if(NameSale->Visible==false)NameSale->Visible=true;elseNameSale->Show();Assistant->Visible=false;}else{Label2->Caption="密码错误";FormActivate(Sender);}}}else{select1->SQL->Add("select password,adminID from Admins,Power where Admins.powerID=Power.powerID and adminID="+Edit1->Text);select1->Open();if(select1->Eof){Label2->Caption="不存在此用户名";FormActivate(Sender);}else{if(Edit2->Text==select1->FieldByName("password")->AsString){Admin->adminID=select1->FieldByName("adminID")->AsString.ToInt();if(Admin->Visible==false)Admin->Visible=true;elseAdmin->Show();Assistant->Visible=false;}else{Label2->Caption="密码错误";FormActivate(Sender);}}} 展开
if(Edit1->Text==""&&Edit2->Text==""){Label2->Caption="用户名和密码不能为空";}else if(Edit1->Text==""){Label2->Caption="用户名不能为空";}else if(Edit2->Text==""){Label2->Caption="密码不能为空";}else{select1->Connection=ADOConnection1;if(RadioButton1->Checked==true){select1->SQL->Add("select password,adminID from Admins,Power where Admins.powerID=Power.powerIDand Power.name='营业员' and adminID="+Edit1->Text);select1->Open();if(select1->Eof){Label2->Caption="不存在此用户名";FormActivate(Sender);}else{if(Edit2->Text==select1->FieldByName("password")->AsString){AdminID=select1->FieldByName("adminID")->AsString.ToInt();if(NameSale->Visible==false)NameSale->Visible=true;elseNameSale->Show();Assistant->Visible=false;}else{Label2->Caption="密码错误";FormActivate(Sender);}}}else{select1->SQL->Add("select password,adminID from Admins,Power where Admins.powerID=Power.powerID and adminID="+Edit1->Text);select1->Open();if(select1->Eof){Label2->Caption="不存在此用户名";FormActivate(Sender);}else{if(Edit2->Text==select1->FieldByName("password")->AsString){Admin->adminID=select1->FieldByName("adminID")->AsString.ToInt();if(Admin->Visible==false)Admin->Visible=true;elseAdmin->Show();Assistant->Visible=false;}else{Label2->Caption="密码错误";FormActivate(Sender);}}} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询