public int InsertTrainingEvent(TRNTrainingEvent objEvent)
        {
            objEvent.EventID = 1;
            BeginTransaction();

            try
            {
                objEvent.EventID = Insert(objEvent);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objEvent.EventID = -1;
            }

            return objEvent.EventID;
        }
 public int DeleteTrainingEvent(TRNTrainingEvent objEvent)
 {
     objEvent.ModifiedDate = DateTime.Now;
     return new TRNTrainingEventDAO().DeleteTrainingEvent(objEvent);
 }
 public int InsertTrainingEvent(TRNTrainingEvent objEvent)
 {
     objEvent.CreatedDate = DateTime.Now;
     return new TRNTrainingEventDAO().InsertTrainingEvent(objEvent);
 }
        public int UpdateTrainingEvent(TRNTrainingEvent objEvent)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Event", "Batch", "TradeNameID", "StartDate", "EndDate", "ModifiedBy", "ModifiedDate", "Status", "CostSharing", "Regular" };
                rowsaffected = Update(objEvent, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
        public int DeleteTrainingEvent(TRNTrainingEvent objEvent)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "UpdatedBy", "UpdateDate", "Status" };
                rowsaffected = Update(objEvent, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }