Exemple #1
0
        //      public List<NOTIFICATIONDC> LoadAllByEventAndType(int EventId, int TypeId, int UserId, int NoOfPages)
        //{
        //	DBConnection objConnection = new DBConnection();
        //	NOTIFICATIONDA objNOTIFICATIONDA = new NOTIFICATIONDA();
        //          List<NOTIFICATIONDC> objNOTIFICATIONDC = null;
        //          try
        //          {
        //		objConnection.Open(false);
        //              objNOTIFICATIONDC = objNOTIFICATIONDA.LoadAllByEventAndType(objConnection, EventId, TypeId, UserId,NoOfPages);
        //          }
        //          catch (Exception ex)
        //          {
        //              throw ex;
        //          }
        //	finally
        //          {
        //              objConnection.Close();
        //          }
        //          return objNOTIFICATIONDC;
        //}
        public int Update(List <NOTIFICATIONDC> objNOTIFICATIONs)
        {
            int            updatedCount      = 0;
            DBConnection   objConnection     = new DBConnection();
            NOTIFICATIONDA objNOTIFICATIONDA = new NOTIFICATIONDA();

            try
            {
                objConnection.Open(true);
                updatedCount = objNOTIFICATIONDA.Update(objConnection, objNOTIFICATIONs);
                IsDirty      = objNOTIFICATIONDA.IsDirty;
                if (IsDirty)
                {
                    objConnection.Rollback();
                }
                else
                {
                    objConnection.Commit();
                }
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(updatedCount);
        }
Exemple #2
0
        public List <NOTIFICATIONDC> LoadAll()
        {
            DBConnection          objConnection     = new DBConnection();
            NOTIFICATIONDA        objNOTIFICATIONDA = new NOTIFICATIONDA();
            List <NOTIFICATIONDC> objNOTIFICATIONDC = null;

            try
            {
                objConnection.Open(false);
                objNOTIFICATIONDC = objNOTIFICATIONDA.LoadAll(objConnection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objNOTIFICATIONDC);
        }
Exemple #3
0
        public int Insert(List <NOTIFICATIONDC> objNOTIFICATIONs)
        {
            int            insertedCount     = 0;
            DBConnection   objConnection     = new DBConnection();
            NOTIFICATIONDA objNOTIFICATIONDA = new NOTIFICATIONDA();

            try
            {
                objConnection.Open(true);
                insertedCount = objNOTIFICATIONDA.Insert(objConnection, objNOTIFICATIONs);
                objConnection.Commit();
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(insertedCount);
        }