Triển khai file xml dùng làm cơ sở dữ liệu trong website mvc
Triển khai file xml dùng làm cơ sở dữ liệu trong website mvc
1. Controller Home
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace websitexml.Controllers
{
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
return View();
}
public ActionResult MenuPartial()
{
return PartialView();
}
}
}
2. Index Home
@{
ViewBag.Title = "Index";
Layout = "~/Views/Layout/Layoutnguoidung.cshtml";
}
href="https://github.com/themeselection/sneat-html-admin-template-free"
data-icon="octicon-star"
data-size="large"
data-show-count="true"
aria-label="Star themeselection/sneat-html-
admin-template-free on GitHub">Star</a>
</li>
<a href="javascript:;"
class="btn btn-sm btn-outline-primary">View Badges</a>
</div>
</div>
<div class="col-sm-5 text-center text-
sm-left">
<div class="card-body pb-0 px-0 px-
md-4">
<img
src="~/Content/assets/img/illustrations/man-with-laptop-light.png"
height="140"
alt="View Badge User"
data-app-dark-
img="illustrations/man-with-laptop-dark.png"
data-app-light-
img="illustrations/man-with-laptop-light.png" />
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 order-1">
<div class="row">
<div class="col-lg-6 col-md-12 col-6 mb-4">
<div class="card">
<div class="card-body">
<div class="card-title d-flex
align-items-start justify-content-between">
<div class="avatar flex-
shrink-0">
<img
src="~/Content/assets/img/icons/unicons/chart-success.png"
alt="chart
success"
class="rounded" />
</div>
<div class="dropdown">
<button class="btn p-0"
type="button"
id="cardOpt3"
data-bs-
toggle="dropdown"
aria-
haspopup="true"
aria-
expanded="false">
<i class="bx bx-
dots-vertical-rounded"></i>
</button>
<div class="dropdown-
menu dropdown-menu-end" aria-labelledby="cardOpt3">
<a class="dropdown-
item" href="javascript:void(0);">View More</a>
<a class="dropdown-
item" href="javascript:void(0);">Delete</a>
</div>
</div>
</div>
<span class="fw-semibold d-
block mb-1">Profit</span>
<h3 class="card-title mb-
2">$12,628</h3>
<small class="text-success fw-
semibold"><i class="bx bx-up-arrow-alt"></i> +72.80%</small>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-6 mb-4">
<div class="card">
<div class="card-body">
<div class="card-title d-flex
align-items-start justify-content-between">
<div class="avatar flex-
shrink-0">
<img
src="~/Content/assets/img/icons/unicons/wallet-info.png"
alt="Credit Card"
class="rounded" />
</div>
<div class="dropdown">
<button class="btn p-0"
type="button"
id="cardOpt6"
data-bs-
toggle="dropdown"
aria-
haspopup="true"
aria-
expanded="false">
<i class="bx bx-
dots-vertical-rounded"></i>
</button>
<div class="dropdown-
menu dropdown-menu-end" aria-labelledby="cardOpt6">
<a class="dropdown-
item" href="javascript:void(0);">View More</a>
<a class="dropdown-
item" href="javascript:void(0);">Delete</a>
</div>
</div>
</div>
<span>Sales</span>
<h3 class="card-title text-
nowrap mb-1">$4,679</h3>
<small class="text-success fw-
semibold"><i class="bx bx-up-arrow-alt"></i> +28.42%</small>
</div>
</div>
</div>
</div>
</div>
<!-- Total Revenue -->
<div class="col-12 col-lg-8 order-2 order-md-3
order-lg-2 mb-4">
<div class="card">
<div class="row row-bordered g-0">
<div class="col-md-8">
<h5 class="card-header m-0 me-2 pb-
3">Total Revenue</h5>
<div id="totalRevenueChart"
class="px-2"></div>
</div>
<div class="col-md-4">
<div class="card-body">
<div class="text-center">
<div class="dropdown">
<button class="btn btn-
sm btn-outline-primary dropdown-toggle"
type="button"
id="growthReportId"
data-bs-
toggle="dropdown"
aria-
haspopup="true"
aria-
expanded="false">
2022
</button>
<div class="dropdown-
menu dropdown-menu-end" aria-labelledby="growthReportId">
<a class="dropdown-
item" href="javascript:void(0);">2021</a>
<a class="dropdown-
item" href="javascript:void(0);">2020</a>
<a class="dropdown-
item" href="javascript:void(0);">2019</a>
</div>
</div>
</div>
</div>
<div id="growthChart"></div>
<div class="text-center fw-semibold
pt-3 mb-2">62% Company Growth</div>
<a href="https://themeselection.com/demo/sneat-
bootstrap-html-admin-template/documentation/"
target="_blank"
class="footer-link me-4">Documentation</a>
<a
href="https://github.com/themeselection/sneat-html-admin-template-free/
issues"
target="_blank"
class="footer-link me-4">Hổtrợ</a>
</div>
</div>
</footer>
<!-- / Footer -->
@{
ViewBag.Title = "Index";
Layout = "~/Views/Layout/Layoutnguoidung.cshtml";
}
href="https://github.com/themeselection/sneat-html-admin-template-free"
data-icon="octicon-star"
data-size="large"
data-show-count="true"
aria-label="Star themeselection/sneat-html-
admin-template-free on GitHub">Star</a>
</li>
<a href="https://themeselection.com/demo/sneat-
bootstrap-html-admin-template/documentation/"
target="_blank"
class="footer-link me-4">Documentation</a>
<a
href="https://github.com/themeselection/sneat-html-admin-template-free/
issues"
target="_blank"
class="footer-link me-4">Support</a>
</div>
</div>
</footer>
<!-- / Footer -->