soft-c
شنبه 23 مرداد 1389, 12:04 عصر
سلام .
من یک سری کد نوشتم (برای برنامه حسابداری) که اولش مشکل نداشت ولی حالا مشکل پیدا کرده و پیغام is not value valid integer میدهد .
من که هر کاری کردم به جایی نرسیدم .آیا کسی می تونه بگه مشکلش کجاست؟
if (Edit1.Text ='') or (DBEdit1.Text ='') or (DBEdit2.Text ='') or (Edit14.Text ='') or (edit13.Text ='') then
ShowMessage('áØÝÇ åãå í ÝíáÏåÇ ÑÇ Ñ ˜äíÏ')
else
if (RadioButton1.Checked =false) and (RadioButton2.Checked =false ) and (RadioButton3.Checked =false) and (RadioButton4.Checked =false) then
ShowMessage('áØÝÇ í˜í ÇÒ ÍÇáÇÊ æÑæÏ ÇãæÇá ÑÇ ÇäÊÎÇÈ ˜äíÏ')
else
if edit14.Text ='0' then
begin
ShowMessage('æÑæÏ ãÞÏÇÑ ÕÝÑ ããäæÚ ÇÓÊ');
Edit14.Text :='';
end
else
begin
if RadioButton1.Checked =true then
if (Edit3.Text ='') or (SolarDatePicker1.Text ='') then
ShowMessage('áØÝÇ åãå í ÝíáÏåÇ ÑÇ Ñ ˜äíÏ')
else
begin
ADOQuery2.Close ;
ADOQuery2.SQL.Clear ;
ADOQuery2.SQL.Add('select * from ehda where ( code='''+edit1.text+''') and (bani='''+edit3.text+''') and (date='''+solardatepicker1.text+''') and (tahvil='''+edit13.text+''')');
ADOQuery2.Open ;
if ADOQuery2.RecordCount=1 then
ShowMessage('Çíä ˜ÇáÇ ÞÈáÇ ËÈÊ ÔÏå ÇÓÊ ')
else
if ADOQuery2.RecordCount =0 then
begin
ADOQuery1.Close ;
ADOQuery1.SQL.Clear ;
ADOQuery1.SQL.Text := 'insert into ehda (code,bani,date,tedad,tahvil) values ('''+edit1.text+''' , '''+edit3.text+''' , '''+SolarDatePicker1.Text +''' ,'''+edit14.text+''' , '''+ edit13.text +''') ';
ADOQuery1.ExecSQL ;
ShowMessage('ÚãáíÇÊ ÈÇ ãæÝÞíÊ ÇäÌÇã ÔÏ');
edit1.SetFocus ;
ADOQuery11.Close ;
ADOQuery11.SQL.Clear ;
ADOQuery11.SQL.Add('select count from amval where (code='''+edit1.Text +''')');
ADOQuery11.Open ;
a:=strtoint(DBEdit5.Text);
b:=StrToInt(edit14.Text );
DBEdit5.Text :=inttostr(a+b);
ADOQuery10.Close ;
ADOQuery10.SQL.Clear ;
ADOQuery10.SQL.Text :='update amval set count='''+dbedit5.Text +''' where (code='''+edit1.Text +''') ';
ADOQuery10.ExecSQL ;
ADOQuery2.Close ;
ADOQuery2.SQL.Clear ;
ADOQuery2.SQL.Text :='update ehda set [bani]=replace([bani],nchar(1740),nchar(1610)),[tahvil]=replace([tahvil],nchar(1740),nchar(1610))';
ADOQuery2.ExecSQL ;
for i:=0 to Componentcount-1 do
begin
if (Components[i]).ClassName='TEdit' then
TEdit(Components[i]).Clear ;
if (Components[i]).ClassName='TRadioButton' then
TRadioButton(Components[i]).Checked :=false ;
if (Components[i]).ClassName='TDBEdit' then
TDBEdit(Components[i]).Clear ;
if (Components[i]).ClassName='TSolarDatePicker' then
TSolarDatePicker(Components[i]).Clear ;
end;
end;
end ;
تشکر.
من یک سری کد نوشتم (برای برنامه حسابداری) که اولش مشکل نداشت ولی حالا مشکل پیدا کرده و پیغام is not value valid integer میدهد .
من که هر کاری کردم به جایی نرسیدم .آیا کسی می تونه بگه مشکلش کجاست؟
if (Edit1.Text ='') or (DBEdit1.Text ='') or (DBEdit2.Text ='') or (Edit14.Text ='') or (edit13.Text ='') then
ShowMessage('áØÝÇ åãå í ÝíáÏåÇ ÑÇ Ñ ˜äíÏ')
else
if (RadioButton1.Checked =false) and (RadioButton2.Checked =false ) and (RadioButton3.Checked =false) and (RadioButton4.Checked =false) then
ShowMessage('áØÝÇ í˜í ÇÒ ÍÇáÇÊ æÑæÏ ÇãæÇá ÑÇ ÇäÊÎÇÈ ˜äíÏ')
else
if edit14.Text ='0' then
begin
ShowMessage('æÑæÏ ãÞÏÇÑ ÕÝÑ ããäæÚ ÇÓÊ');
Edit14.Text :='';
end
else
begin
if RadioButton1.Checked =true then
if (Edit3.Text ='') or (SolarDatePicker1.Text ='') then
ShowMessage('áØÝÇ åãå í ÝíáÏåÇ ÑÇ Ñ ˜äíÏ')
else
begin
ADOQuery2.Close ;
ADOQuery2.SQL.Clear ;
ADOQuery2.SQL.Add('select * from ehda where ( code='''+edit1.text+''') and (bani='''+edit3.text+''') and (date='''+solardatepicker1.text+''') and (tahvil='''+edit13.text+''')');
ADOQuery2.Open ;
if ADOQuery2.RecordCount=1 then
ShowMessage('Çíä ˜ÇáÇ ÞÈáÇ ËÈÊ ÔÏå ÇÓÊ ')
else
if ADOQuery2.RecordCount =0 then
begin
ADOQuery1.Close ;
ADOQuery1.SQL.Clear ;
ADOQuery1.SQL.Text := 'insert into ehda (code,bani,date,tedad,tahvil) values ('''+edit1.text+''' , '''+edit3.text+''' , '''+SolarDatePicker1.Text +''' ,'''+edit14.text+''' , '''+ edit13.text +''') ';
ADOQuery1.ExecSQL ;
ShowMessage('ÚãáíÇÊ ÈÇ ãæÝÞíÊ ÇäÌÇã ÔÏ');
edit1.SetFocus ;
ADOQuery11.Close ;
ADOQuery11.SQL.Clear ;
ADOQuery11.SQL.Add('select count from amval where (code='''+edit1.Text +''')');
ADOQuery11.Open ;
a:=strtoint(DBEdit5.Text);
b:=StrToInt(edit14.Text );
DBEdit5.Text :=inttostr(a+b);
ADOQuery10.Close ;
ADOQuery10.SQL.Clear ;
ADOQuery10.SQL.Text :='update amval set count='''+dbedit5.Text +''' where (code='''+edit1.Text +''') ';
ADOQuery10.ExecSQL ;
ADOQuery2.Close ;
ADOQuery2.SQL.Clear ;
ADOQuery2.SQL.Text :='update ehda set [bani]=replace([bani],nchar(1740),nchar(1610)),[tahvil]=replace([tahvil],nchar(1740),nchar(1610))';
ADOQuery2.ExecSQL ;
for i:=0 to Componentcount-1 do
begin
if (Components[i]).ClassName='TEdit' then
TEdit(Components[i]).Clear ;
if (Components[i]).ClassName='TRadioButton' then
TRadioButton(Components[i]).Checked :=false ;
if (Components[i]).ClassName='TDBEdit' then
TDBEdit(Components[i]).Clear ;
if (Components[i]).ClassName='TSolarDatePicker' then
TSolarDatePicker(Components[i]).Clear ;
end;
end;
end ;
تشکر.