How to Add, Update and Delete JSON File

Angularjs File
  1. <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">  
  2.     <div ng-controller="userController" ng-app="myApp">  
  3.         <div class="container">  
  4.             <div class="hideeee" name="myhide" ng-show="edit3" ng-hide="false">  
  5.                 <button type="button" class="btn btn-success" ng-click="editUser()" style="margin-left: 980px;  
  6. margin-top: 7px">  
  7.                     <span class="glyphicon glyphicon-user"></span>Create New User  
  8.   
  9.                 </button>  
  10.                 <label id="msgLab" style="color: #008080; font-size: large"></label>  
  11.                 <br />  
  12.                 <hr />  
  13.                 <div class="manish">  
  14.                     <h3>  
  15. Users</h3>  
  16.                     <div class="navbar-form" role="search">  
  17.                         <div class="input-group add-on">  
  18.                             <input ng-model="search" ng-keydown="clear()" placeholder="Search" name="srch-term"  
  19. id="search" class="form-control" type="text">  
  20.                                 <div class="input-group-btn">  
  21.                                     <button class="btn btn-default" type="submit" ng-click="sear()">  
  22.                                         <i class="glyphicon glyphicon-search"></i>Search  
  23.                                     </button>  
  24.                                 </div>  
  25.                             </div>  
  26.                         </div>  
  27.                     </div>  
  28.                     <pagination style="margin-left: 850px;" total-items="totalItems" items-per-page="itemsPerPage"  
  29. ng-model="currentPage" ng-change="pageChanged()" class="pagination-sm" boundary-links="true"  
  30. previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination>  
  31.                     <br />  
  32. [   
  33.                     <a href="" ng-click="Btn=''">Reset</a> ]  
  34.   
  35.                     <table class="table table-striped table-bordered table-condensed table-striped table-hover ">  
  36.                         <thead>  
  37.                             <th>Id</th>  
  38.                             <th>  
  39.                                 <a href="" ng-click="Btn = 'firstName'; reverse=true"></a>  
  40.                                 <a href="" ng-click="Btn = '-firstName'; reverse=true">  
  41. First Name</a>  
  42.                             </th>  
  43.                             <th class="text-center">  
  44.                                 <a href="" ng-click="Btn = 'lastName'; reverse=true"></a>  
  45.                                 <a href="" ng-click="Btn = '-lastName'; reverse=true">  
  46. Last Name</a>  
  47.                             </th>  
  48.                             <th class="text-center">  
  49.                                 <a href="" ng-click="Btn = 'phone'; reverse=true"></a>  
  50.                                 <a href="" ng-click="Btn = '-phone'; reverse=true">  
  51. Phone</a>  
  52.                             </th>  
  53.                             <th class="text-center">  
  54. Image  
  55. </th>  
  56.                             <th class="text-center">  
  57. Action  
  58. </th>  
  59.                         </thead>  
  60.                         <tbody>  
  61.                             <tr style="color: #7A2900" data-ng-repeat="user in users | filter:search | orderBy:Btn:reverse">  
  62.                                 <td>  
  63. {{user.id }}  
  64. </td>  
  65.                                 <td>  
  66. {{user.firstName }}  
  67. </td>  
  68.                                 <td>   
  69. {{user.lastName }}  
  70. </td>  
  71.                                 <td>   
  72. {{user.phone }}  
  73. </td>  
  74.                                 <td class="text-center">  
  75.                                     <img alt="Responsive image" class="img-circle col-xs-10 col-md-10" ng-src="upload/{{user.photo}}"  
  76. height="100px" width="100px" />  
  77.                                 </td>  
  78.                                 <td class="text-center">  
  79.                                     <a href="#" class="btn btn-primary" ng-click="edit(user.id)">  
  80.                                         <span class="glyphicon glyphicon-pencil"></span>Edit  
  81.                                     </a> |   
  82.                                     <a href="#" class="btn btn-danger" ng-click="del(user.id)">  
  83.                                         <span  
  84. class="glyphicon glyphicon-remove"></span>Delete  
  85.                                     </a>  
  86.                                 </td>  
  87.                             </tr>  
  88.                         </tbody>  
  89.                     </table>  
  90.                     <p id="hide" style="font-size:x-large; color:Red;"></p>  
  91.                     <p ng-hide="true">  
  92. total Items: {{totalItems}}  
  93.                         <br />  
  94. Items per page: {{itemsPerPage}}  
  95.                         <br />  
  96. Current Page: {{currentPage}}  
  97.   
  98.                     </p>  
  99.                 </div>  
  100.             </div>  
  101.             <div class="form-horizontal" id="myForm" name="myForm" ng-show="edit2" ng-hide="true">  
  102.                 <h3 ng-show="edit1" ng-hide="false">  
  103. Create New User:</h3>  
  104.                 <h3 ng-show="edit11" ng-hide="true"">  
  105. Edit User:</h3>  
  106.                 <div class="form-group" ng-show="edit5" ng-hide="true">  
  107.                     <label class="col-sm-2 control-label">ID:</label>  
  108.                     <div class="col-sm-10" ng-hide="true">  
  109.                         <input type="text" id="id" name="id" ng-model="id"/>  
  110.                     </div>  
  111.                 </div>  
  112.                 <div class="form-group" ng-show="edit5" ng-hide="false">  
  113.                     <label class="col-sm-3 control-label">  
  114. First Name:</label>  
  115.                     <div class="col-sm-5">  
  116.                         <input type="text" id="fname" name="fName" ng-model="fName" placeholder="First Name" class="form-control" />  
  117.                     </div>  
  118.                 </div>  
  119.                 <div class="form-group" ng-show="edit5" ng-hide="false">  
  120.                     <label class="col-sm-3 control-label">  
  121. Last Name:</label>  
  122.                     <div class="col-sm-5">  
  123.                         <input type="text" id="lname" name="lname" ng-model="lName" placeholder="Last Name" class="form-control" />  
  124.                     </div>  
  125.                 </div>  
  126.                 <div class="form-group" ng-show="edit5" ng-hide="false">  
  127.                     <label class="col-sm-3 control-label">  
  128. Phone Number:</label>  
  129.                     <div class="col-sm-5">  
  130.                         <input type="text" id="phone" name="phone" ng-model="phone" placeholder="Phone Number" class="form-control" />  
  131.                     </div>  
  132.                 </div>  
  133.                 <div class="form-group" ng-show="edit7" ng-hide="false">  
  134.                     <label class="col-sm-3 control-label" >  
  135. Image:</label>  
  136.                     <div class="col-sm-5">  
  137.                         <input class="file" type="file" file-model="myFile" id="myFile"/>  
  138.                         <button type="button" ng-click="uploadFile()" class="btn btn-primary">  
  139.                             <span class="glyphicon glyphicon-upload"> Upload File</span>  
  140.                         </button>  
  141.                         <br />  
  142.                     </div>  
  143.                 </div>  
  144.                 <div class="col-sm-20" ng-show="remove" ng-hide="true" style="margin-left:150px">  
  145.                     <img id="getimg" height="200px" width="200px" class="img-thumbnail col-xs-10 col-md-5" alt="Responsive image"/>  
  146.                     <button type="button" class="btn btn-info" id="Remov" ng-click="removefile()" ng-show="remove1" ng-hide="false">  
  147.                         <span  
  148. class="glyphicon glyphicon-remove"></span>Remove  
  149.                     </button>  
  150.                 </div>  
  151.                 <div class="form-group" style="margin-left:300px">  
  152.                     <input type="text" id="hid" name="hid" ng-model="hid" ng-hide="true" />  
  153.                 </div>  
  154.                 <button type="button" class="btn btn-primary" ng-click="SaveData()" style="margin-left:200px">  
  155.                     <span class="glyphicon glyphicon-save"></span>Save Data  
  156.   
  157.                 </button>  
  158.                 <button type="button" id="cbtn" class="btn btn-danger" ng-click="cancel()">  
  159.                     <span class="glyphicon glyphicon-cancel"></span>Cancel  
  160.   
  161.                 </button>  
  162.                 <br />  
  163.                 <br />  
  164.             </div>  
  165.             <div id="advertisement" ng-show="adv" ng-hide="true">  
  166.                 <center>Advertisement</center>  
  167.                 <img att="grfg" src="Images/adv/add.png" height="400" width="350" style="margin-left:120px; margin-top:20px;" />  
  168.             </div>  
  169.             <div id="advertisement1" ng-show="adv1" ng-hide="true">  
  170.                 <center>Advertisement_1</center>  
  171.                 <img att="grfg" src="Images/adv/edit.png" height="400" width="350" style="margin-left:120px; margin-top:20px;" />  
  172.             </div>  
  173.         </div>  
  174. </asp:Content>   
Asp.net File
  1. Public Class Class1  
  2. Public Property User As Object  
  3. End Class  
  4. Public Class Class2  
  5. Public Property id As String  
  6. Public Property firstName As String  
  7. Public Property lastName As String  
  8. Public Property phone As String  
  9. Public Property photo As String  
  10. End Class  
  11. <Services.WebMethod()>  
  12. Public Shared Function Data_Save(ByVal id As StringByVal firstName As StringByVal lastName As StringByVal phone As StringByVal photo As StringAs String  
  13. Try  
  14. Dim str As String = ""  
  15. Dim sr As StreamReader = New StreamReader("D:\manish\Project\Project\JsonData.txt")  
  16. str = sr.ReadToEnd()  
  17. Dim cont As New List(Of Class2)  
  18. cont = JsonConvert.DeserializeObject(Of List(Of Class2))(str)  
  19. Dim Person As New Class2  
  20. 'Person.id = id  
  21. Person.firstName = firstName  
  22. Person.lastName = lastName  
  23. Person.phone = phone  
  24. Person.photo = photo  
  25. Dim randomNumber As Integer  
  26. Randomize()  
  27. randomNumber = Int((100000 * Rnd()) + 1)  
  28. If str.Length <= 0 Then  
  29. Person.id = randomNumber  
  30. Dim f As String  
  31. f = JsonConvert.SerializeObject(Person, Formatting.Indented)  
  32. sr.Dispose()  
  33. Dim sw1 As StreamWriter = New StreamWriter("D:\manish\Project\Project\JsonData.txt")  
  34. sw1.Write("[" + f + "]")  
  35. sw1.Dispose()  
  36. Else  
  37. If id = 0 Then  
  38. Person.id = randomNumber  
  39. cont.Add(Person)  
  40. Else  
  41. For Each dta In cont  
  42.     If dta.id = id Then  
  43.         dta.firstName = firstName  
  44.         dta.lastName = lastName  
  45.         dta.phone = phone  
  46.         dta.photo = photo  
  47.     End If  
  48. Next  
  49. End If  
  50. 'For Each dt In cont  
  51. 'Next  
  52. Dim a As String  
  53. a = JsonConvert.SerializeObject(cont, Formatting.Indented)  
  54. sr.Dispose()  
  55. Dim sw As StreamWriter = New StreamWriter("D:\manish\Project\Project\JsonData.txt")  
  56. sw.Write(a)  
  57. sw.Dispose()  
  58. End If  
  59. Catch ex As JsonSerializationException  
  60. MsgBox(ex.Message)  
  61. End Try  
  62. End Function  
  63. <Services.WebMethod()>  
  64. Public Shared Function Data_Delete(ByVal id As StringAs String  
  65. Try  
  66. Dim str As String = ""  
  67. Dim sr As StreamReader = New StreamReader("D:\manish\Project\Project\JsonData.txt")  
  68. str = sr.ReadToEnd()  
  69. Dim cont As New List(Of Class2)  
  70. Dim Class2DT As New Class2  
  71. cont = JsonConvert.DeserializeObject(Of List(Of Class2))(str)  
  72. For Each dt In cont  
  73. If dt.id = id Then  
  74. Class2DT = dt  
  75. End If  
  76. Next  
  77. cont.Remove(Class2DT)  
  78. Dim a As String  
  79. a = JsonConvert.SerializeObject(cont, Formatting.Indented)  
  80. sr.Dispose()  
  81. Dim sw As StreamWriter = New StreamWriter("D:\manish\Project\Project\JsonData.txt")  
  82. sw.Write(a)  
  83. sw.Dispose()  
  84. Catch ex As JsonSerializationException  
  85. MsgBox(ex.Message)  
  86. End Try  
  87. End Function  
  88. <Services.WebMethod()>  
  89. Public Shared Function DeleteImage(ByVal hid As StringAs String  
  90. If System.IO.File.Exists("D:\manish\Project\Project\upload\" & hid) Then  
  91. System.IO.File.Delete("D:\manish\Project\Project\upload\" & hid)  
  92. Else  
  93. Return False  
  94. End If  
  95. End Function  
JS File
  1. var myApp = angular.module('myApp', ['ui.bootstrap']);  
  2. var myApp = angular.module('myApp', ['ui.bootstrap']);  
  3. //upload a file code  
  4. myApp.directive('fileModel', ['$parse'function($parse) {  
  5.     return {  
  6.         restrict: 'A',  
  7.         link: function(scope, element, attrs) {  
  8.             var model = $parse(attrs.fileModel);  
  9.             var modelSetter = model.assign;  
  10.             element.bind('change'function() {  
  11.                 scope.$apply(function() {  
  12.                     modelSetter(scope, element[0].files[0]);  
  13.                 });  
  14.             });  
  15.         }  
  16.     };  
  17. }]);  
  18. myApp.service('fileUpload', ['$http'function($http) {  
  19.     this.uploadFileToUrl = function(file, uploadUrl) {  
  20.         var fd = new FormData();  
  21.         fd.append('file', file);  
  22.         $http.post(uploadUrl, fd, {  
  23.             transformRequest: angular.identity,  
  24.             headers: {  
  25.                 'Content-Type': undefined  
  26.             }  
  27.   
  28.         })  
  29.   
  30.             .success(function(data) {  
  31.             if (data.split("|")[0] == "True") {  
  32.                 $("#getimg").attr('src''upload/' + data.split("|")[1] + '.jpg');  
  33.                 $("#hid").val(data.split("|")[1] + ".jpg");  
  34.                 var img = $("#hid").val();  
  35.                 if (img == "noimage.jpg") {  
  36.                     $("#Remov").hide();  
  37.                 } else {  
  38.                     $("#Remov").show();  
  39.                 }  
  40.   
  41.             } else if (data.split("|")[0] == "False") {  
  42.                 alert(data.split("|")[1]);  
  43.                 var ab = $("#hid").val();  
  44.                 $("#getimg").attr('src''upload/' + ab);  
  45.                 var img = $("#hid").val();  
  46.                 if (img == "noimage.jpg") {  
  47.                     $("#Remov").hide();  
  48.                 } else {  
  49.                     $("#Remov").show();  
  50.                 }  
  51.   
  52.             }  
  53.         })  
  54.             .error(function() {  
  55.             if ($(myFile).val() == "") {  
  56.                 alert("Select a file");  
  57.             } else {  
  58.                 alert("Select a image file");  
  59.             }  
  60.         });  
  61.     }  
  62. }]);  
  63. myApp.controller('userController', ['$scope''$window''$filter''$http''fileUpload'function($scope, $window, $filter, $http, fileUpload) {  
  64.     $scope.fName = '';  
  65.     $scope.lName = '';  
  66.     $scope.phone = '';  
  67.     $scope.id = 0;  
  68.     $scope.users = [  
  69.     // { id: 1, 'firstName': 'manish', 'lastName': 'Pipaliya', 'phone': '9727899812' },  
  70.     // { id: 2, 'firstName': 'Depak', 'lastName': 'Patel', 'phone': '9724228344' }  
  71.     ];  
  72.     $scope.sear = function() {  
  73.         var orderBy = $filter('orderBy');  
  74.         $scope.order = function(Btn) {  
  75.             $scope.users = orderBy($scope.users, Btn);  
  76.         };  
  77.     };  
  78.     $scope.LoadData = function() {  
  79.         $http.get('JsonData.txt').success(function(data) {  
  80.             $scope.users = data;  
  81.             $scope.totalItems = $scope.users.length;  
  82.             if ($scope.totalItems <= 0) {  
  83.                 $("#hide").text("No Record Found");  
  84.             }  
  85.             $scope.itemsPerPage = 3  
  86.             $scope.currentPage = 1;  
  87.             $scope.maxSize = 5;  
  88.             $scope.bigTotalItems = 175;  
  89.             $scope.bigCurrentPage = 1;  
  90.             $scope.pageCount = function() {  
  91.                 return Math.ceil($scope.users.length / $scope.itemsPerPage);  
  92.             };  
  93.   
  94.             $scope.$watch('currentPage + itemsPerPage'function() {  
  95.                 var begin = (($scope.currentPage - 1) * $scope.itemsPerPage),  
  96.                     end = begin + $scope.itemsPerPage;  
  97.                 $scope.users = data.slice(begin, end);  
  98.             });  
  99.         });  
  100.   
  101.     };  
  102.     $scope.LoadData();  
  103.     $scope.uploadFile = function() {  
  104.         var fileval = ['jpeg''jpg''png''gif''bmp'];  
  105.         if ($(myFile).val() == "") {  
  106.             alert("Select a file");  
  107.         } else if ($.inArray($(myFile).val().split('.').pop().toLowerCase(), fileval) == -1) {  
  108.             alert("Select a image file");  
  109.             $(myFile).val('');  
  110.             $("#hid").val("noimage.jpg");  
  111.         } else {  
  112.             var file = $scope.myFile;  
  113.             var uploadUrl = "Image_Upload.aspx";  
  114.             fileUpload.uploadFileToUrl(file, uploadUrl);  
  115.             $scope.myFile = "";  
  116.             $scope.remove = true;  
  117.             var reader = new FileReader();  
  118.             reader.onload = function(e) {  
  119.                 scope.image = e.target.result;  
  120.                 scope.$apply();  
  121.             }  
  122.         }  
  123.   
  124.         elem.on('change'function() {  
  125.             reader.readAsDataURL(elem[0].files[0]);  
  126.         });  
  127.         return false;  
  128.     };  
  129.     $scope.SaveData = function() {  
  130.         strErrorMsg = "";  
  131.         var a = $("#hid").val();  
  132.         notEmpty(document.getElementById('fname'), '-Enter your First Name.');  
  133.         notEmpty(document.getElementById('lname'), '-Enter your Last Name.');  
  134.         notEmpty(document.getElementById('phone'), '-Enter your Phone Number.');  
  135.         ValidMno(document.getElementById('phone'), '-Enter Valid Phone Number.');  
  136.         if (strErrorMsg == '') {  
  137.             $.ajax({  
  138.                 type: "POST",  
  139.                 url: "UsersFormJson.aspx/Data_Save",  
  140.                 contentType: "application/json; charset=utf-8",  
  141.                 data: JSON.stringify({  
  142.                     id: $scope.id,  
  143.                     firstName: $scope.fName,  
  144.                     lastName: $scope.lName,  
  145.                     phone: $scope.phone,  
  146.                     photo: $scope.hid = a  
  147.                 }),  
  148.                 success: function(data) {  
  149.                     $scope.LoadData();  
  150.                     $("#hide").text('');  
  151.                     $scope.$apply();  
  152.                 }  
  153.             });  
  154.             $scope.edit3 = true;  
  155.             $scope.edit2 = false;  
  156.             $scope.adv = false;  
  157.             $scope.adv1 = false;  
  158.         }  
  159.         if (strErrorMsg != '') {  
  160.             $window.alert(' \n' + strErrorMsg);  
  161.         } else {  
  162.   
  163.         }  
  164.     };  
  165.   
  166.     function notEmpty(elem, helperMsg) {  
  167.   
  168.         if (elem.value == "") {  
  169.             strErrorMsg = strErrorMsg + helperMsg + "\n";  
  170.   
  171.         }  
  172.     }  
  173.   
  174.     function ValidMno(elem, helperMsg) {  
  175.         if (elem.value !== "") {  
  176.             var phone = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;  
  177.             if (!(elem.value.match(phone))) {  
  178.                 strErrorMsg = strErrorMsg + '' + helperMsg + "\n";  
  179.   
  180.             }  
  181.         }  
  182.     }  
  183.     $scope.edit = function(id) {  
  184.         for (i in $scope.users) {  
  185.             if ($scope.users[i].id == id) {  
  186.                 if ($scope.users[i].photo == "noimage.jpg") {  
  187.                     $("#Remov").hide();  
  188.                 } else {  
  189.                     $("#Remov").show();  
  190.                 }  
  191.                 ({  
  192.                     id: $scope.id,  
  193.                     firstName: $scope.fName,  
  194.                     lastName: $scope.lName,  
  195.                     phone: $scope.phone,  
  196.                     photo: $scope.hid  
  197.                 }) = angular.copy($scope.users[i]);  
  198.                 $("#getimg").attr('src''upload/' + $scope.users[i].photo);  
  199.                 //alert($scope.users[i].photo);  
  200.                 $scope.edit3 = false;  
  201.                 $scope.edit2 = true;  
  202.                 $scope.edit11 = true;  
  203.                 $scope.edit1 = false;  
  204.                 //$(myFile).val('');  
  205.                 $scope.remove = true;  
  206.                 $scope.$apply();  
  207.                 $scope.adv1 = true;  
  208.                 $scope.adv = false;  
  209.             }  
  210.         }  
  211.     };  
  212.     $scope.removefile = function() {  
  213.         var Removeimg = $window.confirm('Are you sure you want to Remove The Image?');  
  214.         if (Removeimg) {  
  215.             $("#hid").val("noimage.jpg");  
  216.             $("#getimg").attr('src''upload/noimage.jpg');  
  217.             if ($("#hid").val() == "noimage.jpg") {  
  218.                 $scope.remove1 = false;  
  219.             } else {  
  220.                 $scope.remove1 = true;  
  221.             }  
  222.         }  
  223.     };  
  224.     //Delete a Image From Folder   
  225.     $scope.delt = function(id) {  
  226.         for (i in $scope.users) {  
  227.             if ($scope.users[i].id == id) {  
  228.                 if ($scope.users[i].photo != "noimage.jpg") {  
  229.                     $.ajax({  
  230.                         type: "POST",  
  231.                         url: "UsersFormJson.aspx/DeleteImage",  
  232.                         contentType: "application/json; charset=utf-8",  
  233.                         data: JSON.stringify({  
  234.                             hid: $scope.users[i].photo  
  235.                         }),  
  236.                         success: function(data) {  
  237.   
  238.                         },  
  239.                         error: function() {}  
  240.                     });  
  241.                 }  
  242.             }  
  243.         }  
  244.     };  
  245.   
  246.     $scope.del = function(id) {  
  247.         var deleteUser = $window.confirm('Are you sure you want to delete this Record ?');  
  248.         if (deleteUser) {  
  249.             for (i in $scope.users) {  
  250.                 if ($scope.users[i].id == id) {  
  251.                     $.ajax({  
  252.                         type: "POST",  
  253.                         url: "UsersFormJson.aspx/Data_Delete",  
  254.                         contentType: "application/json; charset=utf-8",  
  255.                         data: JSON.stringify({  
  256.                             id: $scope.users[i].id  
  257.                         }),  
  258.                         success: function(data) {  
  259.                             alert("Record Delete successfully");  
  260.                         }  
  261.                     });  
  262.                     $scope.delt(id);  
  263.                     $scope.LoadData();  
  264.                 }  
  265.             }  
  266.   
  267.         }  
  268.         alert("Keep it Continue");  
  269.     };  
  270.     $scope.editUser = function() {  
  271.         $scope.edit11 = false;  
  272.         $scope.edit1 = true;  
  273.         $scope.edit3 = false;  
  274.         $scope.edit2 = true;  
  275.         $scope.fName = '';  
  276.         $scope.phone = '';  
  277.         $scope.lName = '';  
  278.         $scope.id = 0;  
  279.         $(myFile).val('');  
  280.         $("#hid").val("noimage.jpg");  
  281.         $scope.remove = false;  
  282.         $scope.adv = true;  
  283.         $scope.adv1 = false;  
  284.         var abc = $("#hid").val();  
  285.         $("#getimg").attr('src''upload/' + abc);  
  286.         $scope.remove = true;  
  287.         $("#Remov").hide();  
  288.     };  
  289.     $scope.cancel = function() {  
  290.         $scope.edit3 = true;  
  291.         $scope.edit2 = false;  
  292.         $scope.adv = false;  
  293.         $scope.adv1 = false;  
  294.     };  
  295. }]);  
  296.   
  297. Json File(JsonData.txt)[{  
  298.     "id""52182",  
  299.     "firstName""Dharmesh",  
  300.     "lastName""Patel",  
  301.     "phone""9727899812",  
  302.     "photo""noimage.jpg"  
  303. }, {  
  304.     "id""95978",  
  305.     "firstName""manish",  
  306.     "lastName""pipaliy",  
  307.     "phone""9727899812",  
  308.     "photo""noimage.jpg"  
  309. }, {  
  310.     "id""19258",  
  311.     "firstName""Depak",  
  312.     "lastName""Patel",  
  313.     "phone""9725564444",  
  314.     "photo""89f7ae05-f1b8-47e0-a11d-3c19264fdf57.jpg"  
  315. }]