Esempio n. 1
0
        public int Update(List <MESSAGES_RMAGDC> objMESSAGES_RMAGs)
        {
            int             updatedCount       = 0;
            DBConnection    objConnection      = new DBConnection();
            MESSAGES_RMAGDA objMESSAGES_RMAGDA = new MESSAGES_RMAGDA();

            try
            {
                objConnection.Open(true);
                updatedCount = objMESSAGES_RMAGDA.Update(objConnection, objMESSAGES_RMAGs);
                IsDirty      = objMESSAGES_RMAGDA.IsDirty;
                if (IsDirty)
                {
                    objConnection.Rollback();
                }
                else
                {
                    objConnection.Commit();
                }
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(updatedCount);
        }
Esempio n. 2
0
        public MESSAGES_RMAGDC LoadByPrimaryKey(int MESSAGE_RMAG_ID)
        {
            DBConnection    objConnection      = new DBConnection();
            MESSAGES_RMAGDA objMESSAGES_RMAGDA = new MESSAGES_RMAGDA();
            MESSAGES_RMAGDC objMESSAGES_RMAGDC = null;

            try
            {
                objConnection.Open(false);
                objMESSAGES_RMAGDC = objMESSAGES_RMAGDA.LoadByPrimaryKey(objConnection, MESSAGE_RMAG_ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objMESSAGES_RMAGDC);
        }
Esempio n. 3
0
        public List <MESSAGES_RMAGDC> LoadAll()
        {
            DBConnection           objConnection      = new DBConnection();
            MESSAGES_RMAGDA        objMESSAGES_RMAGDA = new MESSAGES_RMAGDA();
            List <MESSAGES_RMAGDC> objMESSAGES_RMAGDC = null;

            try
            {
                objConnection.Open(false);
                objMESSAGES_RMAGDC = objMESSAGES_RMAGDA.LoadAll(objConnection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objMESSAGES_RMAGDC);
        }
Esempio n. 4
0
        public int Insert(List <MESSAGES_RMAGDC> objMESSAGES_RMAGs)
        {
            int             insertedCount      = 0;
            DBConnection    objConnection      = new DBConnection();
            MESSAGES_RMAGDA objMESSAGES_RMAGDA = new MESSAGES_RMAGDA();

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