Click here to Skip to main content
15,893,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everybody ,
I am Working on Perches project as a study Project ,
Here i Am trying show Unpaid Perches bill which data in is Perchestransation Table and from Suppler Table there is all details of suppler

here i select suppler id from Perches table and trying to get a partial view for this same suppler perches bills where balance amount is less than total amount ,
in Controller on breakpoints he show selected records but partial view not shown in main View

or here is any option please give me an idea or tutorial

need help for this

What I have tried:

html for main View and jQuery

@model WorkingPlace.Models.Supplyer

@{
	ViewBag.Title = "PerPAYment";
}

<h2 style="color:maroon;background-color:aliceblue;background-origin:border-box;width:100% ">PERCHES PAYMENTS </h2>
<html>
<head>
	<style>
		.inv1 {
			display: none;
		}
	</style>
</head>
<body>
	<div class="PaymentDiv">
		<div class="dataDiv">
			<h3 style="color:red ;background-origin:padding-box">First Select Suppler And Then Pay The Bills as per list Selection   </h3>
			<br />
			<p>
				@Html.ActionLink("Return to perches", "Index")
			</p>
			<div>
				<table>
					<tr>
						<td style="width:40%">
							 Select Supplyer  <br />
							@Html.DropDownListFor(m => m.SupplyerID, new SelectList(Model.GetSupplyers_S, "SupplyerID", "Sypplyer_name"), "-- Select Supplyer --", new { @class = "sid form-control" })
						</td>
						<td>
							<hr />
							 
						</td>

						<td >
								 Select Payment OPtion  <br />

								@{
									var domainsList = new SelectList(new[]
									{
									  new SelectListItem { Text = "BANK", Value = "BANK", Selected = true },
									  new SelectListItem { Text = "CASH", Value = "CASH"},

									}, "Value", "Text");
@Html.DropDownList("PAymrntType", domainsList, "-- SELECT PAYMENT TYPE  --", new { @class = "PAymrntType", @id = "PAymrntType", @width = "100px" })
						</td>
						<td>
							<input type="hidden" id="supid" class="supid1" value="@TempData["SupId"]"/>
						</td>
					</tr>
				</table>
				<div id="inv" class="inv1">
					@*@Html.Partial("MyNonpaindIVN")*@
				</div>
			</div>
		</div>
	</div>
</body>
</html>
@section scripts{
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<script src="~/Scripts/jquery-ui-1.12.1.min.js"></script>
<script src="~/Scripts/chosen.jquery.min.js"></script>
<script src="~/Scripts/notify.min.js"></script>
<script>
	$(function () {
		$("#SupplyerID").chosen({
			//disable_search_threshold:5
		});
	});
	

</script>
	<script>
		$("#PAymrntType").chosen({
		});

	</script>
	<script>
		var myname;
		var myid

		$(document).on('change', '.sid', function () {
			var url = "/Perchus/Suplyerdata";
			var SupplyerID = $('#SupplyerID').val().trim();
			$.post(url, { SupplyerID: SupplyerID }, function (data) {
				myname = data.Sypplyer_name;
				myid = data.SupplyerID;
				$.notify("You selected " + " " + myname + "  " + "To Convert challan", "success");
				
			});
		});
	</script>
	<script>
		$(document).ready(function () {
			$(document).on('change', '.PAymrntType', function () {
				var typeOF = $("#PAymrntType").val().trim();
				$.notify("You Selected a Payment Type  " + typeOF, "Info")
				var supid = $('#SupplyerID').val();
				$.get("/Perchus/GetUNPAID", { SupplyerID: supid }, function (responce) {
					$('.inv1').show();
					$("#inv").html(respnse);
					@*$("#inv").load('@Url.Action("MyNonpaindIVN")');*@
					return false
				});
			});
		});
	</script>
}


Partial View

@model IEnumerable<WorkingPlace.Models.PerchesTransaction>
@{
	Layout = null;
}

<div>
	<div class="panel-heading">
		<h3 class="panel-title">Search Results</h3>
	</div>
	<table>
		<tr>
			<td>Invoice No   :</td>
			<td>Invoice Date : </td>
			<td>Invoice Amount : </td>
			<td>Balance Amount : </td>
			<td></td>
			<td></td>
		</tr>
		@foreach (var item in Model)
		{
			<tr>
				<td id="InvoiceNo">
					@Html.DisplayFor(modelItem => item.InvoiceNo )
				</td>
				<td id="InvoiceDate">
					@Html.DisplayFor(modelItem =>item.InvoiceDate)
				</td>
				<td id="TotalAmount">
					@Html.DisplayFor(modelItem=>item.TotalAmount)
				</td>
				<td id="BalAmount">
					@Html.DisplayFor(modelItem=>item.BalAmount)
				</td>
				<td id="Pay">
					<input type="submit" id="Pay" class="pay1" value="Pay Bill"/>
				</td>
				<td>
					<input type="submit" id="cancel"class="cancel1"value="Cancel Payment"/>
				</td>
			</tr>
		}
	</table>
	<table>
		<tr class="pull-right">

			<td class="pull-right">
				Total payment
			</td>
		</tr>
	</table>
</div>


controller
public ActionResult PerPAYment(Supplyer ssp)
      {
          Supplyer model = new Supplyer
          {
              SupplyerID = ssp.SupplyerID,

              GetSupplyers_S = dc.Supplyers.ToList(),
              InfoMenu = dc.PerchesTransactions.ToList()
           };
          return View(model);
      }

      public PartialViewResult GetUNPAID(int SupplyerID)
      {
          var z = 0.00m;

          //List<PerchesTransaction> ptr = dc.PerchesTransactions.Where(p => p.SupplyerId == SupplyerID && p.TotalAmount >= z).ToList();

          Supplyer ptr = new Supplyer
          {
              InfoMenu=dc.PerchesTransactions.Where(p => p.SupplyerId == SupplyerID && p.TotalAmount >= z).ToList()
          };
          ViewData["MyNonpaindIVN"]= "MyNonpaindIVN";
          return PartialView("MyNonpaindIVN" , ptr );
      }
Posted
Updated 23-Mar-19 18:10pm
v3
Comments
[no name] 24-Mar-19 11:37am    
You try it first with "small bits of code". You now have a lot of "extras", not related to the problem, that other have to wade through and decide if its relevant. Not happening.
sayli1995 24-Mar-19 23:44pm    
Thanks sir , now it's my Starting of programming this is my collage project ,
Richard Deeming 26-Mar-19 16:40pm    
Note: A perch[^] (plural: perches) is a type of fish, or something a bird sits on. I suspect you mean purchase[^].

Also, collage[^] is a type of picture; the place you go to learn things is a college[^].

This concludes episode 497 of "English is a ludicrously over-complicated language". :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900