예제 #1
0
        public static List <TrackingItemModel> Get_Searchcol(string Searchcol)
        {
            List <TrackingItemModel> _Value = new List <TrackingItemModel>();

            //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_SearchCol";
                        _SQLCommand.Parameters.AddWithValue("@Searchcol", Searchcol);

                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        TrackingItemModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result           = new TrackingItemModel();
                            _result.TrackItem = _SQLDataReader["TrackItem"].ToString();
                            _result.TrackID   = _SQLDataReader["TrackID"].ToString();
                            _result.AccountNo = _SQLDataReader["AccountNo"].ToString();


                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
예제 #2
0
        public static bool TrackerDevice_InsertUpdate(int ID, string DeviceID, string DeviceName, string DeviceModel, string Manufacturer, string Supplier, string CapabilityDescript, string CoordinateType, string SimNum, string SimOperator, string Status, string CreatedBy, string ModifiedBy, string IgnitionRemotely, string LockedDoorRemotely, string ArmedRemotely, string HornRemotely, string Interval, string GPSPacket, string TrackerPwd, string TrackerUsrNm, string GPSserverPort, string ServerIP)
        {
            List <TrackerDeviceModel> _Value         = new List <TrackerDeviceModel>();
            SqlConnection             _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "TrackerDevice_InsertUpdate";
                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _SQLCommand.Parameters.AddWithValue("@DeviceID", DeviceID);
                        _SQLCommand.Parameters.AddWithValue("@DeviceName", DeviceName);
                        _SQLCommand.Parameters.AddWithValue("@DeviceModel", DeviceModel);
                        _SQLCommand.Parameters.AddWithValue("@Manufacturer", Manufacturer);
                        _SQLCommand.Parameters.AddWithValue("@Supplier", Supplier);
                        _SQLCommand.Parameters.AddWithValue("@CapabilityDescript", CapabilityDescript);
                        _SQLCommand.Parameters.AddWithValue("@CoordinateType", CoordinateType);
                        _SQLCommand.Parameters.AddWithValue("@SimNum", SimNum);
                        _SQLCommand.Parameters.AddWithValue("@SimOperator", SimOperator);
                        _SQLCommand.Parameters.AddWithValue("@Status", Status);
                        _SQLCommand.Parameters.AddWithValue("@CreatedBy", CreatedBy);
                        _SQLCommand.Parameters.AddWithValue("@ModifiedBy", ModifiedBy);
                        _SQLCommand.Parameters.AddWithValue("@IgnitionRemotely", IgnitionRemotely);
                        _SQLCommand.Parameters.AddWithValue("@LockedDoorRemotely", LockedDoorRemotely);
                        _SQLCommand.Parameters.AddWithValue("@ArmedRemotely", ArmedRemotely);
                        _SQLCommand.Parameters.AddWithValue("@HornRemotely", HornRemotely);
                        _SQLCommand.Parameters.AddWithValue("@Interval", Interval);
                        _SQLCommand.Parameters.AddWithValue("@GPSPacket", GPSPacket);
                        _SQLCommand.Parameters.AddWithValue("@TrackerPwd", TrackerPwd);
                        _SQLCommand.Parameters.AddWithValue("@TrackerUsrNm", TrackerUsrNm);
                        _SQLCommand.Parameters.AddWithValue("@GPSserverPort", GPSserverPort);
                        _SQLCommand.Parameters.AddWithValue("@ServerIP", ServerIP);
                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
        public static List <MilageCountInfoModel> MilageCountInfo_LoadByAccountNoDeviceID(string AccountNo, string DeviceID)
        {
            List <MilageCountInfoModel> _Value = new List <MilageCountInfoModel>();
            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 = "MilageCountInfo_LoadByDeviceAccNo";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@DeviceID", DeviceID);
                        _DBConnection.Open();
                        SqlDataReader        _SQLDataReader = _SQLCommand.ExecuteReader();
                        MilageCountInfoModel _result;
                        while (_SQLDataReader.Read())
                        {
                            _result                          = new MilageCountInfoModel();
                            _result.ID                       = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.AccountNo                = _SQLDataReader["AccountNo"].ToString();
                            _result.DeviceID                 = _SQLDataReader["DeviceID"].ToString();
                            _result.TrackID                  = _SQLDataReader["TrackID"].ToString();
                            _result.CurrentMilage            = Convert.ToInt32(_SQLDataReader["CurrentMilage"].ToString());
                            _result.CurrentMilageStr         = _SQLDataReader["CurrentMilageStr"].ToString();
                            _result.NextAlertMilage          = _SQLDataReader["NextAlertMilage"].ToString();
                            _result.Subscription             = _SQLDataReader["Subscription"].ToString();
                            _result.MilageIntervalAlert      = _SQLDataReader["MilageIntervalAlert"].ToString();
                            _result.MilageAlertVia           = _SQLDataReader["MilageAlertVia"].ToString();
                            _result.ActivationDate           = _SQLDataReader["ActivationDate"].ToString();
                            _result.ExpiredDate              = _SQLDataReader["ExpiredDate"].ToString();
                            _result.AlertSentCount           = _SQLDataReader["AlertSentCount"].ToString();
                            _result.UpdatedBy                = _SQLDataReader["UpdatedBy"].ToString();
                            _result.LastUpdateDate           = _SQLDataReader["LastUpdateDate"].ToString();
                            _result.RowStatus                = _SQLDataReader["RowStatus"].ToString();
                            _result.RecorrectToleranceMilage = _SQLDataReader["RecorrectToleranceMilage"].ToString();
                            _result.LastSentMilageAlertDate  = _SQLDataReader["LastSentMilageAlertDate"].ToString();
                            _result.DateTimes                = _SQLDataReader["DateTimes"].ToString();

                            _Value.Add(_result);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }
            return(_Value);
        }
예제 #4
0
        public static List <MarkerModel> Marker_GetMarker()
        {
            List <MarkerModel> _Value = new List <MarkerModel>();

            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_Marker";

                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        MarkerModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result         = new MarkerModel();
                            _result.ID      = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.Marker1 = _SQLDataReader["Marker1"].ToString();
                            _result.Marker2 = _SQLDataReader["Marker2"].ToString();
                            _result.Marker3 = _SQLDataReader["Marker3"].ToString();
                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
예제 #5
0
        public static bool TrackingItem_InsertUpdate(int ID, string AccountNo, string GPSSimNumber, string TrackID, string DeviceID, string TrackItemType, string TrackItem, string GPSModel, string TrackingMode, string Status, int Term, string CreatedBy, string ModifiedBy, string SearchCol, string Sex, string Risk, string Age, string Picture)
        {
            List <TrackingItemModel> _Value         = new List <TrackingItemModel>();
            SqlConnection            _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "TrackingItem_InsertUpdate";
                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@GPSSimNumber", GPSSimNumber);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);
                        _SQLCommand.Parameters.AddWithValue("@DeviceID", DeviceID);
                        //
                        _SQLCommand.Parameters.AddWithValue("@TrackItemType", TrackItemType);
                        _SQLCommand.Parameters.AddWithValue("@TrackItem", TrackItem);
                        _SQLCommand.Parameters.AddWithValue("@GPSModel", GPSModel);
                        _SQLCommand.Parameters.AddWithValue("@CreatedBy", CreatedBy);
                        _SQLCommand.Parameters.AddWithValue("@ModifiedBy", ModifiedBy);
                        _SQLCommand.Parameters.AddWithValue("@TrackingMode", TrackingMode);
                        _SQLCommand.Parameters.AddWithValue("@Status", Status);
                        _SQLCommand.Parameters.AddWithValue("@Term", Term);
                        _SQLCommand.Parameters.AddWithValue("@SearchCol", SearchCol);

                        _SQLCommand.Parameters.AddWithValue("@Sex", Sex);
                        _SQLCommand.Parameters.AddWithValue("@Risk", Risk);
                        _SQLCommand.Parameters.AddWithValue("@Age", Age);
                        _SQLCommand.Parameters.AddWithValue("@Picture", Picture);



                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }

            return(_value);
        }
        public static List <MilageCountAlertHistoryModel> MilageCountAlertHistory_LoadByDeviceAccNo(string DeviceID, string AccountNo)
        {
            List <MilageCountAlertHistoryModel> _Value = new List <MilageCountAlertHistoryModel>();
            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 = "MilageCountAlertHistory_LoadByDeviceAccNo";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@DeviceID", DeviceID);
                        _DBConnection.Open();
                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();
                        MilageCountAlertHistoryModel _result;
                        while (_SQLDataReader.Read())
                        {
                            _result                            = new MilageCountAlertHistoryModel();
                            _result.ID                         = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.AccountNo                  = _SQLDataReader["AccountNo"].ToString();
                            _result.DeviceID                   = _SQLDataReader["DeviceID"].ToString();
                            _result.DateTimes                  = _SQLDataReader["DateTimes"].ToString();
                            _result.MilageCount                = Convert.ToInt32(_SQLDataReader["MilageCount"].ToString());
                            _result.AlertDateMilageCount       = _SQLDataReader["AlertDateMilageCount"].ToString();
                            _result.AlertRespondedDate         = _SQLDataReader["AlertRespondedDate"].ToString();
                            _result.AlertRespondedBy           = _SQLDataReader["AlertRespondedBy"].ToString();
                            _result.MilageServiceOilEngine     = _SQLDataReader["MilageServiceOilEngine"].ToString();
                            _result.MilageServiceOilEngineDate = _SQLDataReader["MilageServiceOilEngineDate"].ToString();
                            _result.AlertMilageCountNote       = _SQLDataReader["AlertMilageCountNote"].ToString();
                            _result.AlertMillageUpdateInfoDate = _SQLDataReader["AlertMillageUpdateInfoDate"].ToString();
                            _result.TrackID                    = _SQLDataReader["TrackID"].ToString();
                            _result.MilageCountString          = _SQLDataReader["MilageCountString"].ToString();
                            _result.SubsriptionStatus          = _SQLDataReader["SubsriptionStatus"].ToString();
                            _result.AlertRespondedStatus       = _SQLDataReader["AlertRespondedStatus"].ToString();


                            _Value.Add(_result);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }
            return(_Value);
        }
예제 #7
0
        public static List <GPSuserModel> GPSUser_Login(string US, string PWD, string pelayar, string sistemope, string ipAdd)
        {
            List <GPSuserModel> _Value = new List <GPSuserModel>();
            //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 = "GPSUser_Login";
                        _SQLCommand.Parameters.AddWithValue("@UserName", US);
                        _SQLCommand.Parameters.AddWithValue("@Password", PWD);
                        _SQLCommand.Parameters.AddWithValue("@Browser", pelayar);
                        _SQLCommand.Parameters.AddWithValue("@OS", sistemope);
                        _SQLCommand.Parameters.AddWithValue("@IP", ipAdd);
                        //  _SQLCommand.Parameters.AddWithValue("@count", count);
                        _DBConnection.Open();
                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();
                        GPSuserModel  _result;
                        while (_SQLDataReader.Read())
                        {
                            _result               = new GPSuserModel();
                            _result.ID            = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.AccountNo     = _SQLDataReader["AccountNo"].ToString();
                            _result.UserName      = _SQLDataReader["UserName"].ToString();
                            _result.LastLoginDate = _SQLDataReader["LastLoginDate"].ToString();
                            _result.EmailReg      = _SQLDataReader["EmailReg"].ToString();

                            //SMSAlertMsg


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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }
            return(_Value);
        }
예제 #8
0
        public static List <GeoFenceAreaModel> GeoFenceArea_SelectByAccountNoByFenceName(string AccountNo, string FenceName)
        {
            List <GeoFenceAreaModel> _Value = new List <GeoFenceAreaModel>();
            //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 = "GeoFenceArea_SelectByAccountNoByFenceName";

                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@FenceName", FenceName);

                        //  _SQLCommand.Parameters.AddWithValue("@count", count);
                        _DBConnection.Open();
                        SqlDataReader     _SQLDataReader = _SQLCommand.ExecuteReader();
                        GeoFenceAreaModel _result;
                        while (_SQLDataReader.Read())
                        {
                            _result             = new GeoFenceAreaModel();
                            _result.ID          = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.AccountNo   = _SQLDataReader["AccountNo"].ToString();
                            _result.FencePath   = _SQLDataReader["FencePath"].ToString();
                            _result.FenceName   = _SQLDataReader["FenceName"].ToString();
                            _result.CreatedDate = _SQLDataReader["CreatedDate"].ToString();
                            _result.FenceLength = _SQLDataReader["FenceLength"].ToString();
                            _result.Status      = _SQLDataReader["Status"].ToString();
                            _result.ShapeType   = _SQLDataReader["ShapeType"].ToString();

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }
            return(_Value);
        }
        public static bool Geofence_Update(string AccountNo, string TrackID, string TrackItem, string Fencelenght, string FencePath, string ShapeType, string FenceAlertemail, string FenceAlertemail2, string FenceAlertemail3, string FenceAlertPhone, string FenceAlertPhone2, string FenceAlertPhone3, string Createdby, string CreatedOS, string FenceStatus, string SendAlertStatus, string SenderEmail, string Senderphone)
        {
            List <GeoFenceModel> _Value         = new List <GeoFenceModel>();
            SqlConnection        _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "Geofence_Update";
                      _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                      _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);
                      _SQLCommand.Parameters.AddWithValue("@TrackItem", TrackItem);
                      _SQLCommand.Parameters.AddWithValue("@Fencelenght", Fencelenght);
                      _SQLCommand.Parameters.AddWithValue("@FencePath", FencePath);
                      _SQLCommand.Parameters.AddWithValue("@ShapeType", ShapeType);
                      _SQLCommand.Parameters.AddWithValue("@FenceAlertemail", FenceAlertemail);
                      _SQLCommand.Parameters.AddWithValue("@FenceAlertemail2", FenceAlertemail2);
                      _SQLCommand.Parameters.AddWithValue("@FenceAlertemail3", FenceAlertemail3);
                      _SQLCommand.Parameters.AddWithValue("@FenceAlertPhone", FenceAlertPhone);
                      _SQLCommand.Parameters.AddWithValue("@FenceAlertPhone2", FenceAlertPhone2);
                      _SQLCommand.Parameters.AddWithValue("@FenceAlertPhone3", FenceAlertPhone3);
                      _SQLCommand.Parameters.AddWithValue("@Createdby", Createdby);
                      _SQLCommand.Parameters.AddWithValue("@CreatedOS", CreatedOS);
                      _SQLCommand.Parameters.AddWithValue("@FenceStatus", FenceStatus);
                      _SQLCommand.Parameters.AddWithValue("@SendAlertStatus", SendAlertStatus);
                      _SQLCommand.Parameters.AddWithValue("@SenderEmail", SenderEmail);
                      _SQLCommand.Parameters.AddWithValue("@Senderphone", Senderphone);
                      _DBConnection.Open();
                      _SQLCommand.ExecuteNonQuery();
                  }

                  catch (Exception ex)
                  {
                      _value = false;
                  }

                  finally
                  {
                      _DBConnection.Close();
                  }
              } }

            return(_value);
        }
        public static bool Account_InsertUpdate(string AccountNo, string AccountName, string AAddress, string AMobilePhone, string AHousePhone, string AOfficePhone, string AAlertPhone,
                                                string AEmail, string AAlertEmail, string AVersion, string ACreatedBy, string status, int AItemRegisterCount)
        {
            List <RegisteredAccountModel> _Value = new List <RegisteredAccountModel>();
            SqlConnection _SQLConnection         = SQLConnectionString.BuildConnection();
            bool          _value = true;

            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 = "Account_InsertUpdate";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@AccountName", AccountName);
                        _SQLCommand.Parameters.AddWithValue("@AAddress", AAddress);
                        _SQLCommand.Parameters.AddWithValue("@AMobilePhone", AMobilePhone);
                        _SQLCommand.Parameters.AddWithValue("@AHousePhone", AHousePhone);
                        _SQLCommand.Parameters.AddWithValue("@AOfficePhone", AOfficePhone);
                        _SQLCommand.Parameters.AddWithValue("@AAlertPhone", AAlertPhone);
                        _SQLCommand.Parameters.AddWithValue("@AEmail", AEmail);
                        _SQLCommand.Parameters.AddWithValue("@AAlertEmail", AAlertEmail);
                        _SQLCommand.Parameters.AddWithValue("@AVersion", AVersion);
                        _SQLCommand.Parameters.AddWithValue("@ACreatedBy", ACreatedBy);
                        _SQLCommand.Parameters.AddWithValue("@Status", status);
                        _SQLCommand.Parameters.AddWithValue("@AItemRegisterCount", AItemRegisterCount);
                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
예제 #11
0
        public static bool User_loginUpdate(string UserName, string Password, string AccountNo, string UpdateBy,
                                            string LoginIP, string Browser, string OS, int ID)
        {
            List <GPSuserModel> _Value         = new List <GPSuserModel>();
            SqlConnection       _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "Userlogin_Update";
                        _SQLCommand.Parameters.AddWithValue("@UserName", UserName);
                        _SQLCommand.Parameters.AddWithValue("@Password", Password);
                        //_SQLCommand.Parameters.AddWithValue("@Version", Version);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);

                        _SQLCommand.Parameters.AddWithValue("@UpdateBy", UpdateBy);
                        _SQLCommand.Parameters.AddWithValue("@LoginIP", LoginIP);
                        //_SQLCommand.Parameters.AddWithValue("@LoginType", LoginType);
                        _SQLCommand.Parameters.AddWithValue("@Browser", Browser);
                        _SQLCommand.Parameters.AddWithValue("@OS", OS);
                        //_SQLCommand.Parameters.AddWithValue("@EmailReg", EmailReg);
                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
예제 #12
0
        public static bool AutoFenceTimer_InsertUpdate(int ID, string TrackItem, string TrackID, string AccountNo, string FencePath, string ShapeType,
                                                       string FenceAreaName, string TimeFrom, string TimeTo, string DaySetting, string Status, string FenceLength)
        {
            List <AutoFenceTimerModel> _Value = new List <AutoFenceTimerModel>();
            SqlConnection _SQLConnection      = SQLConnectionString.BuildConnection();
            bool          _value = true;

            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 = "AutoFenceTimer_InsertUpdate";
                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _SQLCommand.Parameters.AddWithValue("@TrackItem", TrackItem);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@FencePath", FencePath);
                        _SQLCommand.Parameters.AddWithValue("@ShapeType", ShapeType);
                        _SQLCommand.Parameters.AddWithValue("@FenceAreaName", FenceAreaName);
                        _SQLCommand.Parameters.AddWithValue("@TimeFrom", TimeFrom);
                        _SQLCommand.Parameters.AddWithValue("@TimeTo", TimeTo);
                        _SQLCommand.Parameters.AddWithValue("@DaySetting", DaySetting);
                        _SQLCommand.Parameters.AddWithValue("@Status", Status);
                        _SQLCommand.Parameters.AddWithValue("@FenceLength", FenceLength);

                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }

            return(_value);
        }
        public static List <RegisteredAccountModel> Get_AccLatestID()
        {
            List <RegisteredAccountModel> _Value = new List <RegisteredAccountModel>();
            //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_AccLatestID";
                        //   _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        //  _SQLCommand.Parameters.AddWithValue("@count", count);
                        _DBConnection.Open();
                        SqlDataReader          _SQLDataReader = _SQLCommand.ExecuteReader();
                        RegisteredAccountModel _result;
                        while (_SQLDataReader.Read())
                        {
                            _result       = new RegisteredAccountModel();
                            _result.AccID = Convert.ToInt32(_SQLDataReader["AccID"].ToString());

                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
        public static bool ResponderAlert_InsertUpdate(int ID, string AccountNo, string ResponderName, string ResponderRelationShip, string ResponderPhoneNo, string ResponderEmail, string Status, string GeofenceStatus, string User)
        {
            List <ResponderAlertModel> _Value = new List <ResponderAlertModel>();
            SqlConnection _SQLConnection      = SQLConnectionString.BuildConnection();
            bool          _value = true;

            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 = "ResponderAlert_InsertUpdate";
                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@ResponderName", ResponderName);
                        _SQLCommand.Parameters.AddWithValue("@ResponderRelationShip", ResponderRelationShip);
                        _SQLCommand.Parameters.AddWithValue("@ResponderPhoneNo", ResponderPhoneNo);
                        _SQLCommand.Parameters.AddWithValue("@ResponderEmail", ResponderEmail);
                        _SQLCommand.Parameters.AddWithValue("@Status", Status);
                        _SQLCommand.Parameters.AddWithValue("@GeofenceStatus", GeofenceStatus);
                        _SQLCommand.Parameters.AddWithValue("@User", User);

                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }

            return(_value);
        }
예제 #15
0
        public static bool GeoFenceArea_Insert(string AccountNo, string FencePath, string FenceName, string Fencelenght, string ShapeType, string TrackID)
        {
            List <GeoFenceAreaModel> _Value         = new List <GeoFenceAreaModel>();
            SqlConnection            _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "GeoFenceArea_Insert";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@FencePath", FencePath);
                        _SQLCommand.Parameters.AddWithValue("@FenceName", FenceName);
                        _SQLCommand.Parameters.AddWithValue("@Fencelenght", Fencelenght);
                        _SQLCommand.Parameters.AddWithValue("@ShapeType", ShapeType);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);

                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
        public static bool Geofence_SettingInsertUpdate(string AccountNo, string TrackID, string MarkerPoint, string PanMap, string AttachedLabel, string Interval)
        {
            List <SettingModel> _Value         = new List <SettingModel>();
            SqlConnection       _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "GeoFence_InsertUpdateSetting";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);
                        _SQLCommand.Parameters.AddWithValue("@MarkerPoint", MarkerPoint);
                        _SQLCommand.Parameters.AddWithValue("@PanMap", PanMap);
                        _SQLCommand.Parameters.AddWithValue("@AttachedLabel", AttachedLabel);
                        _SQLCommand.Parameters.AddWithValue("@Interval", Interval);
                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
        public static bool Account_Disabled(int AccID, string AccountNo, string AStatus, string AModifiedBy)
        {
            List <RegisteredAccountModel> _Value = new List <RegisteredAccountModel>();
            SqlConnection _SQLConnection         = SQLConnectionString.BuildConnection();
            bool          _value = true;

            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 = "Account_Disabled";
                        _SQLCommand.Parameters.AddWithValue("@AccID", AccID);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);

                        _SQLCommand.Parameters.AddWithValue("@AStatus", AStatus);
                        _SQLCommand.Parameters.AddWithValue("@AModifiedBy", AModifiedBy);
                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
        public static List <MilageCountAlertHistoryModel> MilageCountAlertHistory_LoadReceiptPictureByID(int ID, string DeviceID)
        {
            List <MilageCountAlertHistoryModel> _Value = new List <MilageCountAlertHistoryModel>();
            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 = "MilageCountAlertHistory_LoadReceiptPictureByID";
                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _SQLCommand.Parameters.AddWithValue("@DeviceID", DeviceID);
                        _DBConnection.Open();
                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();
                        MilageCountAlertHistoryModel _result;
                        while (_SQLDataReader.Read())
                        {
                            _result = new MilageCountAlertHistoryModel();
                            _result.MilageServiceReceiptPicture = _SQLDataReader["MilageServiceReceiptPicture]"].ToString();
                            _Value.Add(_result);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }
            return(_Value);
        }
예제 #19
0
        public static bool AutoFenceTimer_Delete(int ID, string AccountNo)
        {
            List <AutoFenceTimerModel> _Value = new List <AutoFenceTimerModel>();
            SqlConnection _SQLConnection      = SQLConnectionString.BuildConnection();
            bool          _value = true;

            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 = "AutoFenceTimer_DeleteByID";

                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
예제 #20
0
        public static bool User_loginDisabled(int ID)
        {
            List <GPSuserModel> _Value         = new List <GPSuserModel>();
            SqlConnection       _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "Userlogin_Disabled";
                        _SQLCommand.Parameters.AddWithValue("@ID", ID);
                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_value);
        }
        public static bool Geofence_OutOfFence_Respond(string AccountNo, string TrackID)
        {
            List <GeoFenceModel> _Value         = new List <GeoFenceModel>();
            SqlConnection        _SQLConnection = SQLConnectionString.BuildConnection();
            bool _value = true;

            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 = "Geofence_OutOfFence_Respond";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);

                        _DBConnection.Open();
                        _SQLCommand.ExecuteNonQuery();
                    }

                    catch (Exception ex)
                    {
                        _value = false;
                    }

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }

            return(_value);
        }
예제 #22
0
        public static List <GPSuserModel> Get_UserbyAccNo(string AccountNo)
        {
            List <GPSuserModel> _Value = new List <GPSuserModel>();
            //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_UserByAccNo";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);

                        //  _SQLCommand.Parameters.AddWithValue("@count", count);
                        _DBConnection.Open();
                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();
                        GPSuserModel  _result;
                        while (_SQLDataReader.Read())
                        {
                            _result                = new GPSuserModel();
                            _result.ID             = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.UserName       = _SQLDataReader["UserName"].ToString();
                            _result.Password       = _SQLDataReader["Password"].ToString();
                            _result.Version        = _SQLDataReader["Version"].ToString();
                            _result.Status         = _SQLDataReader["Status"].ToString();
                            _result.AccountNo      = _SQLDataReader["AccountNo"].ToString();
                            _result.RegisterBy     = _SQLDataReader["RegisterBy"].ToString();
                            _result.UpdateBy       = _SQLDataReader["UpdateBy"].ToString();
                            _result.CreatedDate    = _SQLDataReader["CreatedDate"].ToString();
                            _result.ModifiedDate   = _SQLDataReader["ModifiedDate"].ToString();
                            _result.ExpiredDate    = _SQLDataReader["ExpiredDate"].ToString();
                            _result.LoginIP        = _SQLDataReader["LoginIP"].ToString();
                            _result.LoginType      = _SQLDataReader["LoginType"].ToString();
                            _result.LastLoginDate  = _SQLDataReader["LastLoginDate"].ToString();
                            _result.LoginCount     = _SQLDataReader["LoginCount"].ToString();
                            _result.LastLogOutDate = _SQLDataReader["LastLogOutDate"].ToString();
                            _result.Browser        = _SQLDataReader["Browser"].ToString();
                            _result.OS             = _SQLDataReader["OS"].ToString();
                            _result.EmailReg       = _SQLDataReader["EmailReg"].ToString();

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }
            return(_Value);
        }
        public static List <GeoFenceModel> Geofence_Select(string AccountNo, string TrackID)
        {
            List <GeoFenceModel> _Value = new List <GeoFenceModel>();

            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_Geofence";

                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);

                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        GeoFenceModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result             = new GeoFenceModel();
                            _result.ID          = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.AccountNo   = _SQLDataReader["AccountNo"].ToString();
                            _result.TrackID     = _SQLDataReader["TrackID"].ToString();
                            _result.TrackItem   = _SQLDataReader["TrackItem"].ToString();
                            _result.Fencelenght = _SQLDataReader["Fencelenght"].ToString();


                            _result.FencePath        = _SQLDataReader["FencePath"].ToString();
                            _result.ShapeType        = _SQLDataReader["ShapeType"].ToString();
                            _result.FenceAlertemail  = _SQLDataReader["FenceAlertemail"].ToString();
                            _result.FenceAlertemail2 = _SQLDataReader["FenceAlertemail2"].ToString();


                            _result.FenceAlertemail3 = _SQLDataReader["FenceAlertemail3"].ToString();
                            _result.FenceAlertPhone  = _SQLDataReader["FenceAlertPhone"].ToString();
                            _result.FenceAlertPhone2 = _SQLDataReader["FenceAlertPhone2"].ToString();

                            _result.FenceAlertPhone3 = _SQLDataReader["FenceAlertPhone3"].ToString();
                            _result.Createdby        = _SQLDataReader["Createdby"].ToString();
                            _result.Createddate      = _SQLDataReader["Createddate"].ToString();
                            _result.CreatedOS        = _SQLDataReader["CreatedOS"].ToString();


                            _result.FenceStatus     = _SQLDataReader["FenceStatus"].ToString();
                            _result.SendAlertStatus = _SQLDataReader["SendAlertStatus"].ToString();
                            _result.SenderEmail     = _SQLDataReader["SenderEmail"].ToString();
                            _result.Senderphone     = _SQLDataReader["Senderphone"].ToString();
                            _result.ModifiedDate    = _SQLDataReader["ModifiedDate"].ToString();
                            _result.ModifiedBy      = _SQLDataReader["ModifiedBy"].ToString();
                            _result.FenceName       = _SQLDataReader["FenceName"].ToString();
                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
예제 #24
0
        public static List <GeofenceAlertHistoryModel> Get_GeofenceAlertHistoryByAccNo(string AccNo)
        {
            List <GeofenceAlertHistoryModel> _Value = new List <GeofenceAlertHistoryModel>();

            //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 = "GeofenceAlertHistory_GetByAccNo";

                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccNo);
                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        GeofenceAlertHistoryModel _result;

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

                            //_result.ID = _SQLDataReader["ID"].ToString();
                            _result.AccountNo = _SQLDataReader["AccountNo"].ToString();
                            _result.TrackID   = _SQLDataReader["TrackID"].ToString();
                            _result.TrackItem = _SQLDataReader["TrackItem"].ToString();
                            //_result.Fencelength = _SQLDataReader["Fencelength"].ToString();
                            //_result.FencePath = _SQLDataReader["FencePath"].ToString();
                            //_result.ShapeType = _SQLDataReader["ShapeType"].ToString();
                            //_result.Longituded = _SQLDataReader["Longituded"].ToString();
                            //_result.Latituded = _SQLDataReader["Latituded"].ToString();
                            //_result.AlertDate = _SQLDataReader["AlertDate"].ToString();
                            _result.FenceAreaName      = _SQLDataReader["FenceAreaName"].ToString();
                            _result.CreatedGeofenceID  = _SQLDataReader["CreatedGeofenceID"].ToString();
                            _result.TrackingItem_Alert = _SQLDataReader["TrackingItem_Alert"].ToString();

                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
예제 #25
0
        public static List <GeofenceAlertHistoryModel> Get_GeofenceAlertHistoryByTrackID(string TrackID, string DateFrom, string DateTo, string GeofenceID)
        {//31-01-2016
            //31/01/2016
            //20160131
            //20160131
            int i = 0;

            string[] dated = new string [3];
            string[] words = DateFrom.Split('-');
            string   dt;

            foreach (string word in words)
            {
                dated[i] = word;
                i++;
            }
            dt = dated[2] + dated[1] + dated[0];
            List <GeofenceAlertHistoryModel> _Value = new List <GeofenceAlertHistoryModel>();

            //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 = "GeofenceAlertHistory_GetByTrackID";

                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);
                        _SQLCommand.Parameters.AddWithValue("@DateFrom", dt);
                        _SQLCommand.Parameters.AddWithValue("@DateTo", dt);
                        _SQLCommand.Parameters.AddWithValue("@GeofenceID", GeofenceID);
                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        GeofenceAlertHistoryModel _result;

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

                            _result.ID                = _SQLDataReader["ID"].ToString();
                            _result.AccountNo         = _SQLDataReader["AccountNo"].ToString();
                            _result.TrackID           = _SQLDataReader["TrackID"].ToString();
                            _result.TrackItem         = _SQLDataReader["TrackItem"].ToString();
                            _result.Fencelength       = _SQLDataReader["Fencelength"].ToString();
                            _result.FencePath         = _SQLDataReader["FencePath"].ToString();
                            _result.ShapeType         = _SQLDataReader["ShapeType"].ToString();
                            _result.Longituded        = _SQLDataReader["Longituded"].ToString();
                            _result.Latituded         = _SQLDataReader["Latituded"].ToString();
                            _result.AlertDate         = _SQLDataReader["AlertDate"].ToString();
                            _result.FenceAreaName     = _SQLDataReader["FenceAreaName"].ToString();
                            _result.CreatedGeofenceID = _SQLDataReader["CreatedGeofenceID"].ToString();
                            // _result.TrackingItem_Alert = _SQLDataReader["TrackingItem_Alert"].ToString();

                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



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

            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_GeofenceSettingByID";

                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        _SQLCommand.Parameters.AddWithValue("@TrackID", TrackID);

                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        SettingModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result               = new SettingModel();
                            _result.ID            = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.AccountNo     = _SQLDataReader["AccountNo"].ToString();
                            _result.TrackID       = _SQLDataReader["TrackID"].ToString();
                            _result.MarkerPoint   = _SQLDataReader["MarkerPoint"].ToString();
                            _result.PanMap        = _SQLDataReader["PanMap"].ToString();
                            _result.AttachedLabel = _SQLDataReader["AttachedLabel"].ToString();
                            _result.Interval      = _SQLDataReader["Interval"].ToString();

                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
예제 #27
0
        public static List <GPSuserModel> Get_User(string US, string PWD, string pelayar, string sistemope, string ipAdd)
        {
            List <GPSuserModel> _Value = new List <GPSuserModel>();
            //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_Login";
                        _SQLCommand.Parameters.AddWithValue("@UserName", US);
                        _SQLCommand.Parameters.AddWithValue("@Password", PWD);
                        _SQLCommand.Parameters.AddWithValue("@Browser", pelayar);
                        _SQLCommand.Parameters.AddWithValue("@OS", sistemope);
                        _SQLCommand.Parameters.AddWithValue("@IP", ipAdd);
                        //  _SQLCommand.Parameters.AddWithValue("@count", count);
                        _DBConnection.Open();
                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();
                        GPSuserModel  _result;
                        while (_SQLDataReader.Read())
                        {
                            _result                = new GPSuserModel();
                            _result.ID             = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.UserName       = _SQLDataReader["UserName"].ToString();
                            _result.Password       = _SQLDataReader["Password"].ToString();
                            _result.Version        = _SQLDataReader["Version"].ToString();
                            _result.Status         = _SQLDataReader["Status"].ToString();
                            _result.AccountNo      = _SQLDataReader["AccountNo"].ToString();
                            _result.RegisterBy     = _SQLDataReader["RegisterBy"].ToString();
                            _result.UpdateBy       = _SQLDataReader["UpdateBy"].ToString();
                            _result.CreatedDate    = _SQLDataReader["CreatedDate"].ToString();
                            _result.ModifiedDate   = _SQLDataReader["ModifiedDate"].ToString();
                            _result.ExpiredDate    = _SQLDataReader["ExpiredDate"].ToString();
                            _result.LoginIP        = _SQLDataReader["LoginIP"].ToString();
                            _result.LoginType      = _SQLDataReader["LoginType"].ToString();
                            _result.LastLoginDate  = _SQLDataReader["LastLoginDate"].ToString();
                            _result.LoginCount     = _SQLDataReader["LoginCount"].ToString();
                            _result.LastLogOutDate = _SQLDataReader["LastLogOutDate"].ToString();
                            _result.Browser        = _SQLDataReader["Browser"].ToString();
                            _result.OS             = _SQLDataReader["OS"].ToString();
                            _result.EmailReg       = _SQLDataReader["EmailReg"].ToString();
                            ((RegisteredAccountModel)_result).AccID              = Convert.ToInt32(_SQLDataReader["AccID"].ToString());
                            ((RegisteredAccountModel)_result).AccountName        = _SQLDataReader["AccountName"].ToString();
                            ((RegisteredAccountModel)_result).AAddress           = _SQLDataReader["AAddress"].ToString();
                            ((RegisteredAccountModel)_result).AMobilePhone       = _SQLDataReader["AMobilePhone"].ToString();
                            ((RegisteredAccountModel)_result).AHousePhone        = _SQLDataReader["AHousePhone"].ToString();
                            ((RegisteredAccountModel)_result).AOfficePhone       = _SQLDataReader["AOfficePhone"].ToString();
                            ((RegisteredAccountModel)_result).AAlertPhone        = _SQLDataReader["AAlertPhone"].ToString();
                            ((RegisteredAccountModel)_result).AEmail             = _SQLDataReader["AEmail"].ToString();
                            ((RegisteredAccountModel)_result).AAlertEmail        = _SQLDataReader["AAlertEmail"].ToString();
                            ((RegisteredAccountModel)_result).AVersion           = _SQLDataReader["AVersion"].ToString();
                            ((RegisteredAccountModel)_result).ARegisteredDate    = _SQLDataReader["ARegisteredDate"].ToString();
                            ((RegisteredAccountModel)_result).AExpiredDate       = _SQLDataReader["AExpiredDate"].ToString();
                            ((RegisteredAccountModel)_result).ACreatedDate       = _SQLDataReader["ACreatedDate"].ToString();
                            ((RegisteredAccountModel)_result).AModifiedDate      = _SQLDataReader["AModifiedDate"].ToString();
                            ((RegisteredAccountModel)_result).ACreatedBy         = _SQLDataReader["ACreatedBy"].ToString();
                            ((RegisteredAccountModel)_result).AModifiedBy        = _SQLDataReader["AModifiedBy"].ToString();
                            ((RegisteredAccountModel)_result).AStatus            = _SQLDataReader["AStatus"].ToString();
                            ((RegisteredAccountModel)_result).AItemRegisterCount = _SQLDataReader["AItemRegisterCount"].ToString();
                            ((RegisteredAccountModel)_result).SMSAlertMsg        = _SQLDataReader["SMSAlertMsg"].ToString();
                            //SMSAlertMsg


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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }
            return(_Value);
        }
        public static List <GeoFenceModel> Geofence_Active(string AccountNo)
        {
            List <GeoFenceModel> _Value = new List <GeoFenceModel>();

            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 = "Geofence_Active";

                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);


                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        GeoFenceModel _result;

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

                            _result.TrackID           = _SQLDataReader["TrackID"].ToString();
                            _result.TrackItem         = _SQLDataReader["TrackItem"].ToString();
                            _result.IsOutOfFence      = _SQLDataReader["IsOutOfFence"].ToString();
                            _result.OutOfFenceRespond = _SQLDataReader["OutOfFenceRespond"].ToString();
                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
        public static List <RegisteredAccountModel> Get_Account(string AccountNo)
        {
            List <RegisteredAccountModel> _Value = new List <RegisteredAccountModel>();
            //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_Account";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);
                        //  _SQLCommand.Parameters.AddWithValue("@count", count);
                        _DBConnection.Open();
                        SqlDataReader          _SQLDataReader = _SQLCommand.ExecuteReader();
                        RegisteredAccountModel _result;
                        while (_SQLDataReader.Read())
                        {
                            _result                    = new RegisteredAccountModel();
                            _result.AccID              = Convert.ToInt32(_SQLDataReader["AccID"].ToString());
                            _result.AccountNo          = _SQLDataReader["AccountNo"].ToString();
                            _result.AccountName        = _SQLDataReader["AccountName"].ToString();
                            _result.AAddress           = _SQLDataReader["AAddress"].ToString();
                            _result.AMobilePhone       = _SQLDataReader["AMobilePhone"].ToString();
                            _result.AHousePhone        = _SQLDataReader["AHousePhone"].ToString();
                            _result.AOfficePhone       = _SQLDataReader["AOfficePhone"].ToString();
                            _result.AAlertPhone        = _SQLDataReader["AAlertPhone"].ToString();
                            _result.AEmail             = _SQLDataReader["AEmail"].ToString();
                            _result.AAlertEmail        = _SQLDataReader["AAlertEmail"].ToString();
                            _result.AVersion           = _SQLDataReader["AVersion"].ToString();
                            _result.ARegisteredDate    = _SQLDataReader["ARegisteredDate"].ToString();
                            _result.AExpiredDate       = _SQLDataReader["AExpiredDate"].ToString();
                            _result.ACreatedDate       = _SQLDataReader["ACreatedDate"].ToString();
                            _result.AModifiedDate      = _SQLDataReader["AModifiedDate"].ToString();
                            _result.ACreatedBy         = _SQLDataReader["ACreatedBy"].ToString();
                            _result.AModifiedBy        = _SQLDataReader["AModifiedBy"].ToString();
                            _result.AStatus            = _SQLDataReader["AStatus"].ToString();
                            _result.Alastlogin         = _SQLDataReader["Alastlogin"].ToString();
                            _result.AItemRegisterCount = _SQLDataReader["AItemRegisterCount"].ToString();
                            _result.SMSAlertMsg        = _SQLDataReader["SMSAlertMsg"].ToString();

                            _Value.Add(_result);
                        }
                    }

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

                    finally
                    {
                        _DBConnection.Close();
                    }
                }
            }



            return(_Value);
        }
예제 #30
0
        public static List <TrackingItemModel> Get_TrackingItem(string AccountNo)
        {
            List <TrackingItemModel> _Value = new List <TrackingItemModel>();

            //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_TrackingItem";
                        _SQLCommand.Parameters.AddWithValue("@AccountNo", AccountNo);

                        _DBConnection.Open();


                        SqlDataReader _SQLDataReader = _SQLCommand.ExecuteReader();

                        TrackingItemModel _result;

                        while (_SQLDataReader.Read())
                        {
                            _result               = new TrackingItemModel();
                            _result.ID            = Convert.ToInt32(_SQLDataReader["ID"].ToString());
                            _result.AccountNo     = _SQLDataReader["AccountNo"].ToString();
                            _result.GPSSimNumber  = _SQLDataReader["GPSSimNumber"].ToString();
                            _result.TrackID       = _SQLDataReader["TrackID"].ToString();
                            _result.DeviceID      = _SQLDataReader["DeviceID"].ToString();
                            _result.TrackItemType = _SQLDataReader["TrackItemType"].ToString();
                            _result.TrackItem     = _SQLDataReader["TrackItem"].ToString();
                            _result.GPSModel      = _SQLDataReader["GPSModel"].ToString();
                            _result.Interval      = _SQLDataReader["Interval"].ToString();
                            _result.CreatedDate   = _SQLDataReader["CreatedDate"].ToString();
                            _result.CreatedBy     = _SQLDataReader["CreatedBy"].ToString();
                            _result.ModifiedDate  = _SQLDataReader["ModifiedDate"].ToString();
                            _result.ModifiedBy    = _SQLDataReader["ModifiedBy"].ToString();
                            _result.TrackingMode  = _SQLDataReader["TrackingMode"].ToString();
                            _result.Status        = _SQLDataReader["Status"].ToString();
                            _result.ExpiredDate   = _SQLDataReader["ExpiredDate"].ToString();
                            _result.Term          = _SQLDataReader["Term"].ToString();
                            _result.Sex           = _SQLDataReader["Sex"].ToString();
                            _result.Risk          = _SQLDataReader["Risk"].ToString();
                            _result.Age           = _SQLDataReader["Age"].ToString();
                            ////_result.Picture = _SQLDataReader["Picture"].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);
        }