Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using Silog.AGIWEB.Areas.Gescom.Models.Achat
- @using Silog.AGIWEB.Areas.Gescom.Models.Shared
- @{
- //http://demos.telerik.com/kendo-ui/styling/index# txtbox with button search
- TypeDocument typeDocument = TypeDocument.AppelOffre;
- if (ViewData["_typeDocument"] != null)
- {
- typeDocument = (TypeDocument)ViewData["_typeDocument"];
- }
- int? numero = null;
- if (ViewData["_numero"] != null)
- {
- numero = (int?)ViewData["_numero"];
- }
- bool _visible = false;
- if (ViewData["_visible"] != null)
- {
- _visible = (bool)ViewData["_visible"];
- }
- string windowName = "report-window";
- if (numero == null)
- {
- windowName += "-Achat" + typeDocument.ToString();
- }
- }
- <div>
- <script>
- function onActivatePrintWindow() {
- kendo.resize($("#splitterPrint"));
- }
- function onCommitReport_Click(e) {
- $("#report-content").empty();
- var std = ($("#tabsReport").select().index() == 0) ? true : false;
- var file = (std) ? $('#listStandard option:selected').val() : $('#listUser option:selected').val();
- var url = '@Url.Action("Report", "Vente", new { type = "_type_", standard="_std_", item="_file_", numero = numero })'.replace("_type_", "@typeDocument").replace("_std_", std).replace("_file_", file);
- var iframe = $('<iframe src="' + url + '" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%">');
- iframe.appendTo('#report-content');
- }
- function onCancelReport_Click(e) {
- $("#@windowName").data("kendoWindow").close();
- }
- function onCloseReport() {
- //$("#report-window-content").empty();
- }
- </script>
- @(Html.Kendo().Window()
- .Name(windowName)
- //.HtmlAttributes( new { id = "window-" + _line.ToString() } )
- .Title("Print")
- .Content(@<text>@RenderPrintSplitter(typeDocument, numero)</text>)
- .Visible(_visible)
- .Width(1366)
- //.Actions(actions => actions.Pin().Minimize().Maximize().Close())
- //.Events(ev => ev.Close("onCloseReport"))
- .Events(ev => ev.Activate("onActivatePrintWindow"))
- .Modal(true)
- )
- </div>
- @helper RenderPrintSplitter(TypeDocument typeDocument, int? numero)
- {
- @(Html.Kendo().Splitter()
- .Name("SplitterReport")
- .HtmlAttributes(new { style = "height: 800px;" })
- .Orientation(SplitterOrientation.Horizontal)
- .Panes(horizontalPanes =>
- {
- horizontalPanes.Add()
- .HtmlAttributes(new { id = "left-print-pane" })
- .Size("450px")
- //.Scrollable(false)
- .Collapsible(true)
- .Collapsed(false)
- .Content(@<text>@RenderPrintFilter(typeDocument, numero)</text>);
- horizontalPanes.Add()
- .HtmlAttributes(new { id = "right-print-pane" })
- //.Size("800px")
- //.Collapsible(true)
- //.Collapsed(true)
- .Content(@<text><div id="report-content" style="height:99%"></div></text>);
- })
- )
- }
- @helper RenderPrintFilter(TypeDocument typeDocument, int? numero)
- {
- List<SelectListItem> listStand = new List<SelectListItem>();
- List<SelectListItem> listUser = new List<SelectListItem>();
- switch (typeDocument)
- {
- case TypeDocument.AppelOffre:
- //listStand.Add(new SelectListItem() { Text = "Appel d'offre Client V1.1", Value = "Appel d'offre Client V1.1.rpt" });
- break;
- case TypeDocument.Devis:
- //listStand.Add(new SelectListItem() { Text = "Devis Complet V1.1", Value = "Devis Complet V1.1.rpt" });
- break;
- case TypeDocument.CommandeOuverte:
- break;
- case TypeDocument.Commande:
- //listStand.Add(new SelectListItem() { Text = "Commande V6.2", Value = "Commande V6.2.rpt" });
- break;
- case TypeDocument.BonLivraison:
- //listStand.Add(new SelectListItem() { Text = "Bon Livraison V1.2", Value = "Bon Livraison V1.2.rpt" });
- break;
- case TypeDocument.Facture:
- break;
- case TypeDocument.FactureProforma:
- break;
- default:
- break;
- }
- <table border="1" style="margin-left:auto; margin-right:auto;">
- <tr>
- <td>
- <table>
- @if (numero == null)
- {
- <tr>
- <td>@Html.Label("Date Debut")</td>
- <td>@Html.Kendo().DatePicker().Name("DateDebut").HtmlAttributes(new { style = "width:200px" }).Value(DateTime.Now)</td>
- </tr>
- <tr>
- <td>@Html.Label("Date Fin")</td>
- <td>@Html.Kendo().DatePicker().Name("DateFin").HtmlAttributes(new { style = "width:200px" }).Value(DateTime.Now)</td>
- </tr>
- <tr>
- <td>@Html.Label(@Resources.Resource.Fournisseur)</td>
- <td>@Html.Kendo().TextBox().Name("Fournisseur").HtmlAttributes(new { id = "fournisseur-print", style = "width:200px" })</td>
- </tr>
- }
- <tr>
- <td>@Html.Label(@Resources.Resource.Document)</td>
- <td>@Html.Kendo().TextBox().Name("Document").Value((numero.HasValue) ? numero.ToString() : null).HtmlAttributes(new { id = "document-print", style = "width:200px" }).Enable((numero == null))</td>
- </tr>
- <tr>
- <td>@Html.Label("Editer Document")</td>
- <td>
- @(Html.Kendo().ComboBox().Name("EditerDocument")
- .HtmlAttributes(new { id = "document-edit", style = "width:200px" })
- .BindTo(new List<SelectListItem>() { new SelectListItem() { Value = "0", Text = "Non édités" }, new SelectListItem() { Value = "1", Text = "Tous" }, new SelectListItem() { Value = "2", Text = "déjà édités" } })
- .SelectedIndex(1)
- )
- </td>
- </tr>
- <tr>
- <td>@Html.Label("Nombre de copies")</td>
- <td>@Html.Kendo().TextBox().Name("NombreCopies").HtmlAttributes(new { style = "width:50px" }).Value("1")</td>
- </tr>
- <tr>
- <td>@Html.Label("Destination")</td>
- <td>
- @(Html.Kendo().ComboBox().Name("DestinationImpression")
- .HtmlAttributes(new { id = "destination-print", style = "width:200px" })
- .BindTo(new List<SelectListItem>() { new SelectListItem() { Value = "0", Text = "Ecran" }, new SelectListItem() { Value = "1", Text = "Imprimante" } })
- .SelectedIndex(0)
- )
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr style="height:20px"></tr>
- <tr>
- <td>@RenderPrintTabs(listStand, listUser)</td>
- </tr>
- <tr style="height:20px"></tr>
- <tr>
- <td>
- <div style="text-align:right">
- <span class="inlineinput">
- @(Html.Kendo().Button()
- .Name("commit-report")
- .HtmlAttributes(new { type = "button", style = "width:100px;" })
- .Content("Valider F2")
- .Events(ev => ev.Click("onCommitReport_Click"))
- )
- </span>
- <span class="inlineinput">
- @(Html.Kendo().Button()
- .Name("cancel-report")
- .HtmlAttributes(new { type = "button", style = "width:100px;" })
- .Content("Annuler Ech")
- .Events(ev => ev.Click("onCancelReport_Click"))
- )
- </span>
- </div>
- </td>
- </tr>
- </table>
- }
- @helper RenderPrintTabs(List<SelectListItem> stand, List<SelectListItem> user)
- {
- <text>
- @(Html.Kendo().TabStrip()
- .Name("tabsReport")
- .HtmlAttributes(new { style = "height:350px;" })
- .Items(tabstrip =>
- {
- tabstrip.Add().Text("Standards")
- .Selected(true)
- .Content(@<text>
- @Html.ListBox("listStandard", stand, new { style = "width:100%; height:295px;" })
- </text>);
- tabstrip.Add().Text("Utilisateurs")
- .Content(@<text>
- @Html.ListBox("listUser", user, new { style = "width:100%; height:295px;" })
- </text>);
- })
- )
- </text>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement