Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function btnChangeFrequencyClick() {
- var items = {};
- var grid = $('#ProfileCustGrid').data('kendoGrid');
- var selectedElements = grid.select();
- for (var j = 0; j < selectedElements.length; j++) {
- var item = grid.dataItem(selectedElements[j]);
- items['SelectedCustomersRows[' + j + '].FK_ProfileId'] = item.FK_ProfileId;
- items['SelectedCustomersRows[' + j + '].DoctorClinicID'] = item.DoctorClinicID;
- items['SelectedCustomersRows[' + j + '].OrganizationID'] = item.OrganizationID;
- items['SelectedCustomersRows[' + j + '].FK_DoctorID'] = item.FK_DoctorID;
- items['SelectedCustomersRows[' + j + '].FK_RepTeamID'] = item.FK_RepTeamID;
- items['SelectedCustomersRows[' + j + '].SpecialityID'] = item.SpecialityID;
- items['SelectedCustomersRows[' + j + '].ClassificationID'] = item.ClassificationID;
- items['SelectedCustomersRows[' + j + '].GeographicalAreaID'] = item.GeographicalAreaID;
- items['SelectedCustomersRows[' + j + '].DoctorCode'] = item.DoctorCode;
- items['SelectedCustomersRows[' + j + '].DoctorName'] = item.DoctorName;
- items['SelectedCustomersRows[' + j + '].OrganizationCode'] = item.OrganizationCode;
- items['SelectedCustomersRows[' + j + '].OrganizationName'] = item.OrganizationName;
- items['SelectedCustomersRows[' + j + '].Address'] = item.Address;
- items['SelectedCustomersRows[' + j + '].GeographicalAreaName'] = item.GeographicalAreaName;
- items['SelectedCustomersRows[' + j + '].ClassificationCode'] = item.ClassificationCode;
- items['SelectedCustomersRows[' + j + '].NumOfDoctors'] = item.NumOfDoctors;
- items['SelectedCustomersRows[' + j + '].SpecialityName'] = item.SpecialityName;
- items['SelectedCustomersRows[' + j + '].DoctorTypeName'] = item.DoctorTypeName;
- items['SelectedCustomersRows[' + j + '].Frequency'] = item.Frequency;
- items['SelectedCustomersRows[' + j + '].ProfileCode'] = item.ProfileCode;
- items['SelectedCustomersRows[' + j + '].FK_ToPeriodId'] = -1;
- }
- items['profileid'] = Number(@Model.ProfileId);
- @*location.href = '@Url.Action("ReadFrequencyExceptions", "Profile")?' + items*@
- var _DocOrOrgId = -1;
- _DocOrOrgId = $("#CustomerTypeDDL").val();
- if (_DocOrOrgId == 0) {//Doctor
- _DocOrOrgId = 0;
- }
- else {//org
- _DocOrOrgId = 1;
- }
- var ProfileId = Number(@Model.ProfileId);
- var parentID = selectedParentID;
- var CustomerIdVal = $("#CustomerTypeDDL").val();
- var PeriodId = $("#PeriodProfileCustDDL").val();
- $.ajax({
- url: '@Url.Action("GetChangeFrequencyData")',
- type: 'Post',
- datatype: "json",
- data: items,
- success: function (returned) {
- location.href = '@Url.Action("ChangeFrequency", "Profile")?ProfileId=' + ProfileId + '&parentID=' + parentID + '&CustomerIdVal=' + CustomerIdVal + '&PeriodId=' + PeriodId
- //window.open("/Profile/ChangeFrequency")
- //Refresh();
- },
- error: function (returned) {
- @*location.href = '@Url.Action("ChangeFrequency", "Profile")'*@
- location.href = '@Url.Action("ChangeFrequency", "Profile")?ProfileId=' + ProfileId + '&parentID=' + parentID + '&CustomerIdVal=' + CustomerIdVal + '&PeriodId=' + PeriodId
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement