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; } } }
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); }
public MailRefsType(MailRefs mr) : base(mr) { if (mr == null || mr.IsValid == false) { this.m_IsNull = true; return; } this.m_TIPO_REF = mr.TipoRef.ToString(); }
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); }
public void Update(MailRefs entity) { throw new NotImplementedException(); }
//service per update di un allegato public void UpdateMailRef(MailRefs mailref, bool toCommit) { throw new NotImplementedException(); }