Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. function btnChangeFrequencyClick() {
  2. var items = {};
  3. var grid = $('#ProfileCustGrid').data('kendoGrid');
  4. var selectedElements = grid.select();
  5.  
  6. for (var j = 0; j < selectedElements.length; j++) {
  7. var item = grid.dataItem(selectedElements[j]);
  8. items['SelectedCustomersRows[' + j + '].FK_ProfileId'] = item.FK_ProfileId;
  9. items['SelectedCustomersRows[' + j + '].DoctorClinicID'] = item.DoctorClinicID;
  10. items['SelectedCustomersRows[' + j + '].OrganizationID'] = item.OrganizationID;
  11. items['SelectedCustomersRows[' + j + '].FK_DoctorID'] = item.FK_DoctorID;
  12. items['SelectedCustomersRows[' + j + '].FK_RepTeamID'] = item.FK_RepTeamID;
  13. items['SelectedCustomersRows[' + j + '].SpecialityID'] = item.SpecialityID;
  14. items['SelectedCustomersRows[' + j + '].ClassificationID'] = item.ClassificationID;
  15. items['SelectedCustomersRows[' + j + '].GeographicalAreaID'] = item.GeographicalAreaID;
  16. items['SelectedCustomersRows[' + j + '].DoctorCode'] = item.DoctorCode;
  17. items['SelectedCustomersRows[' + j + '].DoctorName'] = item.DoctorName;
  18. items['SelectedCustomersRows[' + j + '].OrganizationCode'] = item.OrganizationCode;
  19. items['SelectedCustomersRows[' + j + '].OrganizationName'] = item.OrganizationName;
  20. items['SelectedCustomersRows[' + j + '].Address'] = item.Address;
  21. items['SelectedCustomersRows[' + j + '].GeographicalAreaName'] = item.GeographicalAreaName;
  22. items['SelectedCustomersRows[' + j + '].ClassificationCode'] = item.ClassificationCode;
  23. items['SelectedCustomersRows[' + j + '].NumOfDoctors'] = item.NumOfDoctors;
  24. items['SelectedCustomersRows[' + j + '].SpecialityName'] = item.SpecialityName;
  25. items['SelectedCustomersRows[' + j + '].DoctorTypeName'] = item.DoctorTypeName;
  26. items['SelectedCustomersRows[' + j + '].Frequency'] = item.Frequency;
  27. items['SelectedCustomersRows[' + j + '].ProfileCode'] = item.ProfileCode;
  28. items['SelectedCustomersRows[' + j + '].FK_ToPeriodId'] = -1;
  29.  
  30. }
  31. items['profileid'] = Number(@Model.ProfileId);
  32. @*location.href = '@Url.Action("ReadFrequencyExceptions", "Profile")?' + items*@
  33. var _DocOrOrgId = -1;
  34. _DocOrOrgId = $("#CustomerTypeDDL").val();
  35. if (_DocOrOrgId == 0) {//Doctor
  36. _DocOrOrgId = 0;
  37. }
  38. else {//org
  39. _DocOrOrgId = 1;
  40. }
  41.  
  42. var ProfileId = Number(@Model.ProfileId);
  43. var parentID = selectedParentID;
  44. var CustomerIdVal = $("#CustomerTypeDDL").val();
  45. var PeriodId = $("#PeriodProfileCustDDL").val();
  46.  
  47. $.ajax({
  48. url: '@Url.Action("GetChangeFrequencyData")',
  49. type: 'Post',
  50. datatype: "json",
  51. data: items,
  52. success: function (returned) {
  53. location.href = '@Url.Action("ChangeFrequency", "Profile")?ProfileId=' + ProfileId + '&parentID=' + parentID + '&CustomerIdVal=' + CustomerIdVal + '&PeriodId=' + PeriodId
  54. //window.open("/Profile/ChangeFrequency")
  55. //Refresh();
  56. },
  57. error: function (returned) {
  58. @*location.href = '@Url.Action("ChangeFrequency", "Profile")'*@
  59. location.href = '@Url.Action("ChangeFrequency", "Profile")?ProfileId=' + ProfileId + '&parentID=' + parentID + '&CustomerIdVal=' + CustomerIdVal + '&PeriodId=' + PeriodId
  60. }
  61. });
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement