Esempio n. 1
0
        public ReclamationResponseEN ReadOIDDefault(int identifier
                                                    )
        {
            ReclamationResponseEN reclamationResponseEN = null;

            try
            {
                SessionInitializeTransaction();
                reclamationResponseEN = (ReclamationResponseEN)session.Get(typeof(ReclamationResponseEN), identifier);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is ChroniGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new ChroniGenNHibernate.Exceptions.DataLayerException("Error in ReclamationResponseCAD.", ex);
            }


            finally
            {
                SessionClose();
            }

            return(reclamationResponseEN);
        }
Esempio n. 2
0
// Modify default (Update all attributes of the class)

        public void ModifyDefault(ReclamationResponseEN reclamationResponse)
        {
            try
            {
                SessionInitializeTransaction();
                ReclamationResponseEN reclamationResponseEN = (ReclamationResponseEN)session.Load(typeof(ReclamationResponseEN), reclamationResponse.Identifier);

                reclamationResponseEN.Response = reclamationResponse.Response;


                reclamationResponseEN.ActionState = reclamationResponse.ActionState;


                reclamationResponseEN.CreatedDate = reclamationResponse.CreatedDate;


                session.Update(reclamationResponseEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is ChroniGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new ChroniGenNHibernate.Exceptions.DataLayerException("Error in ReclamationResponseCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
Esempio n. 3
0
        public void Destroy(int identifier
                            )
        {
            try
            {
                SessionInitializeTransaction();
                ReclamationResponseEN reclamationResponseEN = (ReclamationResponseEN)session.Load(typeof(ReclamationResponseEN), identifier);
                session.Delete(reclamationResponseEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is ChroniGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new ChroniGenNHibernate.Exceptions.DataLayerException("Error in ReclamationResponseCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
Esempio n. 4
0
        public int New_(ReclamationResponseEN reclamationResponse)
        {
            try
            {
                SessionInitializeTransaction();
                if (reclamationResponse.Reclamation != null)
                {
                    // Argumento OID y no colección.
                    reclamationResponse.Reclamation = (ChroniGenNHibernate.EN.Chroni.ReclamationEN)session.Load(typeof(ChroniGenNHibernate.EN.Chroni.ReclamationEN), reclamationResponse.Reclamation.Identifier);

                    reclamationResponse.Reclamation.ReclamationResponse
                        = reclamationResponse;
                }

                session.Save(reclamationResponse);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is ChroniGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new ChroniGenNHibernate.Exceptions.DataLayerException("Error in ReclamationResponseCAD.", ex);
            }


            finally
            {
                SessionClose();
            }

            return(reclamationResponse.Identifier);
        }
        public int New_(string p_response, ChroniGenNHibernate.Enumerated.Chroni.ReclamationResponseActionStateEnum p_actionState, Nullable <DateTime> p_createdDate, int p_reclamation)
        {
            ReclamationResponseEN reclamationResponseEN = null;
            int oid;

            //Initialized ReclamationResponseEN
            reclamationResponseEN          = new ReclamationResponseEN();
            reclamationResponseEN.Response = p_response;

            reclamationResponseEN.ActionState = p_actionState;

            reclamationResponseEN.CreatedDate = p_createdDate;


            if (p_reclamation != -1)
            {
                // El argumento p_reclamation -> Property reclamation es oid = false
                // Lista de oids identifier
                reclamationResponseEN.Reclamation            = new ChroniGenNHibernate.EN.Chroni.ReclamationEN();
                reclamationResponseEN.Reclamation.Identifier = p_reclamation;
            }

            //Call to ReclamationResponseCAD

            oid = _IReclamationResponseCAD.New_(reclamationResponseEN);
            return(oid);
        }
        public ReclamationResponseEN ReadOID(int identifier
                                             )
        {
            ReclamationResponseEN reclamationResponseEN = null;

            reclamationResponseEN = _IReclamationResponseCAD.ReadOID(identifier);
            return(reclamationResponseEN);
        }
        public void Modify(int p_ReclamationResponse_OID, string p_response, ChroniGenNHibernate.Enumerated.Chroni.ReclamationResponseActionStateEnum p_actionState, Nullable <DateTime> p_createdDate)
        {
            ReclamationResponseEN reclamationResponseEN = null;

            //Initialized ReclamationResponseEN
            reclamationResponseEN             = new ReclamationResponseEN();
            reclamationResponseEN.Identifier  = p_ReclamationResponse_OID;
            reclamationResponseEN.Response    = p_response;
            reclamationResponseEN.ActionState = p_actionState;
            reclamationResponseEN.CreatedDate = p_createdDate;
            //Call to ReclamationResponseCAD

            _IReclamationResponseCAD.Modify(reclamationResponseEN);
        }