This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function updateClock() { | |
var currentTime = new Date(); | |
var currentHours = currentTime.getHours(); | |
var currentMinutes = currentTime.getMinutes(); | |
var currentSeconds = currentTime.getSeconds(); | |
// Pad the minutes and seconds with leading zeros, if required | |
currentMinutes = (currentMinutes < 10 ? "0" : "") + currentMinutes; | |
currentSeconds = (currentSeconds < 10 ? "0" : "") + currentSeconds; | |
// Choose either "AM" or "PM" as appropriate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyCustomEngine : RazorViewEngine | |
{ | |
public MyCustomEngine() | |
{ | |
base.AreaViewLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.cshtml" }; | |
base.AreaMasterLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.cshtml" }; | |
base.AreaPartialViewLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.cshtml" }; | |
base.ViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml" }; | |
base.MasterLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml" }; | |
base.PartialViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml" }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Clearing all the View Engines | |
ViewEngines.Engines.Clear(); | |
//Adding Razor View Engine to our application | |
ViewEngines.Engines.Add(new RazorViewEngine()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EmployeeData | |
{ | |
public int EmpId { get; set; } | |
public string EmpName { get; set; } | |
public DateTime DOB { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IEmployee | |
{ | |
List<EmployeeData> GetAllEmployees(); | |
EmployeeData GetEmployeeById(int EmpId); | |
bool InsertEmployee(EmployeeData emp); | |
bool UpdateEmployee(EmployeeData emp); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static IUnityContainer BuildUnityContainer() | |
{ | |
var container = new UnityContainer(); | |
container.RegisterType<IEmployee, Employee>(); | |
RegisterTypes(container); | |
return container; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_Start() | |
{ | |
AreaRegistration.RegisterAllAreas(); | |
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); | |
RouteConfig.RegisterRoutes(RouteTable.Routes); | |
BundleConfig.RegisterBundles(BundleTable.Bundles); | |
UnityDependency.Initialise(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IEmployee employee; | |
public EmployeeController(IEmployee employee) | |
{ | |
this.employee = employee; | |
} | |
public ActionResult Index() | |
{ | |
return View(employee.GetAllEmployees()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IEmployee _employee; | |
public IEmployee EmployeeDI | |
{ | |
get { return _employee; } | |
set { _employee = value; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IEmployee employee; | |
public EmployeeController(IEmployee employee) | |
{ | |
this.employee = employee; | |
} |