/// <summary>
 /// Create a new t_dmms_master object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="nEW_NRIC">Initial value of the NEW_NRIC property.</param>
 /// <param name="pROPERTY_ADD1">Initial value of the PROPERTY_ADD1 property.</param>
 /// <param name="cERT_START_DATE">Initial value of the CERT_START_DATE property.</param>
 public static t_dmms_master Createt_dmms_master(global::System.Int32 id, global::System.String nEW_NRIC, global::System.String pROPERTY_ADD1, global::System.String cERT_START_DATE)
 {
     t_dmms_master t_dmms_master = new t_dmms_master();
     t_dmms_master.id = id;
     t_dmms_master.NEW_NRIC = nEW_NRIC;
     t_dmms_master.PROPERTY_ADD1 = pROPERTY_ADD1;
     t_dmms_master.CERT_START_DATE = cERT_START_DATE;
     return t_dmms_master;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the t_dmms_master EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTot_dmms_master(t_dmms_master t_dmms_master)
 {
     base.AddObject("t_dmms_master", t_dmms_master);
 }
        private void merging()
        {
            foreach (t_Bank_data bank in bankList)
            {
                List<t_Insurance_data> tempInsList =  new List<t_Insurance_data>();
                tempInsList = getInsurance(bank.policy_no);
                if(tempInsList.Count > 0)
                {
                    foreach(t_Insurance_data tempIns in tempInsList)
                    {
                        t_dmms_master mrgObj = new t_dmms_master();
                        mrgObj.BANK_REF_NO = bank.bank_ref_number;
                        mrgObj.NEW_NRIC = bank.nric;
                        mrgObj.POLICY_NO = bank.policy_no;
                        mrgObj.CUSTOMER_NAME = bank.participant_name;
                        //mrgObj.CUSTOMER_ADD2 = bank.customer_address_1;
                        mrgObj.CUSTOMER_ADD2 = bank.customer_address_2;
                        mrgObj.CUSTOMER_ADD3 = bank.customer_address_3;
                        mrgObj.CUSTOMER_ADD4 = bank.customer_address_4;
                        mrgObj.CUSTOMER_ADD5 = bank.customer_address_5;
                        mrgObj.CUSTOMER_CITY = tempIns.city;
                        mrgObj.CUSTOMER_POSTCODE = tempIns.post_code;
                        mrgObj.PROPERTY_TYPE = bank.property_type;
                        mrgObj.PROPERTY_ADD1 = bank.property_address_1;
                        mrgObj.PROPERTY_ADD2 = bank.property_address_2;
                        mrgObj.PROPERTY_ADD3 = bank.property_address_3;
                        mrgObj.PROPERTY_ADD4 = bank.property_address_4;
                        mrgObj.PROPERTY_CITY = tempIns.property_city;
                        mrgObj.PROPERTY_POSCODE = tempIns.property_post_code;
                        mrgObj.INSURANCE_TYPE = tempIns.insurance_type;
                        mrgObj.CERT_START_DATE = Convert.ToString(bank.policy_effective_date);
                        mrgObj.CERT_END_DATE = Convert.ToString(bank.policy_expired_date);
                        mrgObj.SUM_INSURED_AMOUNT = tempIns.sum_insured_amt;
                        mrgObj.BANK_STAFF = tempIns.bank_staff;
                        mrgObj.ACC_NO = tempIns.account_no;
                        mrgObj.TRITON_ACC_NO = tempIns.triton_account_no;
                        mrgObj.BRANCH_CODE = tempIns.branch_code;
                        mrgObj.FACILTY_TYPE = tempIns.facility_type;
                        mrgObj.APPROVED_LIMIT = tempIns.approved_limit;
                        mrgObj.APPROVED_DATE = Convert.ToString(tempIns.approved_date);
                        mrgObj.BAL_OUTSTANDING = tempIns.balance_outstanding;
                        mrgObj.COST_OUTSTANDING = tempIns.cost_outstanding;
                        mrgObj.PRINCIPAL_OUTSTANDING = tempIns.principal_outstanding;
                        mrgObj.UEI_OUTSTANDING = tempIns.uei_outstanding;
                        mrgObj.MONTH_ARREARS = tempIns.month_arrears;
                        mrgObj.CREDIT_STATUS = tempIns.credit_status;
                        mrgObj.CREDIT_STAT_CHG_DATE = Convert.ToString(tempIns.credit_stat_change_date);
                        mrgObj.NPF_STATUS = tempIns.npf_status;
                        mrgObj.REPORTING_BALANCE = tempIns.reporting_balance;
                        mrgObj.INCOME_ARREARS = tempIns.income_arrears;
                        mrgObj.CURR_BAL_OUTSTANDING = tempIns.curr_balance_outstanding;
                        mrgObj.COLLATERAL_REFNO = tempIns.collateral_ref_number;
                        mrgObj.CLAIM_TYPE = tempIns.claim_type;
                        mrgObj.TITLE_NO = tempIns.title_no;
                        mrgObj.LAND_OFFICE = tempIns.land_office;
                        mrgObj.LOT_NO = tempIns.lot_number;
                        mrgObj.PROPERTY_DISTRICT = tempIns.property_district;
                        mrgObj.MUKIM = tempIns.mukim;
                        mrgObj.SECURITY_VALUE = tempIns.security_value;
                        mrgObj.PROPERTY_DESC = tempIns.property_desc;
                        mrgObj.PROPERTY_OWNER1 = tempIns.property_owner_1;
                        mrgObj.PROPERTY_OWNER2 = tempIns.property_owner_2;
                        mrgObj.INSURANCE_COMPANY = tempIns.insurance_company;
                        mrgObj.COVERAGE_TYPE = tempIns.coverage_type;
                        mrgObj.PARTICIPANT_NAME = tempIns.participant_name;
                        mrgObj.RISK_ADD1 = tempIns.risk_address_1;
                        mrgObj.RISK_ADD2 = tempIns.risk_address_2;
                        mrgObj.RISK_ADD3 = tempIns.risk_address_3;
                        mrgObj.RISK_POSTCODE = tempIns.risk_post_code;
                        mrgObj.RISK_STATE_CODE = tempIns.risk_state_code;
                        mrgObj.PREMIUM_AMOUNT = tempIns.premium_amt;
                        mrgObj.INSURANCE_LAST_MODIFIED_DATE = Convert.ToString(tempIns.insurance_last_modified_date);

                        mrgList.Add(mrgObj);
                    }
                }
                else
                {
                    t_dmms_master mrgObj = new t_dmms_master();
                    mrgObj.BANK_REF_NO = bank.bank_ref_number;
                    mrgObj.NEW_NRIC = bank.nric;
                    mrgObj.POLICY_NO = bank.policy_no;
                    mrgObj.CUSTOMER_NAME = bank.participant_name;
            //                    mrgObj.CUSTOMER_ADD2 = bank.customer_address_1;
                    mrgObj.CUSTOMER_ADD2 = bank.customer_address_2;
                    mrgObj.CUSTOMER_ADD3 = bank.customer_address_3;
                    mrgObj.CUSTOMER_ADD4 = bank.customer_address_4;
                    mrgObj.CUSTOMER_ADD5 = bank.customer_address_5;
                    mrgObj.CUSTOMER_POSTCODE = bank.customer_post_code;
                    mrgObj.PROPERTY_TYPE = bank.property_type;
                    mrgObj.PROPERTY_ADD1 = bank.property_address_1;
                    mrgObj.PROPERTY_ADD2 = bank.property_address_2;
                    mrgObj.PROPERTY_ADD3 = bank.property_address_3;
                    mrgObj.PROPERTY_ADD4 = bank.property_address_4;
                    mrgObj.PROPERTY_POSCODE = bank.property_post_code;
                    mrgObj.CERT_START_DATE = Convert.ToString(bank.policy_effective_date);
                    mrgObj.CERT_END_DATE = Convert.ToString(bank.policy_expired_date);
                    mrgObj.SUM_INSURED_AMOUNT = Convert.ToString(bank.sum_covered);

                    mrgList.Add(mrgObj);
                }
            }
            dataGridView3.DataSource = mrgList;
        }