Esempio n. 1
0
        /// <summary>
        /// Get ListPolygonDetail For LatLng
        /// </summary>
        /// <param name="Lat">Latitude</param>
        /// <param name="Lng">Longitude</param>
        /// <returns>List<PolygonDetailViewModel> : Id,ObjectData,Value</returns>
        private List <PolygonDetailViewModel> GetDetailByLatLngUnOptimize(string Lat, string Lng, out long timeQueryMessage)
        {
            List <PolygonDetailViewModel> listPolygonDetails = new List <PolygonDetailViewModel>();
            var    watch    = Stopwatch.StartNew();
            string sqlQuery = "EXEC XacDinhToaDo @lat = @_Lat ,@lng = @_Lng";

            object[] _params = new object[] { new SqlParameter("_Lat", Lat), new SqlParameter("_Lng", Lng) };

            SqlDataReader reader = helper.ExecDataReader(sqlQuery, _params);

            while (reader.Read())
            {
                PolygonDetailViewModel Ward = new PolygonDetailViewModel
                {
                    Id         = reader["Id"].ToString(),
                    ObjectData = reader["DuLieuDoiTuong"].ToString(),
                    Value      = reader["Value"].ToString()
                };
                listPolygonDetails.Add(Ward);
            }
            timeQueryMessage = watch.ElapsedMilliseconds;
            reader.Close();
            _conn.Close();
            return(listPolygonDetails);
        }
Esempio n. 2
0
        /// <summary>
        /// Get allData in VietNam
        /// </summary>
        /// <returns>List<CountriesViewModel> : All Data in VietNam</returns>
        public List <CountriesViewModel> GetAllData()
        {
            List <CountriesViewModel> allData = new List <CountriesViewModel>();
            string sqlQuery = "SELECT * FROM Countries ORDER BY Level";

            SqlDataReader reader = helper.ExecDataReader(sqlQuery);

            while (reader.Read())
            {
                CountriesViewModel Data = new CountriesViewModel
                {
                    Id           = int.Parse(reader["Id"].ToString()),
                    Name         = reader["Name"].ToString(),
                    Code         = reader["Code"].ToString(),
                    Description  = reader["Description"].ToString(),
                    Level        = int.Parse(reader["Level"].ToString()),
                    Type         = reader["Type"].ToString(),
                    ParentId     = int.Parse(reader["ParentId"].ToString()),
                    IsVisible    = int.Parse(reader["IsVisible"].ToString()),
                    IsState      = bool.Parse(reader["IsState"].ToString()),
                    NameKhongDau = reader["NameKhongDau"].ToString()
                };
                allData.Add(Data);
            }
            reader.Close();
            _conn.Close();

            return(allData);
        }
Esempio n. 3
0
        public List <int> GetOrganizationBanks()
        {
            List <int> ahids = new List <int>();
            AdoHelper  obj   = new AdoHelper();

            SqlDataReader Dr = obj.ExecDataReader("uspGetOrganizationBanks");

            while (Dr.Read())
            {
                ahids.Add(Convert.ToInt32(Dr["ahid"].ToString()));
            }
            return(ahids);
        }
Esempio n. 4
0
        public List <Object> GetListContact()
        {
            List <Object> list = new List <Object>();
            string        qry  = "select * from contact where " +
                                 "contact.customertypecode = @CustomerTypeCode " +
                                 "and not contact.nickname like '%PAGADORIA%' " +
                                 "and contact.pjo_datadeinicio >=  @Data";

            AdoHelper     db     = new AdoHelper(ConfigurationManager.ConnectionStrings["WebPortal"].ConnectionString);
            SqlDataReader reader = db.ExecDataReader(qry,
                                                     "@CustomerTypeCode", 200001,
                                                     "@Data", new DateTime(2018, 10, 31));

            while (reader.Read())
            {
                list.Add(reader.GetValue(reader.GetOrdinal("emailaddress1")));
                // Get row of data from rdr
            }
            return(list);
        }