c# - HttpPost Action method is not called from Edit save button -
here's action method
[httppost] [authorizeprivileges(privileges = "manage waiting room")] public actionresult editbillingcharges(int id, billingchargesmodel billingchargemodel, string hdnglobalpostvar, string hdnbillingchargesdetailsid) { if (!isactive) return logout(); viewdata["currentpage"] = "edit billing charge sheet"; billingcharges billing = new billingcharges(); billing = billingchargesbo.findbyid(id); if (hdnglobalpostvar.tolower().tostring() == "edit") { if (billingchargemodel != null) { billing.name = billingchargemodel.billingcharges.name; billing.modifiedby = user.identity.name; billing.datecreated = datetime.now; billing.datemodified = datetime.now; billingchargesbo.saveorupdate(billing); string[] schedulingdetailid = null; if (hdnbillingchargesdetailsid != "" && hdnbillingchargesdetailsid.contains(';')) { schedulingdetailid = hdnbillingchargesdetailsid.split(';'); (int = 0; < schedulingdetailid.length - 1; i++) { billingchargedetails billingdetails = billingchargesdetailsbo.findbyid(convert.toint16(schedulingdetailid[i].trim())); billingdetails.billingcharges = billing; billingchargesdetailsbo.saveorupdate(billingdetails); } } } } billingchargesmodel modelbillingmodel = new billingchargesmodel(); modelbillingmodel.billingcharges = billingchargesbo.findbyid(billing.id); modelbillingmodel.billingdetailsmodel = billingchargesdetailsbo.loadalldetailsbybillingchargeid(billing.id); ilist<billingchargedetails> billingchargedetails = new list<billingchargedetails>(); billingchargedetails = billingchargesdetailsbo.loadalldetailsbybillingid(); (int = 0; < billingchargedetails.count; i++) { modelbillingmodel.billingdetailsmodel.add(billingchargedetails[i]); } return view(modelbillingmodel); }
view code
@model wcg.web.models.billingchargesmodel @using wcg.web.utils @using wcg.data.businessobjects @using mvccontrib.ui.grid @using mvccontrib.ui.pager @using mvccontrib.pagination @using mvccontrib.ui.grid.actionsyntax @{ viewbag.title = "edit billing charge sheet"; layout = "~/views/shared/_layout.cshtml"; } <link href="@url.content("~/content/jquery.multiselect.css")" rel="stylesheet" type="text/css" /> <link href="@url.content("~/content/dd.css")" rel="stylesheet" type="text/css" /> <link href="@url.content("~/content/jquery-ui.css")" rel="stylesheet" type="text/css" /> <link href="@url.content("~/content/themes/base/jquery.ui.all.css")" type="text/css" rel="stylesheet" /> <link href="@url.content("~/content/grid/demo_page.css")" type="text/css" rel="stylesheet" /> <link href="@url.content("~/content/grid/demo_table_jui.css")" type="text/css" rel="stylesheet" /> <link href="@url.content("~/content/grid/jquery-ui-1.8.4.custom.css")" type="text/css" rel="stylesheet" /> <script src="@url.content("~/scripts/jquery.min.js")" type='text/javascript' ></script> <script src="@url.content("~/scripts/jquery-ui.min.js")" type='text/javascript' ></script> <script src="@url.content("~/content/grid/jquery.datatables.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/commonscript.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/grid.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/gridsorting.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/jquery.dd.js")" type="text/javascript"></script> <link href="@url.content("~/content/themes/fixheadergrid.css")" type="text/css" rel="stylesheet" /> <script src="@url.content("~/scripts/fixheadergrid.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/bindbillingchargesheet.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/jquery.blockui.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/jquery.multiselectbillingcpt.js")" type="text/javascript"></script> <script type="text/javascript"> var rooturl = '@url.content("~")'; </script> <style type="text/css"> #content_wrapper { width: 100%; float: left; min-height: 300px; margin-bottom: 1px; } #main_content_area { width: 72%; float: left; background: #ffffff; padding: 0 1%; margin: 0 12%; } .search { width: 98%; float: left; padding-top: 10px; padding-bottom: 10px; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -1.6em; } </style> @using (html.beginform()) { int32 icount = 1; <div id="content_area"> <!--main content area start here--> <div id="main_content_area"> <div id="content_wrapper"> <table width="99%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td> @html.validationsummary(true) </td> </tr> <tr> <td> </td> </tr> <tr> <td> <div id="dvbilling"> <fieldset> <legend><span class="pint_heading">billing charge sheet details</span></legend> <div class="search"> <div> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="5" colspan="4"> </td> </tr> <tr> <td style="width: 20%" class="black_label "> @html.labelfor(m => m.billingcharges.name):<span class="star">*</span> </td> <td style="width: 20%"> @html.textboxfor(m => m.billingcharges.name, new { style = "width:250px", maxlength = 150 }) </td> <td > @if (viewdata["pat_id"] != null) { @html.hidden("hdnid", viewdata["pat_id"]) } else { @html.hidden("hdnid", "0") } </td> <td style="width: 20%" class="black_label "> @html.hidden("hdnglobalpostvar", "0") @html.hidden("hdnbillingchargesdetailsid", "0") @html.hidden("hdncpt", viewdata["hdncpt"]) @html.hidden("hdnpaging", "0") @html.hidden("hdnpagesize", "100") @html.hidden("hdnsortindex", "0") @html.hidden("hdnsortorder", "asc") @html.hidden("hdnallpaging", "0") @html.hidden("hdnallpagesize", "100") @html.hidden("hdnallsortindex", "0") @html.hidden("hdnallsortorder", "asc") @html.hidden("hdnredirect", "0") @html.hidden("hdnbillingid", "0") @html.hidden("hdnsortcolumnid", "patid") </td> <td> <div > <a href="#" class="newcomment" onclick="bindaddbillingcharge()">add details</a></div> </td> </tr> <tr> <td> </td> <td colspan="2"> <label for="lblschedulingname" id="lblschedulingname" class="field-validation-error" style="display: none"> billing charge sheet name required.</label> </td> </tr> <tr> <td height="10" colspan="4" class="black_label"> </td> </tr> </table> </div> </div> </fieldset> </div> </td> </tr> <tr> <td> </td> </tr> <tr> <td height="10"> </td> <td colspan="2"> </td> </tr> <tr> <td> <div id="dvgridcpt"> <fieldset> <legend><span class="pint_heading">amount details</span></legend> <table width="100%"> <tr> <td> @html.grid(@model.billingdetailsmodel).columns(column => { column.for(m => m.id).attributes(@class => "hidecolumn").headerattributes(@class => "hideheader"); column.custom(@<div>@(icount++)</div>).named("s.no").attributes(@style => "width:60px;", @class => "hidecolumn").headerattributes(@class => "hideheader"); column.for(m => m.cpt).named("visit type").sortable(false).attributes(@style => "width:150px;").headerattributes(@class => "no-sorting"); column.for(m => m.codeused).named("np").sortable(false).attributes(@style => "width:150px;").headerattributes(@class => "no-sorting"); column.for(m => m.amount).named("ns").sortable(false).attributes(@style => "width:150px;").headerattributes(@class => "no-sorting"); column.custom(@<div> <img src="@url.content("~/images/edit_small.png")" class="edit_billingdetails" style="float: left;margin-left: 3px;" title="edit working hours" alt="" /> <img src="@url.content("~/images/delete_icon.png")" class="delete" title="delete" style="margin-left: 16px;" alt="" /> </div> ).sortable(false).named("").attributes(@style => "width:150px;").headerattributes(@class => "no-sorting"); }).empty("<div class=\"norecorddiv\">no record found.</div>").attributes(new dictionary<string, object>() { { "cellspacing", "0px" } }).attributes(@class => "display", id => "jtable") </td> </tr> </table> </fieldset> </div> <br /> <br /> </td> </tr> <tr> <td> @* <input type="button" class="reset_ico" value="" style="float: right; margin-left: 5px;" onclick="return showhidecontrols();" />*@ <input type="submit" class="save_bt" id="save_bt" value="" onclick="return bindeditbillingchargevalidations()" style="float: right; margin-left: 5px;" /> @html.actionlink(" ", "allbillingcharges", new { action = "allbillingcharges", controller = "billingcharges", status = "back" }, new { @class = "back_bt" }) </td> </tr> <tr> <td> </td> </tr> </table> </div> </div> </div> <div id="dvbillingcharges" style="display: none"> @html.validationsummary(true) <table width="100%"> <tr> <td class="black_label"> @html.hiddenfor(m => m.billingchargedetails.id) @html.label("code used"):<span class="star">*</span> </td> <td style="font-size: 12px;"> @html.radiobutton("rbcodeused", true,new { id = "rbscheduledbypatient_icd9", @style = "font-size:12px;" }) icd-9 @html.radiobutton("rbcodeused",false,new { id = "rbscheduledbypatient_icd10", @style = "font-size:12px;" }) icd-10 </td> </tr> <tr> <td height="5"> </td> </tr> <tr> <td class="black_label"> @html.label("billing cpt"):<span class="star">*</span> </td> <td style="font-size: 12px;"> @html.dropdownlist("ddbillingcpt",new selectlist(billingcodesbo.loadall().orderby(x => x.id),"cptcodes","cptcodes"),new { @style = "width:150px;color:black" }) </td> </tr> <tr> <td height="25"> </td> </tr> <tr> <td width="45%" class="black_label"> @html.label("amount"):<span class="star">*</span> </td> <td width="55%" style="font-size: 12px;"> @html.textboxfor(m=>m.billingchargedetails.amount, new { @style = "width:150px; ", maxlength = 150 }) </td> </tr> <tr> <td height="5"> </td> </tr> <tr> <td> </td> <td align="right"> <input type="button" value="" class="save_bt" onclick="return saveamounts()" /> </td> </tr> </table> </div> <div id="dveditbillingcharges" style="display: none"> @html.validationsummary(true) <table width="100%"> <tr> <td class="black_label"> @html.hidden("edit") @html.label("code used"):<span class="star">*</span> </td> <td style="font-size: 12px;"> @html.radiobutton("rbcodeusededit", true,new { id = "rbscheduledbypatient_icd9", @style = "font-size:12px;" }) icd-9 @html.radiobutton("rbcodeusededit",false,new { id = "rbscheduledbypatient_icd10", @style = "font-size:12px;" }) icd-10 </td> </tr> <tr> <td height="5"> </td> </tr> <tr> <td class="black_label"> @html.label("billing cpt"):<span class="star">*</span> </td> <td style="font-size: 12px;"> @html.dropdownlist("ddeditbillingcpt",new selectlist(billingcodesbo.loadall().orderby(x => x.id),"cptcodes","cptcodes"),new { @style = "width:150px;color:black" }) </td> </tr> <tr> <td height="25"> </td> </tr> <tr> <td width="45%" class="black_label"> @html.label("amount"):<span class="star">*</span> </td> <td width="55%" style="font-size: 12px;"> @html.textbox("editamount",null, new { @style = "width:150px; ", maxlength = 150 }) </td> </tr> <tr> <td height="5"> </td> </tr> <tr> <td> </td> <td align="right"> <input type="button" value="" class="save_bt" onclick="return saveeditamounts()" /> </td> </tr> </table> </div> }
while clicking on save jquery method called is
function bindeditbillingchargevalidations() { debugger; var txtchargesheetname = $("#billingcharges_name"); var table = ""; var allrows = ""; var gridrows = ""; var locationsdetailscount = ""; table = $("#jtable"); allrows = $(table).find("tbody>tr"); gridrows = allrows.filter(".gridrow_alternate, .gridrow"); var isvalid = true; var isfirst = false; if ($.trim(txtchargesheetname.val()) == "") { $("#lblschedulingname").show(); isvalid = false; } else { $("#lblschedulingname").hide(); } gridrows.find(".hidecolumn").hide(); gridrows.each(function (index) { locationsdetailscount += gridrows[index].cells[0].innerhtml + ";"; }); if (locationsdetailscount == "") { alert("please select cpt code charge sheet , add amounts.") isvalid = false; } if (isvalid == true) { if (confirm("are sure want proceed?")) { $("#dvbilling").find("#hdnglobalpostvar").val($.trim("edit")) var locationsdetailsid = ""; table = $("#jtable"); allrows = $(table).find("tbody>tr"); gridrows = allrows.filter(".gridrow_alternate, .gridrow"); gridrows.find(".hidecolumn").hide(); gridrows.each(function (index) { locationsdetailsid += gridrows[index].cells[0].innerhtml + ";"; }); $("#dvbilling").find("#hdnbillingchargesdetailsid").val(locationsdetailsid); $("#dvgridcpt").show(); return ("billing charge updated successfully"); } else { return false; } } else return false; }
the problem here when click on save whole of jquery gets executed [httppost] method not getting called. want can post generated html too.plz me out.
Comments
Post a Comment