コード例 #1
0
        public static bool DeleteAppointmentEvents(ATTAppointment objAppointment)
        {
            string deleteSQL      = "SP_DEL_APPOINTMENT";
            int    countAppointee = objAppointment.LstAppointee.Count;

            OracleParameter[] paramArray = new OracleParameter[2];
            paramArray[0] = Utilities.GetOraParam(":p_ORG_ID", objAppointment.OrgID, OracleDbType.Int64, ParameterDirection.Input);
            paramArray[1] = Utilities.GetOraParam(":p_APPOINTMENT_ID", objAppointment.AppointmentID, OracleDbType.Int64, ParameterDirection.InputOutput);

            GetConnection     GetConn = new GetConnection();
            OracleConnection  DBConn  = GetConn.GetDbConn(Module.OAS);
            OracleTransaction Tran    = DBConn.BeginTransaction();

            try
            {
                if (countAppointee > 0)
                {
                    DLLAppointee.DeleteAppointee(objAppointment, null, Tran);
                }

                SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, deleteSQL, paramArray);
                Tran.Commit();

                return(true);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                throw (ex);
            }
            finally
            {
                GetConn.CloseDbConn();
            }
        }
コード例 #2
0
        public static string SaveAppointmentEvents(ATTAppointment objAppointment)
        {
            GetConnection     GetConn = new GetConnection();
            OracleConnection  DBConn  = GetConn.GetDbConn(Module.OAS);
            OracleTransaction Tran    = DBConn.BeginTransaction();


            string saveSQL        = "SP_ADD_APPOINTMENT";
            string eventIDs       = "";
            int    countAppointee = objAppointment.LstAppointee.Count;

            OracleParameter[] paramArray = new OracleParameter[11];
            paramArray[0]  = Utilities.GetOraParam(":p_ORG_ID", objAppointment.OrgID, OracleDbType.Int64, ParameterDirection.Input);
            paramArray[1]  = Utilities.GetOraParam(":p_APPOINTMENT_ID", null, OracleDbType.Int64, ParameterDirection.InputOutput);
            paramArray[2]  = Utilities.GetOraParam(":P_APPOINTMENT_CALLED_BY", objAppointment.AppointmentCalledBy, OracleDbType.Int64, ParameterDirection.Input);
            paramArray[3]  = Utilities.GetOraParam(":P_APPOINTMENT_SUBJECT", objAppointment.AppointmentSubject, OracleDbType.Varchar2, ParameterDirection.Input);
            paramArray[4]  = Utilities.GetOraParam(":P_APPOINTMENT_DATE", objAppointment.AppointmentDate, OracleDbType.Varchar2, ParameterDirection.Input);
            paramArray[5]  = Utilities.GetOraParam(":P_START_TIME", objAppointment.StartTime, OracleDbType.Varchar2, ParameterDirection.Input);
            paramArray[6]  = Utilities.GetOraParam(":P_END_TIME", objAppointment.EndTime, OracleDbType.Varchar2, ParameterDirection.Input);
            paramArray[7]  = Utilities.GetOraParam(":P_VENUE", objAppointment.Venue, OracleDbType.Varchar2, ParameterDirection.Input);
            paramArray[8]  = Utilities.GetOraParam(":P_STATUS", objAppointment.Status, OracleDbType.Int64, ParameterDirection.Input);
            paramArray[9]  = Utilities.GetOraParam(":P_ENTRY_BY", objAppointment.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input);
            paramArray[10] = Utilities.GetOraParam(":P_ENTRY_ON", objAppointment.EntryOn, OracleDbType.Date, ParameterDirection.Input);


            try
            {
                SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, saveSQL, paramArray);
                objAppointment.AppointmentID = int.Parse(paramArray[1].Value.ToString());

                eventIDs += paramArray[1].Value.ToString() + "/";

                if (countAppointee > 0)
                {
                    eventIDs += DLLAppointee.SaveAppointee(objAppointment, Tran);
                }

                Tran.Commit();

                if (eventIDs.Length > 0)
                {
                    eventIDs = eventIDs.Substring(0, eventIDs.Length - 1);
                }

                return(eventIDs);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                throw (ex);
            }
            finally
            {
                GetConn.CloseDbConn();
            }
        }