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
/
VITA
/
Views
/
Feek1Beneficiaries
/
Edit File Name :
Create.cshtml
@model RER_Project.DataAccess.ViewModels.Cooperative.CooperativeViewModel @{ ViewBag.Title = "FEEK1 Beneficiaries Create"; var coopId = ViewContext.RouteData.Values["Id"].ToString(); } <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-lg-12"> <div class="ibox float-e-margins"> <div class="ibox-content"> <label style="font-size: medium"><b>Feek1 Beneficiaries - Create</b></label> <hr /> <form id="CreateFeek1BeneficiariesForm"> <input type="hidden" id="startDateNepali" name="Feek1BeneficiariesStartDateNepali" /> <input type="hidden" id="startDate" name="Feek1BeneficiariesStartDate" /> <input type="hidden" id="endDateNepali" name="Feek1BeneficiariesEndDateNepali" /> <input type="hidden" id="endDate" name="Feek1BeneficiariesEndDate" /> <input type="hidden" id="coopId" name="CoopId" value="@coopId" /> <div class="row"> <div class="form-group col-md-3"> <label><strong>Start Date</strong></label> <input type="text" class="form-control required" id="nepaliStartDatePicker" /> </div> <div class="form-group col-md-3"> <label><strong>End Date</strong></label> <input type="text" class=" required form-control" id="nepaliEndDatePicker" /> </div> <div class="form-group col-md-3"> <label><strong>Province</strong></label> <select type="text" class="form-control required" name="ProvinceId" id="ProvinceId" data-api="/province/select/threeStates" data-api-selected-value="@Model.Cooperatives.ProvinceId"></select> <input type="hidden" id="ProvinceId" name="ProvinceId" value="@Model.Cooperatives.ProvinceId" /> </div> <div class="form-group col-md-3"> <label><strong>District</strong></label> <select type="text" class="form-control required" name="DistrictId" id="DistrictId" data-api="/districts/select" data-api-selected-value="@Model.Cooperatives.DistrictId" disabled=""></select> <input type="hidden" id="DistrictId" name="DistrictId" value="@Model.Cooperatives.DistrictId" /> </div> </div> <div class="row"> <div class="form-group col-md-3"> <label><strong>Municipality</strong></label> <select type="text" class="form-control required" id="MunicipalityId" name="MunicipalityId" data-api="/municipality/select" data-api-selected-value="@Model.Cooperatives.MunicipalityId" disabled=""></select> <input type="hidden" id="MunicipalityId" name="MunicipalityId" value="@Model.Cooperatives.MunicipalityId" /> </div> <div class="form-group col-md-3"> <label><strong>Ward No.</strong></label> <input type="text" oninput="validity.valid||(value='');" pattern="\d*" class="required form-control clear" id="WardNo" name="WardNo" maxlength="2" /> </div> <div class="form-group col-md-3"> <label><strong>Participant Name</strong> </label> <input type="text" class="form-control required clear" name="ParticipantName" id="ParticipantName" /> </div> <div class="form-group col-md-3"> <label> <strong>Age</strong> </label> <input type="number" oninput="validity.valid||(value='');" min="1" max="130" class="form-control required clear" name="Age" id="Age" /> </div> </div> <div class="row"> <div class="form-group col-md-3"> <label><strong>Gender </strong></label> <select class="form-control m-b required clear" name="Gender" id="Gender" data-api="/genders/select"> </select> </div> <div class="form-group col-md-3"> <label><strong>Ethnicity</strong></label> <select type="text" class="form-control required clear" name="EthnicityId" id="EthnicityId" data-api="/ethnicity/select"></select> </div> @*<div class="form-group col-md-3"> <label><strong>Education</strong></label> <select type="text" class="form-control required clear" name="Education" id="Education" data-api="/education-status/select"></select> </div> <div class="form-group col-md-3"> <label><strong>Occupation</strong> </label> <select type="text" class="form-control required clear" name="OccupationId" id="OccupationId" data-api="/select/occupation"></select> </div>*@ <div class="form-group col-md-3"> <label><strong>Migration Status</strong></label> <select type="text" class="form-control required clear" name="MigrantStatusId" id="MigrantStatusId" data-api="/migration-status/select"></select> </div> <div class="form-group col-md-3"> <label><strong>Origin</strong></label> <select type="text" class="form-control required clear" name="OriginId" id="OriginId" data-api="/origin/select/values"></select> </div> </div> <div class="row"> <div class="form-group col-md-3"> <label><strong>Position</strong></label> <select type="text" class="form-control required clear" name="PositionId" id="PositionId" data-api="/feek-positions/select"></select> </div> <div class="form-group col-md-3"> <label><strong>Mobile No</strong> </label> <input type="text" class="form-control clear" name="MobileNo" id="MobileNo" maxlength="10"/> </div> </div> <div class="row"> <div class="pull-right"> <input type="button" value="Add" class="btn btn-primary" id="addBtn" onclick="addFeek1BeneficiariesList()" /><span> </span> <a href="/feek1/beneficiaries/coop/@coopId" class="btn btn-default">Back</a> </div> </div> <div class="row"> <div class="table-responsive" style="margin-top:16px;"> <table class="footable table table-hover" id="Feek1BeneficiariesList"> <thead> <tr> <th>Start Date</th> <th>Start Date(English)</th> <th>End Date</th> <th>End Date(English)</th> <th>Province</th> <th>District</th> <th>Palika</th> <th>Ward</th> <th>Participant Name</th> <th>Age</th> <th>Gender</th> <th>Ethnicity</th> <th>Migration Status</th> <th>Origin</th> <th>Position</th> <th>Mobile No</th> </tr> </thead> <tbody> </tbody> </table> <input type="button" value="Save" class="btn btn-primary pull-right" id="submitBtn" /><span> </span> </div> </div> </form> </div> </div> </div> </div> </div> <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/NepaliDatePicker/jquery.nepaliDatePicker.min.js"></script> <link href="~/Content/NepaliDatePicker/nepaliDatePicker.min.css" rel="stylesheet" /> <script> $(document).ready(function () { window.initializeSelectApis(); window.initializeCascadeLocation(); $("#nepaliStartDatePicker").nepaliDatePicker({ dateFormat: "%y-%M-%d", closeOnDateSelect: true }); $("#nepaliStartDatePicker").on("dateSelect", function (event) { var datePickerData = event.datePickerData; $("#startDate").val(datePickerData.adDate.toLocaleDateString()); $("#startDateNepali").val(datePickerData.bsYear + "-" + datePickerData.bsMonth + "-" + datePickerData.bsDate); var startDateEnglish = document.getElementById("startDate").value; var endDateEnglish = document.getElementById("endDate").value if ((Date.parse(endDateEnglish) <= Date.parse(startDateEnglish))) { ShowMessage("error", "End date should be greater than Start date"); document.getElementById("nepaliStartDatePicker").value = ""; } }) $("#nepaliEndDatePicker").nepaliDatePicker({ dateFormat: "%y-%M-%d", closeOnDateSelect: true }); $("#nepaliEndDatePicker").on("dateSelect", function (event) { var datePickerData = event.datePickerData; $("#endDate").val(datePickerData.adDate.toLocaleDateString()); var startDateEnglish = document.getElementById("startDate").value; var endDateEnglish = document.getElementById("endDate").value if ((Date.parse(endDateEnglish) <= Date.parse(startDateEnglish))) { ShowMessage("error", "End date should be greater than Start date"); document.getElementById("nepaliEndDatePicker").value = ""; } $("#endDateNepali").val(datePickerData.bsYear + "-" + datePickerData.bsMonth + "-" + datePickerData.bsDate); }) $("#submitBtn").off("click").on("click", function () { function request(model) { const url = "/feek1/beneficiaries/create"; const data = JSON.stringify(model.Feek1Beneficiaries); return window.getAjaxRequest(url, "POST", data); } //const form = $("#CreateFeek1BeneficiariesForm"); //$.validator.unobtrusive.parse(form); //if (!form.valid()) { // return false; //}; if (!window.confirmAction()) { return; }; WorkForce.loader.show(); function getModel() { return ({ Feek1Beneficiaries:getAllList() //window.serializeForm(form), }); } const model = getModel(); debugger const ajax = request(model); ajax.done(function (response) { WorkForce.loader.hide(); showNotification("success"); window.location = "/feek1/beneficiaries/coop/@coopId"; }); ajax.fail(function (xhr) { WorkForce.loader.hide(); ShowMessage("error", xhr.responseText); }); }) }) function addFeek1BeneficiariesList () { const form = $("#CreateFeek1BeneficiariesForm"); var table = $('#Feek1BeneficiariesList tbody'); $.validator.unobtrusive.parse(form); if (!form.valid()) { return false; } var row = "<tr>"; row += "<td>" + getValuesById("startDateNepali") + "<input type=hidden name='Feek1BeneficiariesStartDateNepali' value=" + getValuesById("startDateNepali") + "></td>"; row += "<td>" + getValuesById("startDate") + "<input type=hidden name='Feek1BeneficiariesStartDate' value=" + getValuesById("startDate") + "></td>"; row += "<td>"+ getValuesById("endDateNepali") +"<input type=hidden name='Feek1BeneficiariesEndDateNepali' value=" + getValuesById("endDateNepali") + "></td>"; row += "<td>" + getValuesById("endDate") + "<input type=hidden name='Feek1BeneficiariesEndDate' value=" + getValuesById("endDate") + "></td>"; row += "<td>" + getValues("ProvinceId").text() + "<input type=hidden name='ProvinceId' value=" + getValues("ProvinceId").val() + "></td>"; row += "<td>" + getValues("DistrictId").text() + "<input type=hidden name='DistrictId' value=" + getValues("DistrictId").val() + "></td>"; row += "<td>" + getValues("MunicipalityId").text() + "<input type=hidden name='PalikaId' value=" + getValues("MunicipalityId").val() + "></td>"; row += "<td>" + getValuesById("WardNo") + "<input type=hidden name='WardNo' value=" + getValuesById("WardNo") + "></td>"; row += "<td>" + getValuesById("ParticipantName") +"</td>"; row += "<td>" + getValuesById("Age") + "<input type=hidden name='Age' value=" + getValuesById("Age") + "></td>"; row += "<td>" + getValues("Gender").text() + "<input type=hidden name='Gender' value=" + getValues("Gender").val() + "></td>"; row += "<td>" + getValues("EthnicityId").text() + "<input type=hidden name='EthnicityId' value=" + getValues("EthnicityId").val() + "></td>"; row += "<td>" + getValues("MigrantStatusId").text() + "<input type=hidden name='MigrantStatusId' value=" + getValues("MigrantStatusId").val() + "></td>"; row += "<td>" + getValues("OriginId").text() + "<input type=hidden name='OriginId' value=" + getValues("OriginId").val() + "></td>"; row += "<td>" + getValues("PositionId").text() + "<input type=hidden name='PositionId' value=" + getValues("PositionId").val() + "></td>"; row += "<td>" + getValuesById("MobileNo") + "<input type=hidden name='MobileNo' value=" + getValuesById("MobileNo") + "></td>"; row += "<td><a class='btn btn-default btn-xs' onclick='deleteRow(this)' title='Delete'><i class='fa fa-remove' style='color: red;'></i></a></td>"; table.append(row); clearAll(); } function getAllList() { debugger var getAllList = []; $('#Feek1BeneficiariesList tbody tr').each(function () { getAllList.push({ CoopId: @coopId, Feek1BeneficiariesStartDateNepali: getValuesFromList(0,$(this)), Feek1BeneficiariesStartDate: getValuesFromList(1,$(this)), Feek1BeneficiariesEndDateNepali: getValuesFromList(2,$(this)), Feek1BeneficiariesEndDate: getValuesFromList(3, $(this)), ProvinceId: getValuesFromList(4, $(this)), DistrictId: getValuesFromList(5, $(this)), PalikaId: getValuesFromList(6, $(this)), WardNo: getValuesFromList(7, $(this)), ParticipantName: getValuesFromList1(8,$(this)), Age: getValuesFromList(9,$(this)), Gender: getValuesFromList(10,$(this)), EthnicityId: getValuesFromList(11,$(this)), MigrantStatusId: getValuesFromList(12,$(this)), OriginId: getValuesFromList(13,$(this)), PositionId: getValuesFromList(14, $(this)), MobileNo: getValuesFromList(15, $(this)) }); }); debugger return getAllList; } function getValuesFromList(id,$element) { const val = $element.find("td:eq(" + id + ")").find("input[type='hidden']").val(); return val; } function getValuesFromList1(id, $element) { const val = $element.find("td:eq(" + id + ")").html(); debugger return val; } function getValuesById(param) { var value = document.getElementById(param).value; return value; } function getValues(param) { const value = $("#" + param + " option:selected"); return value; } function deleteRow(e) { $(e).closest("tr").remove(); }; function clearAll() { $('.clear').val(''); } </script>
Save