Thursday, June 4, 2020

covid


news


How to consume api in html or cshtml

when json data is this type 

[{"sno":1,"name":"ritesh","ftnsme":"pandey"},{"sno":2,"name":"rohit","ftnsme":"satya"},{"sno":1002,"name":"babu","ftnsme":"ravi"},{"sno":1003,"name":"rauio","ftnsme":"hugff"},{"sno":2002,"name":"ritesh","ftnsme":"ravi"},{"sno":3002,"name":"mkjuii","ftnsme":"nhuytm"},{"sno":3003,"name":"bhutt","ftnsme":"lpoiu"},{"sno":3004,"name":"bhuttkijj","ftnsme":"lpoiubhutt"},{"sno":3005,"name":"pouytf","ftnsme":"njuug"},{"sno":3006,"name":"babukijj","ftnsme":"njutred"},{"sno":4002,"name":"bhyur","ftnsme":"bhjs"},{"sno":5002,"name":"fatuio","ftnsme":"huopi"},{"sno":6002,"name":"sach","ftnsme":"bach"},{"sno":6003,"name":"gytr","ftnsme":"lopu"},{"sno":6004,"name":"ramesh","ftnsme":"sandeep"},{"sno":6005,"name":"kamesh","ftnsme":"sandeep"},{"sno":6006,"name":"kamesh","ftnsme":"rahul"}]




how to consume api in html or cshtml 





<h2>myjavaapiview</h2>
<div id="listofdata"></div>

<table>
    <tr>
        <td id="list1" width="150"></td>
        <td id="list2" width="150"></td>
        <td id="list3" width="150"></td>
    </tr>
    <br />
</table>
  


<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script>
    var html="";

    $.ajax({
        url: 'http://localhost:2034/api/values',
        type: 'GET',
        dataType: 'json',
        //data: person,
        success: function (data, textStatus, xhr) {
            console.log(data);


            $.each(data, function (key, item ) {

         
                $('#list1').append("<div>" +   item.sno   + "</div>");
                $('#list2').append("<div>" +   item.name  + "</div>");
                $('#list3').append("<div>" +   item.ftnsme   + "</div>");
           
            });

        },

        error: function (xhr, textStatus, errorThrown) {
            console.log('Error in Operation');
        }
    }).done(function ()
    {

    }
    );
</script>




Wednesday, June 3, 2020

api code for xml list view

 public  ActionResult myview()
        {
            IEnumerable<MyempModel> empobj = null;
            HttpClient hc = new HttpClient();
            hc.BaseAddress = new Uri("http://localhost:2034/api/");

            var apicontroller = hc.GetAsync("values");
            apicontroller.Wait();
            var resultdisp = apicontroller.Result;
            if (resultdisp.IsSuccessStatusCode)
            {
                var reademptable = resultdisp.Content.ReadAsAsync<List<MyempModel>>();
                reademptable.Wait();
                empobj = reademptable.Result;
            }
              
            return View(empobj);
        }



MyempModel should same as  entity data model  field ............


 public class MyempModel
    {
        public int sno { get; set; }
        public string name { get; set; }
        public string ftnsme { get; set; }
    }




if your controller return data in xml format .........then use two line code in app start folder in  WebApiConfig  file 

 // Web API configuration and services

            config.Formatters.Clear();
            config.Formatters.Add(new JsonMediaTypeFormatter());

Friday, May 22, 2020

History of Pushyamitra Shunga and Shunga Dynasty

Pushyamitra Sunga was the founder and first king of the Sunga Empire of North India. Prior to this, he was the general in the Maurya Empire. In 185 BC, he killed the last Mauryan emperor (Brihadratha) during a military review and proclaimed himself king. He then performed Ashwamedha Yagna and took most of North India under his jurisdiction. Inscriptions of the Sunga State An inscription of Pushyamitra has been found in Jalandhar, Punjab, and according to Divyavadaan, the kingdom was extended to Sangla (present-day Sialkot).

pusyamitra sangu era , sangu dynestry
pusyamitra era architecture

Pushyamitra Sunga was the commander-in-chief of the last Mauryan ruler Vruddrath. After killing the Magadha emperor Vrahadratha Maurya, Pushyamitra became the emperor of Magadha and established the Sunga dynasty. The founder of the Sunga dynasty was born into a Brahmin, teacher family. There is a slight difference with respect to their gotra, according to Patanjali, according to Bharadwaja gotra and Kalidasa, "Malavikagnimitram" is called Kashyapa gotra. By the way, I would like to clarify one thing here that the Emperor Pushyamitra born in the Brahmin clan was a Kshatriya Brahmin by the act of Sunga, which proves that he was an invincible Brahmin. P. N. Bali, author of the book "History of the Daring Mohyals", has shown Pushyamitra Sunga as Bhumihar in his purported book. Read in detail on the establishment of the Sunga dynasty -
sikka sangu , pusyamitra coin
sikka sangu 

The credit of the rise of the Nanda dynasty with the Nanda dynasty emperor Dhanananda of the Magadha empire and the rise of the Mauryan empire with the Magadha emperor Chandragupta Maurya goes to the Brahmin "Chanakya". Acharya Chanakya kept the Magadha soil from the influence of Buddhism till he lived, playing the Vedic system of the oldest Hindu religion in the world. But Ashoka, grandson of Emperor Chandragupta Maurya, adopted Buddhism after Kalinga war and ruled Magadha as a Buddhist emperor for about 20 years. Ashoka put his entire system of governance into the propagation and propagation of Buddhism, its influence continued till the ninth and last Magadha emperor of the Maurya dynasty, Vrhadrath.

Establishment of the Sunga dynasty:

battle sangu , sangu dynestry
battle sangu

The last king of the Maurya dynasty was Brihadratha, whose commander was Pushyamitra Sunga. One day he gathered all his army and arranged for his demonstration. Emperor Brihadratha was also invited on the occasion of this performance. The army was attached to Pushyamitra. Brihadratha was killed by Pushyamitra in front of the army, and he became the ruler of the vast Magadha Empire. Thus Pushyamitra Sung laid the foundation of the 'Shung dynasty'. In Harshacharitha, Brihadratha has been called 'Pratyagadurbal'. This means that, according to the ancient Aryan tradition at the time of the coronation, Brihadratha was weak in his obedience to the king. The army was not attached to him. That is why the plot of fighter Pushyamitra became successful.

Pusyamitra's becoming king by killing Brihadratha is exactly the same type of event as that of Raja Bhattiya by killing the king's child and killing the king Ripunjaya to become the king of Amatya foster. Mahapadma Nand also became the lord of the throne of Magadha in this manner. The power of the Magadha Empire depended on its well-organized army. Anyone who had an army there could control the throne in his own right. The conspiracy or revolution by which the Maurya dynasty came to an end was 185 BC. Took place in


The great Emperor Pushyamitra Sunga, the protector of Sanatan Dharma:

rock sangu , puayamitra
rock of sangu

The great Ashoka , The grandson of the great Emperor Chandragupta of the Morya dynasty, adopted Buddhism after the Kalinga war. Ashoka would have been truly great if he had left the royalty and became a Buddhist monk and preached. But Ashoka ruled for 20 years as a Buddhist emperor. Taking the path of non-violence, he put the entire system of governance in the propagation and propagation of Buddhism. The heroic land of India had become a stronghold of Buddhist monks and Buddhist monasteries due to the spread of excessive non-violence.

Even further, when the ninth of the Morya dynasty sat on the throne of the last emperor Vrahadratha Magadha, by that time Afghanistan, Punjab and almost the whole of northern India had become Buddhist. When the heroes of India like Alexander and Sailukas had mourned their valor, after about 90 years, when the heroic attitude of Buddhism from India was almost depleted, the Greeks crossed the Indus river. He showed courage.

During the reign of Emperor Vrahdratha, the Greek ruler Mininder, who has been called Milind in Buddhist literature, planned an invasion of India. Mininder first approached the religious gurus of Buddhism, and told them that if you join me in the victory of India, I will accept Buddhism after the victory of India. Buddhist gurus attacked the nation and supported a foreign ruler to attack India.

Pushyamitra's governance arrangement:

The capital of the empire was Pataliputra. Pushyamitra succeeded in securing the intermediate part of the ancient Mauryan Empire. Pushyamitra's empire spread from the Himalayas in the north to Berar in the south and from Punjab in the west to Magadha in the east. According to Divyavadan and Taranath, Jalandhar and Syalkot also had their rights. In various parts of the empire, the practice of appointing the prince or Rajkula's people as the governor continued.

Pushyamitra appointed his sons as co-rulers in different regions of the empire. And his son Agnimitra was the son of Vidisha. Dhanadev was the governor of Kaushal. Rajkumar ji was also the director of the army. Even at this time village was the smallest unit of governance. By this time, by the time Mauryan central control was relaxed and the trend of feudalization started becoming active.