public static bool SaveMeetingParticipant(ATTMeetingParticipant objMeetingParticipant, OracleTransaction Tran)
        {
            try
            {
                string SaveSQL = "SP_ADD_MEETING_PARTICIPANT";

                OracleParameter[] paramArray = new OracleParameter[12];
                int?meetingMemPosID;
                int?desID;

                if (objMeetingParticipant.Action == "A")
                {
                    if (objMeetingParticipant.MeetingMemPosID == -1 || objMeetingParticipant.MeetingMemPosID == 0)
                    {
                        meetingMemPosID = null;
                    }
                    else
                    {
                        meetingMemPosID = objMeetingParticipant.MeetingMemPosID;
                    }

                    if (objMeetingParticipant.IsGrpCaller == "N")
                    {
                        desID = objMeetingParticipant.PositionID;
                        //meetingMemPosID = null;
                    }
                    else
                    {
                        desID = null;
                    }

                    paramArray[0]  = Utilities.GetOraParam(":P_ORG_ID", objMeetingParticipant.OrgID, OracleDbType.Int64, ParameterDirection.Input);
                    paramArray[1]  = Utilities.GetOraParam(":P_MEETING_ID", objMeetingParticipant.MeetingID, OracleDbType.Int64, ParameterDirection.Input);
                    paramArray[2]  = Utilities.GetOraParam(":P_P_ID", objMeetingParticipant.ParticipantID, OracleDbType.Int64, ParameterDirection.InputOutput);
                    paramArray[3]  = Utilities.GetOraParam(":P_PART_ORG_ID", objMeetingParticipant.ParticipantOrgID, OracleDbType.Int64, ParameterDirection.Input);
                    paramArray[4]  = Utilities.GetOraParam(":P_GROUP_ID", objMeetingParticipant.GroupID, OracleDbType.Int64, ParameterDirection.Input);
                    paramArray[5]  = Utilities.GetOraParam(":P_NOTE", objMeetingParticipant.Note, OracleDbType.Varchar2, ParameterDirection.Input);
                    paramArray[6]  = Utilities.GetOraParam(":P_ENTRY_BY", objMeetingParticipant.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input);
                    paramArray[7]  = Utilities.GetOraParam(":P_ENTRY_ON", objMeetingParticipant.EntryOn, OracleDbType.Date, ParameterDirection.Input);
                    paramArray[8]  = Utilities.GetOraParam(":P_IS_GRP_PART", objMeetingParticipant.IsGrpParticipant, OracleDbType.Varchar2, ParameterDirection.Input);
                    paramArray[9]  = Utilities.GetOraParam(":P_POSITION_ID", meetingMemPosID, OracleDbType.Int64, ParameterDirection.Input);
                    paramArray[10] = Utilities.GetOraParam(":P_IS_PRESENT", objMeetingParticipant.IsPresent, OracleDbType.Varchar2, ParameterDirection.Input);
                    paramArray[11] = Utilities.GetOraParam(":P_P_DES_ID", desID, OracleDbType.Int64, ParameterDirection.Input);


                    SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, SaveSQL, paramArray);

                    //objMeetingParticipant.Action = "";
                }


                return(true);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
        public static bool DeleteMeetingParticipant(ATTMeetingParticipant objMeetingParticipant, OracleTransaction Tran)
        {
            try
            {
                if (objMeetingParticipant.Action == "D")
                {
                    string deleteSQL = "SP_DEL_MEETING_PARTICIPANT";

                    OracleParameter[] paramArray = new OracleParameter[3];
                    paramArray[0] = Utilities.GetOraParam(":P_ORG_ID", objMeetingParticipant.OrgID, OracleDbType.Int64, ParameterDirection.Input);
                    paramArray[1] = Utilities.GetOraParam(":P_MEETING_ID", objMeetingParticipant.MeetingID, OracleDbType.Int64, ParameterDirection.Input);
                    paramArray[2] = Utilities.GetOraParam(":P_PARTICIPANT_ID", objMeetingParticipant.ParticipantID, OracleDbType.Int64, ParameterDirection.Input);

                    SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, deleteSQL, paramArray);
                }
                return(true);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
        public static List <ATTMeetingParticipant> SetMeetingParticipant(DataTable tblMP, int orgID, int meetingID)
        {
            try
            {
                List <ATTMeetingParticipant> lstMeetingParticipant = new List <ATTMeetingParticipant>();
                bool      flag          = false;
                bool      flagChkMember = false;
                ArrayList arrVal        = new ArrayList();
                ArrayList arrOtherVal   = new ArrayList();

                arrVal = GetPariticipantList(orgID, meetingID);

                foreach (DataRow row in tblMP.Rows)
                {
                    if (orgID == int.Parse(row["Org_id"].ToString()) &&
                        meetingID == int.Parse(row["meeting_id"].ToString())
                        )
                    {
                        ATTMeetingParticipant objMP = new ATTMeetingParticipant();

                        int?   participantOrgID     = null;
                        int?   groupID              = null;
                        int?   meetingMempositionID = null;
                        int?   positionID           = null;
                        int?   empID         = null;
                        int?   participantID = null;
                        string isGrpParticipant;
                        string positionName = "";



                        if (row["group_id"].ToString() == "")
                        {
                            groupID = null;
                        }
                        else
                        {
                            groupID = int.Parse(row["group_id"].ToString());
                        }

                        if (row["emp_id"].ToString() == "")
                        {
                            empID = null;
                        }
                        else
                        {
                            empID = int.Parse(row["emp_id"].ToString());
                        }

                        if (row["PARTICIPANT_ID"].ToString() == "")
                        {
                            participantID = null;
                        }
                        else
                        {
                            participantID = int.Parse(row["PARTICIPANT_ID"].ToString());
                        }

                        isGrpParticipant = (row["IS_GRP_PARTICIPANT"].ToString()).Trim();



                        if (groupID != null)
                        {
                            if (isGrpParticipant == "O")
                            {
                                if (empID == participantID)
                                {
                                    flag = true;
                                }
                                else
                                {
                                    int l = 0;
                                    if (arrVal.Count > 0)
                                    {
                                        for (int k = 0; k < arrVal.Count; k++)
                                        {
                                            if (empID == int.Parse(arrVal[k].ToString()))
                                            {
                                                l = l + 1;
                                            }
                                        }
                                    }


                                    if (l > 0)
                                    {
                                        flagChkMember = false;
                                    }
                                    else
                                    {
                                        flagChkMember = true;
                                    }

                                    arrVal.Add(empID.ToString());
                                }
                            }
                            else if (isGrpParticipant == "OT")
                            {
                                int m = 0;
                                if (arrOtherVal.Count > 0)
                                {
                                    for (int n = 0; n < arrOtherVal.Count; n++)
                                    {
                                        if (participantID == int.Parse(arrOtherVal[n].ToString()))
                                        {
                                            m = m + 1;
                                        }
                                    }
                                }

                                if (m > 0)
                                {
                                    flag = false;
                                }
                                else
                                {
                                    flag = true;
                                }

                                arrOtherVal.Add(participantID.ToString());
                            }
                        }
                        else
                        {
                            flag = true;
                        }


                        if (flag)
                        {
                            if (row["part_org_ID"].ToString() == "")
                            {
                                participantOrgID = null;
                            }
                            else
                            {
                                participantOrgID = int.Parse(row["part_org_ID"].ToString());
                            }

                            if (row["MEETING_MEMBER_POSITIONID"].ToString() == "")
                            {
                                meetingMempositionID = 0;
                            }
                            else
                            {
                                meetingMempositionID = int.Parse(row["MEETING_MEMBER_POSITIONID"].ToString());
                            }


                            if (row["MEMBER_POSITIONID"].ToString() == "")
                            {
                                positionID = 0;
                            }
                            else
                            {
                                positionID   = int.Parse(row["MEMBER_POSITIONID"].ToString());
                                positionName = row["MEMBER_POSITION_NAME"].ToString();
                            }


                            if (row["des_id"].ToString() != "")
                            {
                                positionID   = int.Parse(row["des_id"].ToString());
                                positionName = row["des_name"].ToString();
                            }


                            lstMeetingParticipant.Add(new ATTMeetingParticipant(
                                                          int.Parse(row["Org_id"].ToString()),
                                                          int.Parse(row["meeting_id"].ToString()),
                                                          int.Parse(participantID.ToString()),
                                                          row["FIRST_NAME"].ToString() +
                                                          (row["MID_NAME"].ToString() == "" ? "" : " " + row["MID_NAME"].ToString()) +
                                                          (row["SUR_NAME"].ToString() == "" ? "" : " " + row["SUR_NAME"].ToString()),
                                                          participantOrgID,
                                                          groupID,
                                                          row["NOTE"].ToString(),
                                                          row["IS_GRP_PARTICIPANT"].ToString(),
                                                          meetingMempositionID,
                                                          positionID,
                                                          positionName,
                                                          "N",
                                                          row["IS_PRESENT"].ToString()
                                                          ));

                            flag = false;
                        }

                        if (flagChkMember)
                        {
                            ATTGroupMember objGroupMem = lstGroupMember.Find(delegate(ATTGroupMember objGM)
                            {
                                return(objGM.GroupID == groupID && objGM.EmpID == empID && (objGM.ToDate == ""));
                            }

                                                                             );

                            if (objGroupMem != null)
                            {
                                lstMeetingParticipant.Add(new ATTMeetingParticipant(
                                                              int.Parse(objGroupMem.OrgID.ToString()),
                                                              meetingID,
                                                              int.Parse(objGroupMem.EmpID.ToString()),
                                                              objGroupMem.EmpName,
                                                              null,
                                                              objGroupMem.GroupID,
                                                              "",
                                                              "",
                                                              -1,
                                                              objGroupMem.PositionID,
                                                              objGroupMem.PositionName,
                                                              "",
                                                              ""
                                                              ));
                            }

                            flagChkMember = false;
                        }
                    }
                }

                return(lstMeetingParticipant);
            }
            catch (Exception ex)
            {
                throw(ex);
            }
        }