HI
I have register.aspx page that there are textboxs and Insertbutton
users can enter their information in this page and when click on Insertbutton their information insert in House_info table
House_info
Id
|
Name
|
City
|
Mobile
|
Tell
|
Freg
|
BehcodeN
|
1
|
Sara
|
Paris
|
12345678
|
32165
|
Null
|
free
|
2
|
Jack
|
Italy
|
65432145
|
32564
|
Null
|
Special
|
3
|
Ana
|
Italy
|
45122132
|
12356
|
Null
|
free
|
and SP
ALTER procedure [dbo].[registerspecial]
@Behcode nvarchar(10),@Name nvarchar(30)nvarchar(5)nvarchar(30),@City nvarchar(30),@BehcodeN nvarchar(10),@Mobile nvarchar(15),@id int,@Success NVARCHAR(80) OUTPUT
as
begin
IF NOT EXISTS(SELECT ID FROM House_Info WHERE BehCode = @Behcode)
begin
Insert into House_Info(BehCode,Name,City,Mobile,BehcodeN)
Values(@Behcode,@Name,@City,@Mobile,'Special')
set @Success='You has been register'
end
else
begin
set @Success='Please enter new behtopcode'
END
end
Now I want when users click on InsertButton it insert information in House_info table and if their Mobile number was in House_table and their BehcodeN="free" it insert in Freg Column value="1"
i.e
in above table there is users with id=3 that Mobile="45122132" and BehcodeN ="free"
Now this users want register so in register.aspx he enter her data and click on Insertbutton (her Mobile number is in House_Info table) so it should insert below data in House_info table
Id
|
Name
|
City
|
Mobile
|
Tell
|
Freg
|
BehcodeN
|
1
|
Sara
|
Paris
|
12345678
|
32165
|
Null
|
free
|
2
|
Jack
|
Italy
|
65432145
|
32564
|
Null
|
Special
|
3
|
Ana
|
Italy
|
45122132
|
12356
|
Null
|
free
|
4
|
Ana
|
Italy
|
45122132
|
12356
|
1
|
Special
|
see here when he click on Insertbutton it insert data in House_info table and if in House_info table search and find her mobile number and if behodeN="free" it insert in Freg column value="1"
HOw I can do it?
Best Regards