1 PACKAGE BODY IGS_EN_VAL_ECPD AS
2 /* $Header: IGSEN35B.pls 115.3 2002/11/28 23:57:43 nsidana ship $ */
3 --
4 -- To validate enr category procedure detail comm type
5 FUNCTION ENRP_VAL_ECPD_COMM(
6 p_enrolment_cat IN VARCHAR2 ,
7 p_enr_method_type IN VARCHAR2 ,
8 p_s_student_comm_type IN VARCHAR2 ,
9 p_message_name OUT NOCOPY VARCHAR2)
10 RETURN boolean AS
11
12 BEGIN
13 DECLARE
14 v_search_comm VARCHAR2(30);
15 v_enrolment_cat IGS_EN_CAT_PRC_DTL.enrolment_cat%TYPE;
16 CURSOR c_ecpd1 IS
17 SELECT ecpd.enrolment_cat
18 FROM IGS_EN_CAT_PRC_DTL ecpd
19 WHERE ecpd.enrolment_cat = p_enrolment_cat AND
20 ecpd.enr_method_type = p_enr_method_type AND
21 ecpd.s_student_comm_type = 'ALL';
22 CURSOR c_ecpd2 IS
23 SELECT ecpd.enrolment_cat
24 FROM IGS_EN_CAT_PRC_DTL ecpd
25 WHERE ecpd.enrolment_cat = p_enrolment_cat AND
26 ecpd.enr_method_type = p_enr_method_type AND
27 ecpd.s_student_comm_type in ('NEW','RETURN');
28 BEGIN
29 -- Validate the commencement type for the IGS_EN_CAT_PRC_DTL;
30 -- All can not be used when there is a specific (being NEW or RETURN)
31 -- record for the same enrolment_cat/enr_method_type combination.
32 -- Set the default message number
33 p_message_name := null;
34 -- Determine which criteria will clash with the parameters.
35 IF p_s_student_comm_type in ('NEW','RETURN') THEN
36 OPEN c_ecpd1;
37 FETCH c_ecpd1 INTO v_enrolment_cat;
38 IF (c_ecpd1%FOUND) THEN
39 CLOSE c_ecpd1;
40 p_message_name := 'IGS_EN_INVALID_NEW_RETURNING';
41 RETURN FALSE;
42 END IF;
43 CLOSE c_ecpd1;
44 ELSE
45 OPEN c_ecpd2;
46 FETCH c_ecpd2 INTO v_enrolment_cat;
47 IF (c_ecpd2%FOUND) THEN
48 CLOSE c_ecpd2;
49 p_message_name := 'IGS_EN_INVALID_NEW_RETURNING';
50 RETURN FALSE;
51 END IF;
52 CLOSE c_ecpd2;
53 END IF;
54 -- Return the default value
55 RETURN TRUE;
56 END;
57 EXCEPTION
58 WHEN OTHERS THEN
59 Fnd_Message.Set_Name('IGS','IGS_GE_UNHANDLED_EXP');
60 FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_ECPD.enrp_val_ecpd_comm');
61 IGS_GE_MSG_STACK.ADD;
62 App_Exception.Raise_Exception;
63
64 END enrp_val_ecpd_comm;
65 --
66 -- To validate the enrol method type for the ecpd
67 FUNCTION enrp_val_ecpd_emt(
68 p_enrolment_method_type IN VARCHAR2 ,
69 p_message_name OUT NOCOPY VARCHAR2)
70 RETURN boolean AS
71 BEGIN
72 DECLARE
73 v_closed_ind IGS_EN_METHOD_TYPE.closed_ind%TYPE;
74 CURSOR c_enr_method_type(
75 cp_enr_method_type IGS_EN_CAT_PRC_DTL.enr_method_type%TYPE) IS
76 SELECT closed_ind
77 FROM IGS_EN_METHOD_TYPE
78 WHERE enr_method_type = cp_enr_method_type;
79 v_other_detail VARCHAR2(255);
80 BEGIN
81 -- validate enr_method_type.closed_ind for a given p_enrolment_method_type
82 p_message_name := null;
83 OPEN c_enr_method_type(
84 p_enrolment_method_type);
85 FETCH c_enr_method_type INTO v_closed_ind;
86 IF(c_enr_method_type%NOTFOUND) THEN
87 RETURN TRUE;
88 END IF;
89 IF(v_closed_ind = 'N') THEN
90 RETURN TRUE;
91 ELSE
92 p_message_name := 'IGS_EN_ENRMTH_TYPE_CLOSED';
93 RETURN FALSE;
94 END IF;
95 EXCEPTION
96 WHEN OTHERS THEN
97 Fnd_Message.Set_Name('IGS','IGS_GE_UNHANDLED_EXP');
98 FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_ECPD.enrp_val_ecpd_emt');
99 IGS_GE_MSG_STACK.ADD;
100 App_Exception.Raise_Exception;
101
102 END;
103 END enrp_val_ecpd_emt;
104 END IGS_EN_VAL_ECPD;