示例#1
0
        public BrienzAction GetActionByActionID(Guid ActionID)
        {
            BrienzAction perAction = new BrienzAction();

            using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
            {
                perAction = BrienzEnt.BrienzActions.Where(c => c.ActionID == ActionID).FirstOrDefault();
            }
            return(perAction);
        }
示例#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);
        }
示例#3
0
        public List <FileProcessHistory> GetAllFileProcessHistory(string filePath)
        {
            List <FileProcessHistory> FileProcessCollection = new List <FileProcessHistory>();

            using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
            {
                FileProcessCollection = BrienzEnt.FileProcessHistories.Where(c => c.FileFolder == filePath).ToList();
            }
            return(FileProcessCollection);
        }
示例#4
0
        public List <BrienzTag> GetAllTags()
        {
            List <BrienzTag> ActionCollection = new List <BrienzTag>();

            using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
            {
                ActionCollection = BrienzEnt.BrienzTags.ToList();
            }
            return(ActionCollection);
        }
示例#5
0
        public List <BrienzAlert> GetAllAlerts()
        {
            List <BrienzAlert> AlertCollection = new List <BrienzAlert>();

            using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
            {
                AlertCollection = BrienzEnt.BrienzAlerts.ToList();
            }
            return(AlertCollection);
        }
示例#6
0
 public int SaveTag(BrienzTag tag)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         BrienzTag ba = new BrienzTag();
         ba.TagContent = tag.TagContent;
         ba.TagFrom    = tag.TagFrom;
         ba.TagID      = Guid.NewGuid();
         ba.FileGuid   = tag.FileGuid;
         BrienzEnt.AddToBrienzTags(ba);
         return(BrienzEnt.SaveChanges());
     }
 }
示例#7
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());
     }
 }
示例#8
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());
     }
 }
示例#9
0
 public int SaveFileProcessHistory(FileProcessHistory FileHistory)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         FileProcessHistory ba = new FileProcessHistory();
         ba.ID         = Guid.NewGuid();
         ba.FileName   = FileHistory.FileName;
         ba.FileFolder = FileHistory.FileFolder;
         ba.OpenTime   = FileHistory.OpenTime;
         ba.FileGuid   = FileHistory.FileGuid;
         ba.CloseTime  = FileHistory.CloseTime;
         ba.BookMark   = FileHistory.BookMark;
         BrienzEnt.AddToFileProcessHistories(ba);
         return(BrienzEnt.SaveChanges());
     }
 }
示例#10
0
 public int UpdateAction(BrienzAction action)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         BrienzAction ba = BrienzEnt.BrienzActions.FirstOrDefault(c => c.ActionID == action.ActionID);
         ba.ActionID      = action.ActionID;
         ba.EndTime       = action.EndTime;
         ba.FromResource  = action.FromResource;
         ba.IsAllDayEvent = action.IsAllDayEvent;
         ba.Location      = action.Location;
         ba.Priority      = action.Priority;
         ba.StartTime     = action.StartTime;
         ba.Subject       = action.Subject;
         ba.ActionContent = action.ActionContent;
         return(BrienzEnt.SaveChanges());
     }
 }
示例#11
0
 public bool DeleteAction(Guid ActionID)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         BrienzAction ba = BrienzEnt.BrienzActions.FirstOrDefault(C => C.ActionID == ActionID);
         if (ba != null)
         {
             BrienzEnt.DeleteObject(ba);
             int result = BrienzEnt.SaveChanges();
             if (result != -1)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
示例#12
0
 public int SaveAction(BrienzAction action)
 {
     using (BrienzDBEntities BrienzEnt = new BrienzDBEntities())
     {
         BrienzAction ba = new BrienzAction();
         ba.ActionID      = Guid.NewGuid();
         ba.EndTime       = action.EndTime;
         ba.FromResource  = action.FromResource;
         ba.IsAllDayEvent = action.IsAllDayEvent;
         ba.Location      = action.Location;
         ba.Priority      = action.Priority;
         ba.StartTime     = action.StartTime;
         ba.Subject       = action.Subject;
         ba.ActionContent = action.ActionContent;
         BrienzEnt.AddToBrienzActions(ba);
         return(BrienzEnt.SaveChanges());
     }
 }