public int UpdateMessageServerStatus(string account, string mailUid, MailStatusServer status) { using (MailMessageDaoSQLDb dao = new MailMessageDaoSQLDb()) { return(dao.UpdateServerStatus(account, mailUid, status)); } }
public int UpdateMessageServerStatus(string account, string mailUid, MailStatusServer status) { using (IMailMessageDao dao = getDaoContext().DaoImpl.MailMessageDao) { return(dao.UpdateServerStatus(account, mailUid, status)); } }
public IDictionary <ActiveUp.Net.Common.DeltaExt.MailStatusServer, List <string> > GetAllUIDsByAccount(string account, List <ActiveUp.Net.Common.DeltaExt.MailStatusServer> serverStatus) { Dictionary <MailStatusServer, List <string> > list = null; string[] allStatus = serverStatus.Select(ss => ((int)ss).ToString()).ToArray(); using (FAXPECContext entities = new FAXPECContext()) { var mailServer = (from m in entities.MAIL_INBOX where m.MAIL_ACCOUNT.ToUpper() == account && allStatus.Contains(m.STATUS_MAIL) select new { mailServerId = m.MAIL_SERVER_ID, statusServer = m.STATUS_SERVER }); try { if (mailServer.Count() > 0) { list = new Dictionary <MailStatusServer, List <string> >(); foreach (var v in mailServer) { MailStatusServer stServer = MailStatusServer.UNKNOWN; if (v.statusServer != null) { int val = -1; if (int.TryParse(v.statusServer, out val)) { if (Enum.IsDefined(typeof(MailStatusServer), val)) { stServer = (MailStatusServer)val; } } } if (!list.ContainsKey(stServer)) { list.Add(stServer, new List <string>()); } list[stServer].Add(v.mailServerId); } } } catch (Exception e) { if (!e.GetType().Equals(typeof(ManagedException))) { ManagedException mEx = new ManagedException("Errore nel metodo" + "GetAllUIDsByAccount(string account, List<MailStatusServer> serverStatus). Dettaglio: " + e.Message, "E001", string.Empty, string.Empty, e.InnerException); ErrorLogInfo err = new ErrorLogInfo(mEx); _log.Error(err); list = null; throw mEx; } list = null; throw e; } } return(list); }
public int UpdateServerStatus(string account, string mailUid, MailStatusServer status) { int rows = 0; try { using (OracleCommand cmd = base.CurrentConnection.CreateCommand()) { cmd.CommandText = string.Format("UPDATE MAIL_INBOX SET STATUS_SERVER = '{0}' WHERE MAIL_SERVER_ID = '{1}' AND MAIL_ACCOUNT = '{2}'", (int)status, mailUid, account); rows = cmd.ExecuteNonQuery(); } } catch { } return(rows); }
public IDictionary <MailStatusServer, List <string> > GetAllUIDsByAccount(string account, List <MailStatusServer> serverStatus) { Dictionary <MailStatusServer, List <string> > list = null; using (OracleCommand oCmd = base.CurrentConnection.CreateCommand()) { oCmd.CommandText = "SELECT MAIL_SERVER_ID, STATUS_SERVER from MAIL_INBOX where MAIL_ACCOUNT = '" + account + "' AND STATUS_SERVER IN ('" + String.Join("', '", serverStatus.Select(ss => ((int)ss).ToString()).ToArray()) + "')"; try { using (OracleDataReader r = oCmd.ExecuteReader()) { if (r.HasRows) { list = new Dictionary <MailStatusServer, List <string> >(); while (r.Read()) { MailStatusServer stServer = MailStatusServer.UNKNOWN; if (!r.IsDBNull(1)) { int val = -1; if (int.TryParse(r.GetString(1), out val)) { if (Enum.IsDefined(typeof(MailStatusServer), val)) { stServer = (MailStatusServer)val; } } } if (!list.ContainsKey(stServer)) { list.Add(stServer, new List <string>()); } list[stServer].Add(r.GetString(0)); } } } } catch (Exception e) { //TASK: Allineamento log - Ciro if (!e.GetType().Equals(typeof(ManagedException))) { ManagedException mEx = new ManagedException("Errore nel metodo" + "GetAllUIDsByAccount(string account, List<MailStatusServer> serverStatus). Dettaglio: " + e.Message, "E001", string.Empty, string.Empty, e.InnerException); ErrorLogInfo err = new ErrorLogInfo(mEx); _log.Error(err); list = null; throw mEx; } //ManagedException m = new ManagedException(e.Message,"E001",account,"GetAllUIDsByAccount",e); //ErrorLog error = new ErrorLog(m); //_log.Error(error); list = null; throw e; //throw m; } } return(list); }