/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DataEntryBean;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Tcs Helpdesk10
 */
public class ReportBean {



    private String downloadOption;
    private String pacs_id ;
    private String date;
    private String dccb_code;
    private String refID;
    private String accno;

    private String fromDate;
    private String toDate;
    private String shg_id;
    private String from_date;
    private String to_date;
    private String distCode;
    private String txn_date;
    public String subpacs_id;
    public String cbs_ref_no;
    public String auth_id;
    public String prod_id;
    public String productId;
    public String imgPath;
    public String gl_id;
    public String fileId;
    public String code;
    public String pacs_code;
    public String empId;
    public String yyyymm;

    
    public String getEmpId() {
        return empId;
    }

    public void setEmpId(String empId) {
        this.empId = empId;
    }

    public String getYyyymm() {
        return yyyymm;
    }

    public void setYyyymm(String yyyymm) {
        this.yyyymm = yyyymm;
    }                
    
    public String getPacs_code() {
        return pacs_code;
    }

    public void setPacs_code(String pacs_code) {
        this.pacs_code = pacs_code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getGl_id() {
        return gl_id;
    }

    public void setGl_id(String gl_id) {
        this.gl_id = gl_id;
    }
    
    public String getAccno() {
        return accno;
    }

    public void setAccno(String accno) {
        this.accno = accno;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public String getAccNo() {
        return accNo;
    }

    public void setAccNo(String accNo) {
        this.accNo = accNo;
    }
    public String accNo;


    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProd_id() {
        return prod_id;
    }

    public void setProd_id(String prod_id) {
        this.prod_id = prod_id;
    }

    public String getAuth_id() {
        return auth_id;
    }

    public void setAuth_id(String auth_id) {
        this.auth_id = auth_id;
    }

    public String getCbs_ref_no() {
        return cbs_ref_no;
    }

    public void setCbs_ref_no(String cbs_ref_no) {
        this.cbs_ref_no = cbs_ref_no;
    }

    public String getSubpacs_id() {
        return subpacs_id;
    }

    public void setSubpacs_id(String subpacs_id) {
        this.subpacs_id = subpacs_id;
    }


    public String getTxn_date() {
        return txn_date;
    }

    public void setTxn_date(String txn_date) {
        this.txn_date = txn_date;
    }



    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }



    public String getDistCode() {
        return distCode;
    }

    public void setDistCode(String distCode) {
        this.distCode = distCode;
    }



    public String getFrom_date() {
        return from_date;
    }

    public void setFrom_date(String from_date) {
        this.from_date = from_date;
    }

    public String getTo_date() {
        return to_date;
    }

    public void setTo_date(String to_date) {
        this.to_date = to_date;
    }



    public String getShg_id() {
        return shg_id;
    }

    public void setShg_id(String shg_id) {
        this.shg_id = shg_id;
    }


    public String getFromDate() {
        return fromDate;
    }

    public void setFromDate(String fromDate) {
        this.fromDate = fromDate;
    }

    public String getToDate() {
        return toDate;
    }

    public void setToDate(String toDate) {
        this.toDate = toDate;
    }



    public String getRefID() {
        return refID;
    }

    public void setRefID(String refID) {
        this.refID = refID;
    }




    public String getDownloadOption() {
        return downloadOption;
    }

    public void setDownloadOption(String newDownloadOption) {
        this.downloadOption = newDownloadOption;
    }

    /**
     * @return the pacs_id
     */
    public String getPacs_id() {
        return pacs_id;
    }

    /**
     * @param pacs_id the pacs_id to set
     */
    public void setPacs_id(String pacs_id) {
        this.pacs_id = pacs_id;
    }

    /**
     * @return the txn_date
     */


    /**
     * @return the dccb_code
     */
    public String getDccb_code() {
        return dccb_code;
    }

    /**
     * @param dccb_code the dccb_code to set
     */
    public void setDccb_code(String dccb_code) {
        this.dccb_code = dccb_code;
    }



    public Serializable getData(HttpServletRequest req) {
        HashMap data = new HashMap();
        Class BeanClass = this.getClass();
        //if (logger.isInfoEnabled()) logger.info("Form Bean Class "+formBeanClass);
        Method[] methods = BeanClass.getDeclaredMethods();
        Object val;
        String methodName;
        StringBuffer fieldName = new StringBuffer();
        for (int i = 0; i < methods.length; i++) {
            methodName = methods[i].getName();
            if (!methodName.startsWith("get")) {
                continue;
            }
            if (methods[i].getParameterTypes().length > 0) {
                continue;
            }
            try {
                val = methods[i].invoke(this, null);
                if (null != val && val instanceof String && ((String) val).trim().length() == 0) {
                    val = null;
                }

                fieldName.append(methodName.substring(3, 4).toLowerCase());
                fieldName.append(methodName.substring(4));

                data.put(fieldName.toString(), val);
                fieldName.delete(0, fieldName.length());
            } catch (Exception e) {
               // e.printStackTrace();
               System.out.println("Error occurred during processing.");
            }
        }
        return (Serializable) data;
    }

   }
