About Date : in jsp page declare ,in database declare and declare in java file
In jsp page
<td align="right">জন্ম তারিখ</td>
<td>
<input type="text" id="dob" name="dob"
style="width:103px;"
onFocus="this.style.backgroundColor='#ffff66';"
onBlur="this.style.backgroundColor='#d4e3e5';checkdate(this);entYMD(this.id);"
onKeyPress="return dateWithSlashOnly(this, event)"
onKeyUp="dtval(this,event)" maxlength="16"
title="DD/MM/YYYY" value="<s:date name='hrvPoliceInfo.dob'
format='dd/MM/yyyy'/>"/> <img
src="Calendar/DateTimeJS/images2/cal.gif"
onClick="javascript:NewCssCal('dob','ddMMyyyy','','','24','','todayToPast')"
style="height:20px;width:20px;"/></td>
<td align="right"
colspan="2">বয়স
<input name="yearN"
type="text" onKeyUp="setAgeDate('yearN','monthN','dayN');"
maxLength="2"
onFocus="this.style.backgroundColor='#ffff66';"
onBlur="this.style.backgroundColor='#d4e3e5';" value=""
id="yearN" onKeyPress="return numbersonly(this, event)"
style="width:20px;" title="বছর"/>বছর<input name="monthN" type="text"
onKeyUp="setAgeDate('yearN','monthN','dayN');" size="2"
maxLength="2"
onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';"
value="" id="monthN" onKeyPress="return
numbersonly(this, event)" title="মাস" style="width:20px;"/>মাস<input
name="dayN" type="text"
onKeyUp="setAgeDate('yearN','monthN','dayN');" size="2"
maxLength="2" onChange="doReq(this)" value=""
id="dayN" onKeyPress="return numbersonly(this, event)"
onFocus="this.style.backgroundColor='#ffff66';"
onBlur="this.style.backgroundColor='#d4e3e5';" title="দিন"
style="width:20px;"/>দিন
</td>
PatientRegAction.java
query1 = "insert into op_registration
(reg_no, national_id, full_name,reg_dt, fname, mname,dob,age_yy,age_mm, " +
"age_dd, blood_group, gender, pat_mobile,marital_status,
entered_by,entry_timestamp, " +
"spouse_name, rel_id, police_bp_no)" +
" values " +
" ('"+secVal+"' , " +
" '"+national_id+"' , " +
" '"+full_name+"'
, " +
" to_date('" + datVal + "','DD/MM/YYYY')
, " +
" '"+fname+"' ," +
" '"+mname+"' ," +
" to_date('" + dob + "','DD/MM/YYYY')
, " +
" "+Integer.parseInt(age_yy)+" ," +
" "+Integer.parseInt(age_mm)+" ," +
" "+Integer.parseInt(age_dd)+" ," +
" '"+blood_group+"' ," +
" '"+gender+"' ," +
" '"+pat_mobile+"' ," +
" '"+marital_status+"' ," +
"'Shyfuzzaman', " +
" to_date('" + datVal + "','DD/MM/YYYY')
, " +
" '"+spouse_name+"' ," +
" "+rel_id+" ," +
" '"+bpNo+"' " +
" )";
This page variable declare (PatientRegAction.java):
private String dob;
private String age_fg="12" ;
private String age_yy="2013";
private String age_mm="10";
private String age_dd="12";
private String blood_group;
private String gender;
In jsp Page For gender:
<td align="right"> লিঙ্গ</td>
<td>
<s:if
test='%{hrvPoliceInfo.gender !=null &&
hrvPoliceInfo.gender=="M"}'>
<input type="radio" value="M"
id="gender1" name="gender" checked="checked">
</s:if>
<s:else>
<input type="radio"
value="M" id="gender1" name="gender" />
</s:else>
পুরুষ
<s:if
test='%{hrvPoliceInfo.gender !=null &&
hrvPoliceInfo.gender=="F"}'>
<input type="radio" value="F"
id="gender2" name="gender" checked="checked">
</s:if>
<s:else>
<input type="radio"
value="F" id="gender2" name="gender" />
</s:else>মহিলা <s:if test='%{hrvPoliceInfo.gender !=null
&& hrvPoliceInfo.gender=="O"}'>
<input type="radio" value="O"
id="gender3" name="gender" checked="checked">
</s:if>
<s:else>
<input type="radio"
value="O" id="gender3" name="gender" />
</s:else>অন্যান্য
</td>
##################################################################################
##################################################################################
From Banbeis Learn date declare way
in jsp page, javafile and database :
In javaFile.java
private DateFormating dateFormating;
dateFormating = new DateFormating();
if (recognitionDateNinmoS!=null||!recognitionDateNinmoS.equals("")) {
institutesRecognitionInfo.setRecognitionDate(dateFormating.getCalendarDate("dd/MM/yyyy", recognitionDateNinmoS));
}
This page variable declare (SchoolAction.java):
private String recognitionDateNinmoS="";
in
jsp page:
<input
id="recognitionExpireDate53S"
name="recognitionExpireDate53S" type="text" value="<s:date
name='institutesRecognition53Info.recognitionExpireDate' format='dd/MM/yyyy' />" style="width:200px;"
onFocus="this.style.backgroundColor='#ffff66';"
onBlur="this.style.backgroundColor='#d4e3e5';checkdate(this);"
onKeyPress="return dateWithSlashOnly(this, event)"
onKeyUp="dtval(this,event)" maxlength="10">
What is trim ??
if (!totalFemale.equals("")) {
committeesInfo.setTotalFemale(Integer.valueOf(totalFemale.trim()));
}else{
committeesInfo.setTotalFemale(null);
}
committeesInfo.setTotalFemale(Integer.valueOf(totalFemale.trim()));
}else{
committeesInfo.setTotalFemale(null);
}
No comments:
Post a Comment