Faktura už vybírá zákazníka
parent
a1a4512a5a
commit
ed5fbe6e26
Binary file not shown.
Binary file not shown.
|
|
@ -14,6 +14,8 @@ namespace RazorPagesMovie.Models
|
|||
public int ID { get; set; }
|
||||
|
||||
[Required]
|
||||
[DisplayName("Zákazník")]
|
||||
[Range(1, Int32.MaxValue, ErrorMessage = "Vyberte zákazníka ze seznamu")]
|
||||
public int ZakaznikID { get; set; }
|
||||
|
||||
public ZAKAZNIK ZAKAZNIK { get; set; }
|
||||
|
|
@ -22,50 +24,71 @@ namespace RazorPagesMovie.Models
|
|||
|
||||
public ICollection<PLATBA> PLATBY { get; set; }
|
||||
|
||||
[DisplayName("Číslo")]
|
||||
public string CISLO { get; set; }
|
||||
|
||||
public int CISLO_ABS { get; set; }
|
||||
|
||||
[DataType(DataType.Date)]
|
||||
[DisplayName("Datum vystavení")]
|
||||
public DateTime VYSTAVENI { get; set; }
|
||||
|
||||
[DataType(DataType.Date)]
|
||||
[DisplayName("Datum splatnosti")]
|
||||
public DateTime SPLATNOST { get; set; }
|
||||
|
||||
[DisplayName("Dodavatel")]
|
||||
public string D_PRAJM { get; set; }
|
||||
|
||||
[DisplayName("Ulice")]
|
||||
public string D_ULICE { get; set; }
|
||||
|
||||
[DisplayName("Město")]
|
||||
public string D_MESTO { get; set; }
|
||||
|
||||
[DisplayName("PSČ")]
|
||||
public string D_PSC { get; set; }
|
||||
|
||||
[DisplayName("IČ")]
|
||||
public string D_IC { get; set; }
|
||||
|
||||
[DisplayName("DIČ")]
|
||||
public string D_DIC { get; set; }
|
||||
|
||||
[DisplayName("Bankovní účet")]
|
||||
public string D_BANKA { get; set; }
|
||||
|
||||
[DisplayName("Telefon")]
|
||||
public string D_TELEFON { get; set; }
|
||||
|
||||
[DisplayName("E-mail")]
|
||||
public string D_EMAIL { get; set; }
|
||||
|
||||
[DisplayName("Web")]
|
||||
public string D_WEB { get; set; }
|
||||
|
||||
[DisplayName("Odběratel")]
|
||||
public string O_PRAJM { get; set; }
|
||||
|
||||
[DisplayName("Ulice")]
|
||||
public string O_ULICE { get; set; }
|
||||
|
||||
[DisplayName("Město")]
|
||||
public string O_MESTO { get; set; }
|
||||
|
||||
[DisplayName("PSČ")]
|
||||
public string O_PSC { get; set; }
|
||||
|
||||
[DisplayName("IČ")]
|
||||
public string O_IC { get; set; }
|
||||
|
||||
[DisplayName("DIČ")]
|
||||
public string O_DIC { get; set; }
|
||||
|
||||
[DisplayName("Forma úhrady")]
|
||||
public byte FORMA_UHRADY { get; set; }
|
||||
|
||||
[DisplayName("Popis činností")]
|
||||
public string CINNOSTI { get; set; }
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,13 @@ namespace RazorPagesMovie.Models
|
|||
|
||||
new ZAKAZNIK
|
||||
{
|
||||
JMENO = "Kowalski 5",
|
||||
PRIJMENI = "Don"
|
||||
JMENO = "Petr",
|
||||
PRIJMENI = "Zajíc",
|
||||
ULICE = "Větrná 622",
|
||||
MESTO = "Stráž nad Nisou",
|
||||
PSC = "46330",
|
||||
IC="12345678",
|
||||
DIC="2255881054"
|
||||
},
|
||||
|
||||
new ZAKAZNIK
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@
|
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group col-md-8">
|
||||
<label asp-for="FAKTURA.ZakaznikID" class="control-label"></label>
|
||||
<select id="fakturaZakaznikSelect" asp-for="FAKTURA.ZakaznikID" class="form-select" asp-items="ViewBag.Zakaznici"></select>
|
||||
<select id="fakturaZakaznikSelect" asp-for="FAKTURA.ZakaznikID" class="form-select" asp-items="ViewBag.Zakaznici">
|
||||
<option value="-1" selected>(vyberte zákazníka)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
|
|
@ -137,37 +139,37 @@
|
|||
|
||||
<div class="form-group col-md-4">
|
||||
<label asp-for="FAKTURA.O_PRAJM" class="control-label"></label>
|
||||
<input asp-for="FAKTURA.O_PRAJM" class="form-control" />
|
||||
<input id="OdberatelPrajmInput" asp-for="FAKTURA.O_PRAJM" class="form-control" />
|
||||
<span asp-validation-for="FAKTURA.O_PRAJM" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label asp-for="FAKTURA.O_ULICE" class="control-label"></label>
|
||||
<input asp-for="FAKTURA.O_ULICE" class="form-control" />
|
||||
<input id="OdberatelUliceInput" asp-for="FAKTURA.O_ULICE" class="form-control" />
|
||||
<span asp-validation-for="FAKTURA.O_ULICE" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label asp-for="FAKTURA.O_MESTO" class="control-label"></label>
|
||||
<input asp-for="FAKTURA.O_MESTO" class="form-control" />
|
||||
<input id="OdberatelMestoInput" asp-for="FAKTURA.O_MESTO" class="form-control" />
|
||||
<span asp-validation-for="FAKTURA.O_MESTO" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label asp-for="FAKTURA.O_PSC" class="control-label"></label>
|
||||
<input asp-for="FAKTURA.O_PSC" class="form-control" />
|
||||
<input id="OdberatelPSCInput" asp-for="FAKTURA.O_PSC" class="form-control" />
|
||||
<span asp-validation-for="FAKTURA.O_PSC" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label asp-for="FAKTURA.O_IC" class="control-label"></label>
|
||||
<input asp-for="FAKTURA.O_IC" class="form-control" />
|
||||
<input id="OdberatelICInput" asp-for="FAKTURA.O_IC" class="form-control" />
|
||||
<span asp-validation-for="FAKTURA.O_IC" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label asp-for="FAKTURA.O_DIC" class="control-label"></label>
|
||||
<input asp-for="FAKTURA.O_DIC" class="form-control" />
|
||||
<input id="OdberatelDICInput" asp-for="FAKTURA.O_DIC" class="form-control" />
|
||||
<span asp-validation-for="FAKTURA.O_DIC" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -203,22 +205,28 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
$("#fakturaZakaznikSelect").change(function () {
|
||||
//var id = $(this).find(':selected')[0].id;
|
||||
alert("Hello: ");
|
||||
//$.ajax({
|
||||
// type: "POST",
|
||||
// url: "/GetZakaznik",
|
||||
// data: { "name": "pokus" },
|
||||
// success: function (response) {
|
||||
// alert("Hello: " + response.Name + " .\nCurrent Date and Time: " + response.DateTime);
|
||||
// },
|
||||
// failure: function (response) {
|
||||
// alert(response.responseText);
|
||||
// },
|
||||
// error: function (response) {
|
||||
// alert(response.responseText);
|
||||
// }
|
||||
//});
|
||||
var id = $(this).find(':selected').val();
|
||||
//alert("Hello: " + id);
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "Create?handler=Zakaznik",
|
||||
data: {"ID": id},
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
$("#OdberatelPrajmInput").val(response[0].prajm);
|
||||
$("#OdberatelUliceInput").val(response[0].ulice);
|
||||
$("#OdberatelMestoInput").val(response[0].mesto);
|
||||
$("#OdberatelPSCInput").val(response[0].psc);
|
||||
$("#OdberatelICInput").val(response[0].ic);
|
||||
$("#OdberatelDICInput").val(response[0].dic);
|
||||
},
|
||||
failure: function (response) {
|
||||
alert(response.responseText);
|
||||
},
|
||||
error: function (response) {
|
||||
alert(response.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -48,10 +48,11 @@ namespace FakturyWeb.Pages.Faktury
|
|||
return RedirectToPage("./Index");
|
||||
}
|
||||
|
||||
public ActionResult GetZakaznik(string lastname)
|
||||
{
|
||||
|
||||
return Page();
|
||||
public ActionResult OnGetZakaznik(string id)
|
||||
{
|
||||
List<ZAKAZNIK> myZakaznik = _context.ZAKAZNIK.Where(fruit => fruit.ID == Convert.ToInt32(id)).ToList();
|
||||
return new JsonResult(myZakaznik);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue