Esempio n. 1
0
        public PergaResponse <List <AreaWithDistance> > GetAreaPassListWithDisctance(double areaID)
        {
            var returnResult = new PergaResponse <List <AreaWithDistance> >();
            var areaPassList = new List <AreaWithDistance>();

            try
            {
                using (SQLConnection = new SQLiteConnection(DatabasePath))
                {
                    areaPassList = SQLConnection.Query <AreaWithDistance>("select TA.areaID, TA.areaName, TA.areaLatitude, TA.isBooth, TA.areaLongitude, TE.distance from AreaPass TE inner join Area TA on TA.areaID = TE.areaExitID where TE.areaEnterID = " + areaID).ToList();
                }

                //burda gateler ve cıkıslar beraber getırılıyor. Yapılması gereken tanımlarda gatelerın cıkartılması (her seferınde yenıden tanımlanmalarına gerek olmadıgından) ve gateler ıcın ayrı select yapılarak sonuca unıon yapılması

                returnResult.Result       = true;
                returnResult.ReturnObject = areaPassList;
            }
            catch (Exception ex)
            {
                returnResult.Result       = false;
                returnResult.Message      = ex.ToString();
                returnResult.ReturnObject = areaPassList;
            }

            return(returnResult);
        }
Esempio n. 2
0
        public PergaResponse <Configuration> GetConfiguration(List <Configuration> configurationList, string paramName)
        {
            var returnResult  = new PergaResponse <Configuration>();
            var configuration = new Configuration();

            try
            {
                configuration = configurationList.Where(x => x.ParamName == paramName).FirstOrDefault();

                returnResult.Result       = true;
                returnResult.ReturnObject = configuration;
            }
            catch (Exception ex)
            {
                returnResult.Result       = false;
                returnResult.Message      = ex.ToString();
                returnResult.ReturnObject = configuration;
            }

            return(returnResult);
        }
Esempio n. 3
0
        public PergaResponse <Configuration> GetConfiguration(string paramName)
        {
            var returnResult  = new PergaResponse <Configuration>();
            var configuration = new Configuration();

            try
            {
                using (SQLConnection = new SQLiteConnection(DatabasePath))
                {
                    configuration = SQLConnection.Query <Configuration>("SELECT * FROM Configuration where ParamName = '" + paramName + "'").FirstOrDefault();
                }

                returnResult.Result       = true;
                returnResult.ReturnObject = configuration;
            }
            catch (Exception ex)
            {
                returnResult.Result       = false;
                returnResult.Message      = ex.ToString();
                returnResult.ReturnObject = configuration;
            }

            return(returnResult);
        }
Esempio n. 4
0
        public PergaResponse <List <Configuration> > GetConfigurationList()
        {
            var returnResult = new PergaResponse <List <Configuration> >();
            var configList   = new List <Configuration>();

            try
            {
                using (SQLConnection = new SQLiteConnection(DatabasePath))
                {
                    configList = SQLConnection.Query <Configuration>("SELECT * FROM Configuration").ToList();
                }

                returnResult.Result       = true;
                returnResult.ReturnObject = configList;
            }
            catch (Exception ex)
            {
                returnResult.Result       = false;
                returnResult.Message      = ex.ToString();
                returnResult.ReturnObject = configList;
            }

            return(returnResult);
        }
Esempio n. 5
0
        public PergaResponse <List <CheckTable> > GetTableList()
        {
            var returnResult = new PergaResponse <List <CheckTable> >();
            var tableList    = new List <CheckTable>();

            try
            {
                using (SQLConnection = new SQLiteConnection(DatabasePath))
                {
                    tableList = SQLConnection.Query <CheckTable>("SELECT name FROM sqlite_master WHERE type = 'table' AND name in ('Area' , 'AreaPass', 'Configuration', 'Road')").ToList();
                }

                returnResult.Result       = true;
                returnResult.ReturnObject = tableList;
            }
            catch (Exception ex)
            {
                returnResult.Result       = false;
                returnResult.Message      = ex.ToString();
                returnResult.ReturnObject = tableList;
            }

            return(returnResult);
        }
Esempio n. 6
0
        public PergaResponse <List <AreaPass> > GetAreaPassListByEntryID(double enteryID)
        {
            var returnResult = new PergaResponse <List <AreaPass> >();
            var areaPassList = new List <AreaPass>();

            try
            {
                using (SQLConnection = new SQLiteConnection(DatabasePath))
                {
                    areaPassList = SQLConnection.Query <AreaPass>("SELECT * FROM AreaPass where AreaEntryID = " + enteryID).ToList();
                }

                returnResult.Result       = true;
                returnResult.ReturnObject = areaPassList;
            }
            catch (Exception ex)
            {
                returnResult.Result       = false;
                returnResult.Message      = ex.ToString();
                returnResult.ReturnObject = areaPassList;
            }

            return(returnResult);
        }