コード例 #1
0
        private void radAutoCompleteBox_Leave(object sender, EventArgs e)
        {
            if (autoList.Count > 0)
            {
                //var t = radAutoCompleteBox.Text.ToString();
                var item = autoList.FirstOrDefault();
                if (item != null)
                {
                    var placeid = item.placeid;
                    if (!string.IsNullOrEmpty(placeid))
                    {
                        var details = GoogleApi.get_place_details(placeid);

                        if (details != null)
                        {
                            StrNum.ResetText();
                            StrAddress.ResetText();
                            City.ResetText();
                            State.ResetText();
                            ZipCode.ResetText();
                            Country.ResetText();

                            StrNum.Text     = details.StreetNumber;
                            StrAddress.Text = details.Route;
                            City.Text       = details.City;
                            State.Text      = details.State;
                            ZipCode.Text    = details.Zipcode;
                            Country.Text    = details.Country;
                        }
                    }
                }
            }
        }
コード例 #2
0
        /// <BlockProcessing>
        /// Cắt dãy số 1 đến 15 chữ số thành các khối tương ứng. Mỗi 3 số thành một khối . . .(Block)
        /// </BlockProcessing>
        public void BlockProcessing()
        {
            if (Lengths > 15)
            {
                return;               //Điều kiện tiên quyết
            }
            #region Block 1000 Billion
            if (Value <= G & Value >= F)
            {
                //999.111.111.111.111
                BlockNum[0] = Convert.ToInt32(StrNum.Substring(0, Lengths - 12));
            }//Done
            #endregion
            #region Block Bilion
            if (Value >= E)
            {
                /*111.999.111.111.111*/
                var temp = BlockNum[0] > 0
                    ? Convert.ToString(BlockNum[0]).Length
                    : 0;
                BlockNum[1] = Convert.ToInt32(StrNum.Substring(temp, Lengths - 9 - temp));
            }//Done
            #endregion
            #region Block Million
            if (Value >= D)
            {
                /*111.111.999.111.111*/
                var temp = BlockNum[0] + BlockNum[1] > 0
                    ? Convert.ToString(StrNum.Substring(0, Lengths - 9)).Length
                    : 0;
                BlockNum[2] = Convert.ToInt32(StrNum.Substring(temp, Lengths - 6 - temp));
            }
            #endregion
            #region Block Thousand
            if (Value >= C)
            {
                /*111.111.111.999.111*/
                var temp = BlockNum[0] + BlockNum[1] + BlockNum[2] > 0
                    ? Convert.ToString(StrNum.Substring(0, Lengths - 6)).Length
                    : 0;
                BlockNum[3] = Convert.ToInt32(StrNum.Substring(temp, Lengths - 3 - temp));
            }
            #endregion
            #region Block Hundred

            if (!(Value > 0))
            {
                return;
            }
            var temporary = BlockNum[0] + BlockNum[1] + BlockNum[2] + BlockNum[3] > 0
                ? Convert.ToString(StrNum.Substring(0, Lengths - 3)).Length
                : 0;
            BlockNum[4] = Convert.ToInt32(StrNum.Substring(temporary, Lengths - temporary));
            /*111.111.111.111.999*/
            #endregion
        }   //End BlockProcessing - Done