Exemplo n.º 1
0
        /// <summary>
        /// Create a new BrienzAlert object.
        /// </summary>
        /// <param name="alertID">Initial value of the AlertID property.</param>
        public static BrienzAlert CreateBrienzAlert(global::System.Guid alertID)
        {
            BrienzAlert brienzAlert = new BrienzAlert();

            brienzAlert.AlertID = alertID;
            return(brienzAlert);
        }
Exemplo n.º 2
0
        public BrienzAlert GetAlertByAlertID(Guid AlertID)
        {
            BrienzAlert perAlert = new BrienzAlert();

            using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
            {
                perAlert = BrienzEnt.BrienzAlerts.Where(c => c.AlertID == AlertID).FirstOrDefault();
            }
            return(perAlert);
        }
Exemplo n.º 3
0
 public int UpdateAlert(BrienzAlert alert)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         BrienzAlert ba = BrienzEnt.BrienzAlerts.FirstOrDefault(c => c.AlertID == alert.AlertID);
         ba.AlertSubject  = alert.AlertSubject;
         ba.AlertContent  = alert.AlertContent;
         ba.AlertSeverity = alert.AlertSeverity;
         ba.AlertTime     = alert.AlertTime;
         ba.Alert_Tag     = alert.Alert_Tag;
         ba.AlertReason   = alert.AlertReason;
         return(BrienzEnt.SaveChanges());
     }
 }
Exemplo n.º 4
0
 public int SaveAlert(BrienzAlert alert)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         BrienzAlert ba = new BrienzAlert();
         ba.AlertID       = Guid.NewGuid();
         ba.AlertSubject  = alert.AlertSubject;
         ba.AlertSeverity = alert.AlertSeverity;
         ba.AlertContent  = alert.AlertContent;
         ba.AlertTime     = alert.AlertTime;
         ba.Alert_Tag     = alert.Alert_Tag;
         ba.AlertReason   = alert.AlertReason;
         BrienzEnt.AddToBrienzAlerts(ba);
         return(BrienzEnt.SaveChanges());
     }
 }
Exemplo n.º 5
0
 public bool DeleteAlert(Guid AlertID)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         BrienzAlert ba = BrienzEnt.BrienzAlerts.FirstOrDefault(C => C.AlertID == AlertID);
         if (ba != null)
         {
             BrienzEnt.DeleteObject(ba);
             int result = BrienzEnt.SaveChanges();
             if (result != -1)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the BrienzAlerts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBrienzAlerts(BrienzAlert brienzAlert)
 {
     base.AddObject("BrienzAlerts", brienzAlert);
 }