Thursday, March 27, 2014

Banbeis TeacherCensus WorkInstruction

For example why can you do:
int n = 9;
But not:
Integer n = 9;
And you can do:
Integer.parseInt("1");
 
also see parseInt below : 
 
**/In Java, the 'int' type is a primitive , whereas the 'Integer' type is an object. 

##########################################################
java class[model(Info) and Sql part] and getString,getInt,ColoumnLevel,ColoumnIndex,
##########################################################
 // This(TeacherListInfo.java: public class TeacherListInfo {private String institute_id;}) class content many instance, and this instance can content property.
/* Self note For Model(info) and Sql java class
   //private int DESIG_ID; N.B: It is primitive data type which can only hold value But It is not content any value or property
   //DESIG_ID =number
   //FRIST_JOINING_DATE = Date
   
      So declare way is :
      private Integer DESIG_ID;
      private Date FRIST_JOINING_DATE; //For date will be import : import java.util.Date;
     
       // TeacherListSql.java
       And For java  Sql class will be import :import java.util.List;
                                              :import java.util.ArrayList;
       Reason for :List<ReasonAppPatientInfo> teacherTypeList = new ArrayList<ReasonAppPatientInfo>();
       query = "select institute_id,tech_general_info_id,tech_name,desig_id,designation_name ,frist_joining_date  from tech_general_info ";
  index number:              1     ,        2           ,    3     ,   4    ,           5    ,          6
   
   
     //Remember: In Oracle Coloumn Level start from 1  and in java Coloumn Level start from 0 .
         Suppose Coloumn Index  start by 1
              Suppose Coloumn Level is INSTITUTE_ID etc
   
      while (rs.next()) {

TeacherListInfo teacherListInfo = new TeacherListInfo();
teacherListInfo.setInstitute_id(rs.getString("institute_id"));

or

teacherListInfo.setInstitute_id(rs.getString(1));
N.B:getString do support coloumn name and index number acording to sql query

teacherListInfo.setTech_general_info_id(rs.getInt("tech_general_info_id"));
teacherListInfo.setTech_name(rs.getString("tech_name"));
teacherListInfo.setDesig_id(rs.getInt("desig_id"));
teacherListInfo.setDesignation_name(rs.getString("designation_name"));
teacherListInfo.setFrist_joining_date(rs.getDate("frist_joining_date"));
teacherTypeList.add(teacherListInfo);
}


N.B: Can not be resolved to a type that means will be import
     
*/

##########################################################
##########################################################
html 1:output is big case letter
----------------------------------
Upper case : Html : style="text-transform: lowercase;font-variant: small-caps;"
<input class="form-control input-sm" id="iHxName" name="iHxName" type="text" value="" style="text-transform: lowercase;font-variant: small-caps;"/>


html 2:output is only number
-----------------------------
<SCRIPT TYPE="text/javascript">
function numbersonly(myfield, e, dec)
{
//alert("myfield :"+myfield);
//alert("Event :"+e);
//alert("dec :"+dec);
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) ||
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

</SCRIPT>

<input class="" id="" name="" type="text" value="" onKeyPress="return numbersonly(this, event)"/>

***********************************************************************************************************************
***********************************************************************************************************************
DESIG_ID
FRIST_JOINING_DATE
INSTITUTE_ID
TECH_GENERAL_INFO_ID
TECH_NAME
DESIGNATION_NAME




desig_id
frist_joining_date
institute_id
tech_general_info_id
tech_name
designation_name

***********************************
1.

TECH_GENERAL_INFO    = table


INSTITUTE_ID
TECH_GENERAL_INFO_ID = number
TECH_NAME

DESIG_ID =number
DESIGNATION_NAME
FRIST_JOINING_DATE = Date


DESIG_ID
FRIST_JOINING_DATE
INSTITUTE_ID
TECH_GENERAL_INFO_ID
TECH_NAME
DESIGNATION_NAME




select institute_id,tech_general_info_id,tech_name,desig_id,designation_name ,
frist_joining_date  from tech_general_info where institute_id in
(select institute_id from institutes where THANA_ID='032695')



 districts

 thanas
****************************************
District
.........

DISTRICT_ID
DIVISION_ID
DISTRICT_CODE
DISTRICT_NAME
BOARD
BOARD_CODE
MAD_BOARD_CODE

****************************************
Designation
............

DESIGNATION_ID
DESIGNATION_NAME
PROFESSION_TYPE
DESIG_CODE
DESIG_ID = Number
MAD_DESIG

****************************************
Nationality/Country
....................
select country_id,country_name,nationality,active_status from country

COUNTRY_ID
COUNTRY_NAME
NATIONALITY
ACTIVE_STATUS


****************************************
Religion
....................
RELIGION_NO = number
RELIGION_NAME
RELIGION_SL = number
ACTIVE_STATUS


****************************************
PAY_SCALES/PayScale
....................

SCALE_ID
SCALE



////////////////////////////////////////////////////////////
Variable Name :23
....................
....................
teacherName
designation
mpoIndex

gender(genderOne,genderTwo,genderThree)
dob

homeDistrict
nationality

religion
marritalStatus()

firstJoinDateTeach
joinPresentPost

joinThisInstitute
appointFor()

statusGetMpo()
dateGetMpo






Table
------
payscale
basicSalary


allowancesHouseRent
allowancesMedical

allowancesEducation
allowancesConveyance


fromInstitute
others




@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
N.B:Insert Query : So no need java model that means info class. Direct save path : jsp page -> Java action class -> java sql class file through database
insert into op_registration(REG_NO,FULL_NAME,NATIONAL_ID,BLOOD_GROUP,DOB,PAT_MOBILE,GENDER,REL_ID,DISABLE_TYPE,MARITAL_STATUS,SPOUSE_NAME,PAT_TYPE) values('R130100000124','Mehzabin','010','AB ', to_date('02/02/1099','DD/MM/YYYY') , '01234567','F','4','1','2','','1')

RAPH
Radio :Gender
----------------
Step 1:Page Design
<input name="" type="radio" value="" />Male</span>
<span><input name="" type="radio" value="" />Female</span>
<span><input name="" type="radio" value="" />Others</span>



Step 2:only Save (Insert situation)
N.B: No need if else apply
N.B: name is common when get value script

 <td colspan="2" class="textAlignL">
    <span><input id="genderOne" name="gender" type="radio" value="M" />Male</span>
    <span><input id="genderTwo" name="gender" type="radio" value="F" />Female</span>
    <span><input id="genderThree" name="gender" type="radio" value="O" />Others</span>
  </td>


Step 3: Get value using script For Radio Button

//***** Start this portion is use for get Gender radio button  value //gender(genderOne,genderTwo,genderThree)
var radiosA=document.getElementsByName('gender');
alert("radiosA"+radiosA);

var statusValA;
for (var i = 0, length = radiosA.length; i < length; i++) {
    if (radiosA[i].checked) {
        statusValA=radiosA[i].value;      
        alert("statusValA"+statusValA);
        break;
    }
}

N.B: statusValA( This value will be pass in the java class file )

Radio :Marrital Status
-----------------------
Step 1:Page Design
 <td colspan="3" class="textAlignL">
    <span><input name="" type="radio" value="" />Unmarried</span>
    <span><input name="" type="radio" value="" />Married</span>
    <span><input name="" type="radio" value="" />Widow/Widower</span>
    <span><input name="" type="radio" value="" />Divorced</span>
    <span><input name="" type="radio" value="" />Seperate</span>
</td>




Step 2:only Save (Insert situation)
N.B: No need if else apply

    <span><input id="marritaStatusOne" name="marritaStatus" type="radio" value="Un" />Unmarried</span>
    <span><input id="marritaStatusTwo" name="marritaStatus" type="radio" value="Ma" />Married</span>
    <span><input id="marritaStatusThree" name="marritaStatus" type="radio" value="Wi" />Widow/Widower</span>
    <span><input id="marritaStatusFour" name="marritaStatus" type="radio" value="Di" />Divorced</span>
    <span><input id="marritaStatusFive" name="marritaStatus" type="radio" value="Se" />Seperate</span>







// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Combo iterator list value get for Nationality :
<select class="form-control input-sm"  id="nationality" name="nationality"  style="height:26px;font-size:12px;">
<option value="0">Select</option>
    <s:iterator value="nationalityTypeList" status="status">
        <option value="<s:property value='country_id'/>"><s:property value="country_name"/></option>
</s:iterator>
</select>



Table Row Iterate :
 <s:iterator value="teacherTypeList" status="status">
<tr>
  <td width="2%">&nbsp;</td>
  <td width="4%" style="text-align:left;"> <s:property value='tech_name'/></td>
  <td width="15%">&nbsp;</td>
  <td width="2%">&nbsp;</td>
  <td width="4%">&nbsp;</td>
  <td width="15%">&nbsp;</td>
  <td width="15%">
  <span><a href="adminTcEditLadmin.do">Edit</a></span>
  <span><a href="#">Delete</a></span>
  </td>
</tr>
 </s:iterator>


As Table View same Row above :
<table width="100%" border="1px solid #CCC;">
<tr style="font-family:Arial; font-size:12px; font-weight:bold; background:#CCC;">
  <td width="10%">SL.</td>
  <td width="20%">Teacher Name</td>
  <td width="10%">Designation</td>
  <td width="10%">EIIN</td>
  <td width="20%">Institute Name</td>
  <td width="10%">First Join</td>
  <td width="20%">Actions</td>
</tr>
 <s:iterator value="teacherTypeList" status="status">
<tr>
  <td width="2%">&nbsp;</td>
  <td width="4%" style="text-align:left;"> <s:property value='tech_name'/></td>
  <td width="15%">&nbsp;</td>
  <td width="2%">&nbsp;</td>
  <td width="4%">&nbsp;</td>
  <td width="15%">&nbsp;</td>
  <td width="15%">
  <span><a href="adminTcEditLadmin.do">Edit</a></span>
  <span><a href="#">Delete</a></span>
  </td>
</tr>
 </s:iterator>
</table>







Table Row Iterate Use by if else condition apply :
<table >
 <s:if>
 <s:iterator value="teacherTypeList" status="status">
<tr>
  <td width="2%">&nbsp;</td>
  <td width="4%" style="text-align:left;"> <s:property value='tech_name'/></td>
  <td width="15%">&nbsp;</td>
  <td width="2%">&nbsp;</td>
  <td width="4%">&nbsp;</td>
  <td width="15%">&nbsp;</td>
  <td width="15%">
  <span><a href="adminTcEditLadmin.do">Edit</a></span>
  <span><a href="#">Delete</a></span>
  </td>
</tr>        
</s:iterator>
</s:if>
          <s:else>
<tr><td colspan="7">Data not Found</td></tr>      
          </s:else>
</table>







@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

//Combo value Get Using Script
var des1 = document.getElementById('designation');
var designation = des1.options[des1.selectedIndex].value;
alert("designation"+designation);





@@@@@@@@@@@@@@@@@@@@@@@@@@@@
window.location
------------------

//window.location="teacherHisSavePageLadmin.do?"
//window.location="teacherHisSavePageLadmin.do?reg_noA="+reg_noA;

window.location="teacherHisSavePageLadmin.do?teacherName="+teacherName+"&designation="+designation+"&mpoIndex="+mpoIndex+"&gender="+gender+"&dob="+dob+"&homeDistrict="+homeDistrict+"&nationality="+nationality+"&religion="+religion+"&marritalStatus="+marritalStatus+"&firstJoinDateTeach="+firstJoinDateTeach+"&joinPresentPost="+joinPresentPost+"&joinThisInstitute="+joinThisInstitute+"&appointFor="+appointFor+"&statusGetMpo="+statusGetMpo+"&dateGetMpo="+dateGetMpo+"&payscale="+payscale+"&basicSalary="+basicSalary+"&allowancesHouseRent="+allowancesHouseRent+"&allowancesMedical="+allowancesMedical+"&allowancesEducation="+allowancesEducation+"&allowancesConveyance="+allowancesConveyance+"&fromInstitute="+fromInstitute+"&others="+others;




















































#########################################################
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Insert query from pollice:
----------------------------
//***************************Backup Start
/*public void addPatientA(String reg_noA,String dobA,String statusValA,String consultentA,String reason_consulA,String ch_complainA){
    String appoint_no;
   
boolean fg = true;
     con = dbc.connectDB();

     if (con == null) {
         fg = false;
     }
   

if (fg) {
 try {  
   

   String sql="call PRC_BUILD_PK(?, ?,?,?,?,?)";
 
     cs = con.prepareCall(sql);
        cs.setString(1, "USER");
        cs.setString(2, "SEQ_OP_APPOINTMENT");
        cs.setString(3, "P");
        cs.setString(4, "1");
        cs.registerOutParameter(5, java.sql.Types.VARCHAR);
        cs.setString(6, "Y");
         
        cs.execute();
   
        appoint_no = cs.getString(5);

        System.out.println(appoint_no);
        st = con.createStatement();
   
//query = "insert into op_appointment(REG_NO,FULL_NAME,DOB,GENDER,DOCTOR_NO) values ('"+reg_noA+"','"+police_nameA+"','"+dobA+"','"+statusValA+"','"+consultentA+"')";    

   
query = "insert into op_appointment(APPOINT_NO,REG_NO,DOB,GENDER,DOCTOR_NO,CONSULT_TYPE_NO,APPOINT_DATE,COMPANY_NO) " +
" values ('"+appoint_no+"','"+reg_noA+"',to_date('" + dobA + "','DD/MM/YYYY') , '"+statusValA+"','"+consultentA+"','"+reason_consulA+"',sysdate,'1')";

 
System.out.println("Query" + query);
st.execute(query);

//kaniz Upper style follow or this way same
//st.execute("insert into op_patchiefcomplain(APPOINT_NO,CHIEF_COMPLAIN,COMPANY_NO) values('"+appoint_no+"','"+ch_complainA+"','1')");
String query2 = "insert into op_patchiefcomplain(APPOINT_NO,CHIEF_COMPLAIN,COMPANY_NO) values('"+appoint_no+"','"+ch_complainA+"','1')";
System.out.println("Query2" + query2);
st.execute(query2);



} catch (SQLException sq) {          
  sq.printStackTrace();
} finally {
  try {
      if (rs != null) {
          rs.close();
      }
   
      con.close();
  } catch (SQLException ex) {
      ex.printStackTrace();
  }
}
}
       // return NewFaqList;
    }*/
 
//***************************Backup End
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#########################################################
//Notepad search criteria :ctrl+H

//Search table name From Tables not too view (From Toad) :*pay%*

// Here table name PAY_SCALES
select scale_id,scale from pay_scales //put on mouse table name and F4 press from toad editor then show table property



*Run query:F9( No Select scripts for F9)  from toad editor
or select script/not select and click green color execute statement icon
-------------------------------------------------------------------------
DROP TABLE BANBEIS_TEACHER_CENSUS.PAY_SCALES CASCADE CONSTRAINTS;

CREATE TABLE BANBEIS_TEACHER_CENSUS.PAY_SCALES
(
  SCALE_ID                VARCHAR2(2 BYTE),
  SCALE                   VARCHAR2(20 BYTE)     NOT NULL,
  ENTERED_BY              VARCHAR2(10 BYTE),
  ENTRY_TIMESTAMP         DATE,
  LAST_UPDATED_BY         VARCHAR2(10 BYTE),
  LAST_UPDATED_TIMESTAMP  DATE
)
TABLESPACE USERS
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            NEXT             1M
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;








@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
N.B: Only Date query run
Sql java file ://query = "insert into teacher_personal_info(TEACHER_ID,TEACHER_NAME,DESIGNATION,MPO_ID,GENDER,DOB,HOME_DISTRICT,NATIONALITY,RELIGION,MARITAL_STATUS) values ('"+teacher_id+"','"+teacherName+"','"+designation+"','"+mpoIndex+"','"+statusValA+"','"+dob+"','"+homeDistrict+"')";      

insert into teacher_personal_info(TEACHER_ID,TEACHER_NAME,DESIGNATION,MPO_ID,GENDER,DOB,HOME_DISTRICT,NATIONALITY,RELIGION,MARITAL_STATUS) values ('P011403000022','My ','108','3','F','01/01/2000','29','1','1','Un')



outPut: This query is not run because database DOB coloumn name is Date not varchar, if it is varchar then no problem.
As only database coloumn name is Date , so sql java file date(dob) variable is
Sql java file ://query = "insert into teacher_personal_info(TEACHER_ID,TEACHER_NAME,DESIGNATION,MPO_ID,GENDER,DOB,HOME_DISTRICT,NATIONALITY,RELIGION,MARITAL_STATUS) values ('"+teacher_id+"','"+teacherName+"','"+designation+"','"+mpoIndex+"','"+statusValA+"',TO_DATE('"+dob+"','dd/MM/yyyy'),'"+homeDistrict+"')";

insert into teacher_personal_info(TEACHER_ID,TEACHER_NAME,DESIGNATION,MPO_ID,GENDER,DOB,HOME_DISTRICT) values ('P011403000023','My name','108','123','M',TO_DATE('01/01/1983','dd/MM/yyyy'),'18')    
 
So this  situation '"+dob+"' = TO_DATE('"+dob+"','dd/MM/yyyy')


N.B: Although jsp age , java action class and sql file dob is declare As string .insert situation
 Direct save path : jsp page -> Java action class -> java sql class file through database







@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

 public MultiSetupModalInfo roomTypesPARENTIDneedData(String vallookupdtl_id) {   //roomTypesPARENTIDneed
        // List mroomDataList = new ArrayList();
         MultiSetupModalInfo multiSetupModalInfo = new MultiSetupModalInfo();

         boolean fg = true;
         this.con = this.dbc.connectDB();

         if (this.con == null) {
             fg = false;
         }

         if (fg) {
             try {
                 this.st = this.con.createStatement();
 // long  slno = slnoAddtmresource == null || slnoAddtmresource.equals("") ? 0:Long.parseLong(slnoAddtmresource); n.b:If slnoAddtmresource null or faka hoy then zero return korbe otherwise parseInt korbe
        int  vldtl_id = vallookupdtl_id == null || vallookupdtl_id.equals("") ? 0:Integer.parseInt(vallookupdtl_id);
              
                 String query = "SELECT dtl_name FROM rbs_lookup_dtl WHERE lookupdtl_id = "+vldtl_id+"";
                 this.rs = this.st.executeQuery(query);
                 System.out.println("Query" + query);
               
            
               
                 while (rs.next()) {
               
                     multiSetupModalInfo.setDtl_name(rs.getString("dtl_name"));
                     multiSetupModalInfo.setLookupdtl_id(rs.getString("lookupdtl_id"));
                               
                     //mroomDataList.add(multiSetupModalInfo);
                 }
             } catch (SQLException sq) {
                 System.out.println("Info Query Exception "
                         + sq.getMessage());
                 try {
                     if (this.rs != null) {
                         this.rs.close();
                     }
                  

                     this.con.close();
                 } catch (SQLException ex) {
                     ex.printStackTrace();
                 }
             } finally {
                 try {
                     if (this.rs != null) {
                         this.rs.close();
                     }

                     this.con.close();
                 } catch (SQLException ex) {
                     ex.printStackTrace();
                 }
             }
         }

         return multiSetupModalInfo;
     }


stringJava_doubleCotation_varcharDb_singleCotation :






Eclipse property :
"show view as a first view"  icon then display then show record




No comments:

Post a Comment