Ejemplo n.º 1
0
 public void Insert(MailRefs entity)
 {
     try
     {
         using (OracleCommand oCmd = base.CurrentConnection.CreateCommand())
         {
             oCmd.CommandText = cmdInsertMailRefs;
             oCmd.Parameters.Add("MAILID", entity.RefIdMail);
             oCmd.Parameters.Add("DEST", entity.AddresseeMail);
             oCmd.Parameters.Add("TIPO", entity.AddresseeClass.ToString());
             oCmd.BindByName = true;
             oCmd.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         //Allineamento log - Ciro
         if (ex.GetType() != typeof(ManagedException))
         {
             ManagedException mEx = new ManagedException(ex.Message, "ERR_INS001", string.Empty, string.Empty, ex);
             ErrorLogInfo     er  = new ErrorLogInfo(mEx);
             er.objectID = entity.IdRef.ToString();
             log.Error(er);
             throw mEx;
         }
         else
         {
             throw ex;
         }
     }
 }
Ejemplo n.º 2
0
        public int Save(MailRefs entity)
        {
            int ins = 0;

            try
            {
                using (FAXPECContext dbcontext = new FAXPECContext())
                {
                    MAIL_REFS_NEW refs = AutoMapperConfiguration.FromMailRefsNewToDto(entity);
                    dbcontext.MAIL_REFS_NEW.Add(refs);
                    ins = dbcontext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                if (ex.GetType() != typeof(ManagedException))
                {
                    ManagedException mEx = new ManagedException(ex.Message, "ERR_INS002", string.Empty, string.Empty, ex);
                    ErrorLogInfo     er  = new ErrorLogInfo(mEx);
                    er.objectID = entity.IdRef.ToString();
                    log.Error(er);
                    throw mEx;
                }
                else
                {
                    throw ex;
                }
            }
            return(ins);
        }
Ejemplo n.º 3
0
        public MailRefsType(MailRefs mr)
            : base(mr)
        {
            if (mr == null || mr.IsValid == false)
            {
                this.m_IsNull = true;
                return;
            }

            this.m_TIPO_REF = mr.TipoRef.ToString();
        }
Ejemplo n.º 4
0
        public ICollection <Model.MailRefs> GetMailRefsOfAMail(long idMail)
        {
            List <MailRefs> mailRefsList = null;

            try
            {
                using (FAXPECContext dbcontext = new FAXPECContext())
                {
                    List <MAIL_REFS_NEW> listrefs = dbcontext.MAIL_REFS_NEW.Where(x => x.REF_ID_MAIL == idMail).ToList();
                    mailRefsList = new List <MailRefs>();
                    foreach (MAIL_REFS_NEW r in listrefs)
                    {
                        MailRefs mrefsnew = AutoMapperConfiguration.FromMailRefsNewToModel(r);
                        mailRefsList.Add(mrefsnew);
                    }
                }
            }
            catch
            {
                mailRefsList = null;
            }
            return(mailRefsList);
        }
Ejemplo n.º 5
0
 public void Update(MailRefs entity)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 //service per update di un allegato
 public void UpdateMailRef(MailRefs mailref, bool toCommit)
 {
     throw new NotImplementedException();
 }