Mitko_jos

count_number_dot_net

Jul 21st, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. function Count_number() {
  2. console.log('aa');
  3. $.ajax({
  4. type: "GET",
  5. url: "/Dogovor/Count_number",
  6. datatype: "Json",
  7. data: { },
  8. success: function (response) {
  9.  
  10. $("#modAddBrDogovor").val(response);
  11.  
  12. }
  13. });
  14.  
  15. };
  16.  
  17.  
  18. public ActionResult Count_number()
  19. {
  20. db.Configuration.ProxyCreationEnabled = false;
  21.  
  22. int? result1 = db.Dogovori.Count();
  23.  
  24. if (result1 == 0)
  25. {
  26. result1 = 1;
  27. }
  28.  
  29. result1 = result1 + 1;
  30.  
  31.  
  32. return Json(result1, JsonRequestBehavior.AllowGet);
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment