Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////BundleConfig.cs
- using System.Web;
- using System.Web.Optimization;
- namespace ResourcesApp1Web
- {
- public class BundleConfig
- {
- // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
- public static void RegisterBundles(BundleCollection bundles)
- {
- bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
- "~/Scripts/jquery-{version}.js"));
- bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
- "~/Scripts/jquery.validate*"));
- // Use the development version of Modernizr to develop with and learn from. Then, when you're
- // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
- bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
- "~/Scripts/modernizr-*"));
- /* bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
- "~/Scripts/bootstrap.js",
- "~/Scripts/respond.js"));*/
- bundles.Add(new ScriptBundle("~/bundles/spcontext").Include(
- "~/Scripts/spcontext.js"));
- bundles.Add(new ScriptBundle("~/bundles/dataTables").Include(
- "~/Scripts/jquery.dataTables.min.js"));
- bundles.Add(new ScriptBundle("~/bundles/metrojs").Include(
- "~/Scripts/metro.min.js"));
- bundles.Add(new StyleBundle("~/Content/css").Include(
- //"~/Content/bootstrap.css",
- "~/Content/site.css",
- "~/Content/metro-icons.min.css",
- "~/Content/metro.css"));
- }
- }
- }
- //////////////////////////////////////////////////////////CarListItems.cs
- using Microsoft.SharePoint.Client;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace ResourcesApp1Web.Models
- {
- public class CarListItems
- {
- public List<Car> GetAllItems(ClientContext clientContext)
- {
- clientContext.Load(clientContext.Web, l => l.Lists);
- clientContext.ExecuteQuery();
- List list = clientContext.Web.Lists.GetByTitle("CarsList");
- clientContext.Load(list);
- clientContext.ExecuteQuery();
- var items = list.GetItems(CamlQuery.CreateAllItemsQuery());
- clientContext.Load(items);
- clientContext.ExecuteQuery();
- List<Car> carItems = new List<Car>();
- foreach (var item in items)
- {
- carItems.Add(Car.GetCarItem(item.FieldValues));
- }
- return carItems;
- }
- }
- }
- //////////////////////////////////////////////////////////Car.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace ResourcesApp1Web.Models
- {
- public class Car
- {
- public int ID { get; set; }
- public string Brand { get; set; }
- public string Model { get; set; }
- public int passagerMaxNumber { get; set; }
- public string description { get; set; }
- public static Car GetCarItem(IDictionary<string, object> field){
- return new Car()
- {
- Brand = field["Title"].ToString(),
- ID = int.Parse(field["ID"].ToString()),
- Model = field["Model"].ToString(),
- passagerMaxNumber = int.Parse(field["PassengersMaxNumber"].ToString()),
- description = field["Description1"].ToString()
- };
- }
- }
- }
- /////////////////////////////////////////////////////////_Layout.cshtml
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>@ViewBag.Title - My ASP.NET Application</title>
- @Styles.Render("~/Content/css")
- @Scripts.Render("~/bundles/modernizr")
- </head>
- <body style="background-color:#ABE8FF;">
- <div class="flex-grid">
- <div class="row cells12">
- <div>
- <header class="app-bar fixed-top" data-role="appbar">
- <div class="container">
- <a href="https://scontent-fra3-1.xx.fbcdn.net/hphotos-xtf1/v/t1.0-9/p480x480/11402957_838547119571653_5763978918322691416_n.jpg?oh=9029987001af28205f0a2d024110b04e&oe=55E67D43" class="app-bar-element branding">
- <img src="~/Content/Images/icon-resources.png" style="height: 37px; display: inline-block; margin-right: 10px; margin-left:30px">
- Resources Manager
- </a>
- <ul class="app-bar-menu">
- <li style="margin-left:40px">@Html.ActionLink("Home", "Index", "Home")</li>
- <li>@Html.ActionLink("Users", "About", "Home")</li>
- <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
- </ul>
- </div>
- </header>
- </div>
- </div>
- <div class="row cells12">
- <div style="width:100%; overflow:hidden;background-size:cover;">
- <div class="baner-image"></div>
- <div class="page-content" style="width:80%;background-color:white; margin-left:10%;">
- @RenderBody()
- </div>
- <div class="bottom-menu-wrapper">
- <footer style="margin:auto;clear:both">
- <p style="margin-left:50px;">© @DateTime.Now.Year - Krzysztof Kiryłowicz Resource Management App</p>
- </footer>
- </div>
- </div>
- </div>
- </div>
- @Scripts.Render("~/bundles/jquery")
- @Scripts.Render("~/bundles/spcontext")
- @Scripts.Render("~/bundles/metrojs")
- @Scripts.Render("~/bundles/dataTables")
- @RenderSection("scripts", required: false)
- </body>
- </html>
- ////////////////////////////////////////////////////Index.cshtml
- @{
- ViewBag.Title = "Home Page";
- }
- <div style="width:100%;">
- <div style=" width:90%;margin-left:5%;margin-right:5%;">
- <div style="width:100%;height:95px">
- <div class="tile" style="width:40%;height:95px;margin-right:4%;margin-left:5%">
- <div class=" tile-content zooming">
- <div class="slide">
- <img src="~/Content/Images/auto-banner.png" />
- </div>
- </div>
- </div>
- <div class="tile" style="width:40%;height:95px;margin-right:5%;margin-left:4%">
- <div class=" tile-content zooming">
- <div class="slide">
- <img src="~/Content/Images/room-banner.png"/>
- </div>
- </div>
- </div>
- </div>
- <div style="width:100%;height:545px">
- <div style="width:40%;height:545px;display:inline-block;margin-right:4%;margin-left:5%">
- <table class="dataTable" data-role="datatable" data-searching="true">
- <thead>
- <tr>
- <th>Marka</th>
- <th>Model</th>
- <th>IlePas</th>
- </tr>
- </thead>
- <tbody class="events" style="height:10px;overflow-y:scroll;">
- @foreach (var item in Model.carsList)
- {
- <tr class="info">
- <td>
- @item.Brand
- </td>
- <td>
- @item.Model
- </td>
- <td>
- @item.passagerMaxNumber
- </td>
- </tr>
- }
- </tbody>
- </table>
- </div>
- <div style="width:40%;height:545px;display:inline-block;margin-right:5%;margin-left:4%">
- <table class="datatable" data-role="datatable" data-searching="true">
- <thead>
- <tr>
- <th>Numer</th>
- <th>Opis</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model.roomsList)
- {
- <tr class="info">
- <td>
- @item.Number;
- </td>
- <td>
- @item.Description;
- </td>
- </tr>
- }
- </tbody>
- </table>
- </div>
- </div>
- <div style="width:100%;height:95px;margin-top:50px">
- <div class="tile" style="width:40%;height:95px;margin-right:4%;margin-left:5%">
- <div class=" tile-content zooming">
- <div class="slide">
- <img src="http://i.imgur.com/EcVppuU.png" />
- </div>
- </div>
- </div>
- <div class="tile" style="width:40%;height:95px;margin-right:5%;margin-left:4%">
- <div class=" tile-content zooming">
- <div class="slide">
- <img src="http://i.imgur.com/EcVppuU.png" />
- </div>
- </div>
- </div>
- </div>
- <div style="width:100%;height:545px">
- <div style="width:40%;height:545px;display:inline-block;margin-right:4%;margin-left:5%">
- <table class="dataTable" data-role="datatable" data-searching="true">
- <thead>
- <tr>
- <th>Numer</th>
- <th>Wielkość</th>
- <th>Rodzaj</th>
- </tr>
- </thead>
- <tbody class="events" style="height:10px;overflow-y:scroll;">
- @foreach (var item in ViewBag.tablesList)
- {
- <tr class="info">
- <td>
- @item["Number"]
- </td>
- <td>
- @item["Size"]
- </td>
- <td>
- @try
- {
- foreach (Microsoft.SharePoint.Client.FieldLookupValue items in item["Type"] as Microsoft.SharePoint.Client.FieldLookupValue[])
- {
- @items.LookupValue
- }
- }
- catch (Exception)
- {
- }
- </td>
- </tr>
- }
- </tbody>
- </table>
- </div>
- <div style="width:40%;height:545px;display:inline-block;margin-right:5%;margin-left:4%">
- <table class="datatable" data-role="datatable" data-searching="true">
- <thead>
- <tr>
- <th>Numer</th>
- <th>Opis</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model.roomsList)
- {
- <tr class="info">
- <td>
- @item.Number;
- </td>
- <td>
- @item.Description;
- </td>
- </tr>
- }
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- @ViewBag.url
- <br/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement