public static List <SignalsModel> Get_SignalsHistory(string DeviceID, string TrackID, string GPSSimNumber, string DateFrom, string DateTo)
        {
            List <SignalsModel> _Value = new List <SignalsModel>();

            //SqlConnection _SQLConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DentalAppConn"].ConnectionString);
            SqlConnection _SQLConnection = SQLConnectionString.BuildConnection();

            using (SqlConnection _DBConnection = _SQLConnection)
            {
                SqlCommand _SQLCommand = new SqlCommand();

                _SQLCommand.CommandType = System.Data.CommandType.StoredProcedure;

                _SQLCommand.CommandTimeout = 0;



                using (_SQLCommand)
                {
                    try
                    {
                        _SQLCommand.Connection  = _DBConnection;
                        _SQLCommand.CommandText = "Get_SignalHistory";
                        _SQLCommand.Parameters.AddWithValue("@DeviceID", DeviceID);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);
                        _SQLCommand.Parameters.AddWithValue("@GPSSimNumber", GPSSimNumber);
                        _SQLCommand.Parameters.AddWithValue("@DateFrom", DateFrom);
                        _SQLCommand.Parameters.AddWithValue("@DateTo", DateTo);
                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        SignalsModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result = new SignalsModel();

                            _result.Longitude = _SQLDataReader["Longitude"].ToString();
                            _result.Latitude  = _SQLDataReader["Latitude"].ToString();
                            //   _result.IMEI_no = _SQLDataReader["IMEI_no"].ToString();
                            _result.Speed = _SQLDataReader["Speed"].ToString();
                            //   _result.GPSSimNumber = _SQLDataReader["GPSSimNumber"].ToString();
                            _result.Direction      = _SQLDataReader["Direction"].ToString();
                            _result.BatteryReading = _SQLDataReader["BatteryReading"].ToString();
                            //  _result.TrackItem = _SQLDataReader["TrackItem"].ToString();
                            //  _result.TrackItemType = _SQLDataReader["TrackItemType"].ToString();
                            // _result.GPSModel = _SQLDataReader["GPSModel"].ToString();
                            // _result.AccountNo = _SQLDataReader["AccountNo"].ToString();
                            _result.DateDT = _SQLDataReader["DateDT"].ToString();



                            _Value.Add(_result);
                        }
                    }

                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
//############ WILL BE GET_SIGNALPLOTINGALL ######################################
        public static List <SignalsModel> Get_SignalsMultiple(string Accno)
        {
            List <SignalsModel> _Value = new List <SignalsModel>();

            //SqlConnection _SQLConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DentalAppConn"].ConnectionString);
            SqlConnection _SQLConnection = SQLConnectionString.BuildConnection();

            using (SqlConnection _DBConnection = _SQLConnection)
            {
                SqlCommand _SQLCommand = new SqlCommand();

                _SQLCommand.CommandType = System.Data.CommandType.StoredProcedure;

                _SQLCommand.CommandTimeout = 0;



                using (_SQLCommand)
                {
                    try
                    {
                        _SQLCommand.Connection  = _DBConnection;
                        _SQLCommand.CommandText = "Get_Signalmultiple";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", Accno);

                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        SignalsModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result = new SignalsModel();

                            _result.Longitude     = _SQLDataReader["Longitude"].ToString();
                            _result.Latitude      = _SQLDataReader["Latitude"].ToString();
                            _result.Speed         = _SQLDataReader["Speed"].ToString();
                            _result.TrackItemType = _SQLDataReader["TrackItemType"].ToString();
                            _result.TrackID       = _SQLDataReader["TrackID"].ToString();
                            _result.TrackItem     = _SQLDataReader["TrackItem"].ToString();
                            _Value.Add(_result);
                        }
                    }

                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
        public static List <SignalsModel> Get_SignalsMultiples(string ImeiNo, string count, string AccountNo)
        {
            List <SignalsModel> _Value = new List <SignalsModel>();

            //SqlConnection _SQLConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DentalAppConn"].ConnectionString);
            SqlConnection _SQLConnection = SQLConnectionString.BuildConnection();

            using (SqlConnection _DBConnection = _SQLConnection)
            {
                SqlCommand _SQLCommand = new SqlCommand();

                _SQLCommand.CommandType = System.Data.CommandType.StoredProcedure;

                _SQLCommand.CommandTimeout = 0;



                using (_SQLCommand)
                {
                    try
                    {
                        _SQLCommand.Connection  = _DBConnection;
                        _SQLCommand.CommandText = "Get_Signalmultiples";
                        _SQLCommand.Parameters.AddWithValue("@IMEI_no", ImeiNo);
                        _SQLCommand.Parameters.AddWithValue("@count", count);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        SignalsModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result = new SignalsModel();

                            _result.Longitude      = _SQLDataReader["Longitude"].ToString();
                            _result.Latitude       = _SQLDataReader["Latitude"].ToString();
                            _result.IMEI_no        = _SQLDataReader["IMEI_no"].ToString();
                            _result.Speed          = _SQLDataReader["Speed"].ToString();
                            _result.BatteryReading = _SQLDataReader["BatteryReading"].ToString();
                            _result.DateDT         = _SQLDataReader["DateDT"].ToString();
                            _result.Direction      = _SQLDataReader["Direction"].ToString();
                            _result.TrackID        = _SQLDataReader["TrackID"].ToString();
                            _result.TrackItem      = _SQLDataReader["TrackItem"].ToString();
                            _result.TrackItemType  = _SQLDataReader["TrackItemType"].ToString();
                            _result.GPSModel       = _SQLDataReader["GPSModel"].ToString();
                            _result.AccountNo      = _SQLDataReader["AccountNo"].ToString();
                            _result.GPSSimNumber   = _SQLDataReader["GPSSimNumber"].ToString();
                            _result.Interval       = _SQLDataReader["Interval"].ToString();
                            _result.TrackingMode   = _SQLDataReader["TrackingMode"].ToString();
                            _result.Status         = _SQLDataReader["Status"].ToString();
                            _result.CreatedDate    = _SQLDataReader["CreatedDate"].ToString();
                            _result.ExpiredDate    = _SQLDataReader["ExpiredDate"].ToString();
                            _result.Spare1         = _SQLDataReader["Spare1"].ToString();
                            _result.Spare2         = _SQLDataReader["Spare2"].ToString();
                            _result.Spare3         = _SQLDataReader["Spare3"].ToString();
                            _result.Spare4         = _SQLDataReader["Spare4"].ToString();
                            _result.Spare5         = _SQLDataReader["Spare5"].ToString();
                            _result.Spare6         = _SQLDataReader["Spare6"].ToString();
                            _result.Spare7         = _SQLDataReader["Spare7"].ToString();
                            _result.Spare8         = _SQLDataReader["Spare8"].ToString();
                            _result.Spare9         = _SQLDataReader["Spare9"].ToString();
                            _result.Spare10        = _SQLDataReader["Spare10"].ToString();
                            _result.Spare11        = _SQLDataReader["Spare11"].ToString();
                            _result.Spare12        = _SQLDataReader["Spare12"].ToString();



                            _Value.Add(_result);
                        }
                    }

                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
        public static List <SignalsModel> Get_SignalsSingle(string TrackID, string AccountNo)
        {
            List <SignalsModel> _Value = new List <SignalsModel>();

            //SqlConnection _SQLConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DentalAppConn"].ConnectionString);
            SqlConnection _SQLConnection = SQLConnectionString.BuildConnection();

            using (SqlConnection _DBConnection = _SQLConnection)
            {
                SqlCommand _SQLCommand = new SqlCommand();

                _SQLCommand.CommandType = System.Data.CommandType.StoredProcedure;

                _SQLCommand.CommandTimeout = 0;



                using (_SQLCommand)
                {
                    try
                    {
                        _SQLCommand.Connection  = _DBConnection;
                        _SQLCommand.CommandText = "Get_Signalsingle";
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        //  _SQLCommand.Parameters.AddWithValue("@count", count);
                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        SignalsModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result = new SignalsModel();

                            _result.Longitude            = _SQLDataReader["Longitude"].ToString();
                            _result.Latitude             = _SQLDataReader["Latitude"].ToString();
                            _result.IMEI_no              = _SQLDataReader["IMEI_no"].ToString();
                            _result.Speed                = _SQLDataReader["Speed"].ToString();
                            _result.GPSSimNumber         = _SQLDataReader["GPSSimNumber"].ToString();
                            _result.TrackID              = _SQLDataReader["TrackID"].ToString();
                            _result.BatteryReading       = _SQLDataReader["BatteryReading"].ToString();
                            _result.TrackItem            = _SQLDataReader["TrackItem"].ToString();
                            _result.TrackItemType        = _SQLDataReader["TrackItemType"].ToString();
                            _result.GPSModel             = _SQLDataReader["GPSModel"].ToString();
                            _result.AccountNo            = _SQLDataReader["AccountNo"].ToString();
                            _result.DateDT               = _SQLDataReader["DateDT"].ToString();
                            _result.Direction            = _SQLDataReader["Direction"].ToString();
                            _result.FenceAlertResponder  = _SQLDataReader["FenceAlertResponder"].ToString();
                            _result.FenceAlertResponder2 = _SQLDataReader["FenceAlertResponder2"].ToString();
                            _result.FenceAlertResponder3 = _SQLDataReader["FenceAlertResponder3"].ToString();
                            _result.FenceAlertResponder4 = _SQLDataReader["FenceAlertResponder4"].ToString();


                            _result.FenceAlertResponderRelations  = _SQLDataReader["FenceAlertResponderRelations"].ToString();
                            _result.FenceAlertResponderRelations2 = _SQLDataReader["FenceAlertResponderRelations2"].ToString();
                            _result.FenceAlertResponderRelations3 = _SQLDataReader["FenceAlertResponderRelations3"].ToString();
                            _result.FenceAlertResponderRelations4 = _SQLDataReader["FenceAlertResponderRelations4"].ToString();

                            _result.Fencelenght = _SQLDataReader["Fencelenght"].ToString();
                            _result.Createddate = _SQLDataReader["Createddate"].ToString();
                            _result.FenceName   = _SQLDataReader["FenceName"].ToString();
                            _result.Sex         = _SQLDataReader["Sex"].ToString();

                            _result.Age  = _SQLDataReader["Age"].ToString();
                            _result.Risk = _SQLDataReader["Risk"].ToString();
                            //_result.Picture = _SQLDataReader["Picture"].ToString();



                            _Value.Add(_result);
                        }
                    }

                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }