private void btnSaveBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveBatchActionPerformed
        String branchName = cmbBranchName.getSelectedItem().toString();
        String courseName = cmbCourseName.getSelectedItem().toString();
        String batchNo = txtBatchNo.getText();
        String batchClassTime = txtBatchClassTime.getText();
        Date bStartDate = null;
        try {
            bStartDate = batchStartDateChooser.getDate();
        } catch (Exception e) {
            e.printStackTrace();
            OBCDialog.showError(getTopWindow().getRootPane(), "Invalid Date");
        }
        String batchStartDate = OBCDateFormat.getMysqlDate(bStartDate);
        String courseFee = txtCourseFee.getText();

        if (cmbBranchName.getSelectedIndex() > 0) {
            if (cmbCourseName.getSelectedIndex() > 0) {
                if (isValidBatchNo(branchName, courseName, batchNo)) {
                    if (!OBCValidation.isValidTime(batchClassTime)) {
                        OBCDialog.showError(getTopWindow().getRootPane(), "Invalid Time");
                    } else {
                        if (bStartDate == null) {
                            OBCDialog.showError(getTopWindow().getRootPane(), "Please Enter Batch Start Date");
                        } else {
                            if (courseFee.isEmpty()) {
                                OBCDialog.showError(getTopWindow().getRootPane(), "Invalid Data");
                            } else {
                                double courseFeedouble = Double.parseDouble(courseFee);
                                try {
                                } catch (Exception e) {
                                }
                                BatchModel bm = new BatchModel();
                                bm.setBranchName(branchName);
                                bm.setCourseName(courseName);
                                bm.setBatchNo(batchNo);
                                bm.setBatchClassTime(batchClassTime);
                                bm.setBatchStartDate(batchStartDate);
                                bm.setCourseFee(courseFeedouble);
                                int r = batchDBO.doInsert(bm);
                                if (r > 0) {
                                    OBCDialog.doInform(getTopWindow().getRootPane(), "Save successful");
                                    showBatchInfo();
                                } else {
                                    OBCDialog.showError(getTopWindow().getRootPane(), "Fail to Save");
                                }
                            }
                        }
                    }
                }
            } else {
                OBCDialog.showError(getTopWindow().getRootPane(), "Please Select Course");
            }
        } else {
            OBCDialog.showError(getTopWindow().getRootPane(), "Please Select Branch");
        }


    }//GEN-LAST:event_btnSaveBatchActionPerformed