Exemplo n.º 1
0
        public Dictionary <int, DisplayChannelInfo> GetAllDisplayChannelInfo(ref string errMessage)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            Dictionary <int, DisplayChannelInfo> list = new Dictionary <int, DisplayChannelInfo>();

            try
            {
                DisplayChannelInfo displayChannelInfo;
                DataSet            ds = DisplayChannelDataAccess.GetAllDisplayChannelInfos(db);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    displayChannelInfo = new DisplayChannelInfo(ds.Tables[0].Rows[i]);
                    list.Add(displayChannelInfo.DisplayChannelId, displayChannelInfo);
                }
                return(list);
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(null);
            }
        }
Exemplo n.º 2
0
        public int Delete(ref string errMessage, int monitorId)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(DisplayChannelDataAccess.Delete(db, monitorId));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
Exemplo n.º 3
0
        public int Insert(ref string errMessage, DisplayChannelInfo displayChannelInfo)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(DisplayChannelDataAccess.Insert(db, displayChannelInfo));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
Exemplo n.º 4
0
        public int GetMaxDisplayChannelId(ref string errMessage)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(DisplayChannelDataAccess.GetMaxDisplayChannelId(db));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
Exemplo n.º 5
0
        public int UpdateSplitScreenById(ref string errMessage, int id, int splitScreenNo)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(DisplayChannelDataAccess.UpdateSplitScreenById(db, id, splitScreenNo));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
Exemplo n.º 6
0
        public DisplayChannelInfo GetDisplayChannelInfoById(ref string errMessage, int monitorId)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                DataSet ds = DisplayChannelDataAccess.GetDisplayChannelInfoById(db, monitorId);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    return(null);
                }
                return(new DisplayChannelInfo(ds.Tables[0].Rows[0]));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(null);
            }
        }