public PageOne(SharedViewModel viewModel, IWizardControl wizardControl) { InitializeComponent(); ViewModel = viewModel; _wizardControl = wizardControl; }
// GET: Shared public ActionResult SharedMVCInnerRendering() { var model = new SharedViewModel { Year = Sitecore.DateUtil.ToServerTime(DateTime.UtcNow).Year, }; return(View(model)); }
// GET: Shared public ActionResult _Layout() { SharedViewModel model = new SharedViewModel { companyName = "asdasd" }; return(PartialView("asdsa")); }
public ActionResult ManageAppointment(SharedViewModel mod) { SharedViewModel vm = new SharedViewModel(); if (_appoDal.AddNewAppointment(mod.Appointment.TranslateAppointmentModel())) { vm.Appointments = _appoDal.GetAllAppointments().TranslateAppointmentDEList(); } return(RedirectToAction("ManageAppointment")); }
// GET: MainPage public ActionResult Shares() { SharedViewModel model = new SharedViewModel(); model.UserList = db.Users.ToList(); model.SharedList = db.ShareModels.ToList(); model.UploadMultiList = db.UploadMultiFiles.ToList(); model.CommentList = db.Comments.ToList(); return(View(model)); }
public void NamespaceConventions_ViewModel_OneToMany_View_Test() { // Arrange var viewModel = new SharedViewModel(); // Act var view = _viewLocator.LocateForModel(viewModel, "ViewA", false); // Assert // Assert Assert.NotNull(view); Assert.IsType <ViewA>(view); }
public ActionResult ManageAppointment(string ID, string DBOperation) { SharedViewModel vm = new SharedViewModel(); //vm.Appointments = _appoDal.GetAllAppointments().TranslateAppointmentDEList(); vm.LookUp = _appoDal.GetAllPropertyTypes().TranslateLookUpModel().ToList(); if (DBOperation == "EDIT") { int id = Convert.ToInt32(ID); vm.Appointment = _appoDal.GetAppointmentById(id).TranslateAppointmentDE(); vm.Appointment.ConfirmEmail = vm.Appointment.Email; } return(View(vm)); }
public ActionResult PartialViewLookup(string ID, string DBOperation = "") { SharedViewModel vm = new SharedViewModel(); vm.Appointments = _appoDal.GetAllAppointments().TranslateAppointmentDEList(); if (!string.IsNullOrWhiteSpace(DBOperation)) { if (DBOperation == "DELETE") { int id = Convert.ToInt32(ID); if (_appoDal.DeleteAppointment(id)) { vm.Appointments = _appoDal.GetAllAppointments().TranslateAppointmentDEList(); } } } return(PartialView(vm)); }
protected void SetModel(SharedViewModel viewmodel) { base.SetModel(viewmodel); SharedModel model = Utility.BlogBll.GetBlogSharedData(this.Info.blogID + ""); viewmodel.SitemapUrl = Info.BaseUrl + "/sitemap.xml"; viewmodel.BlogUrl = this.Info.BaseUrl; viewmodel.TotalArticleCount = model.TotalArticleCount; viewmodel.TotalArticleViewCount = model.TotalArticleViewCount; viewmodel.TotalArticleCommentCount = model.TotalArticleCommentCount; viewmodel.Menus = model.Menus; if (viewmodel.Menus.Count() > 0) { viewmodel.Menus.First().IsActive = true; } viewmodel.Links = model.Links; }
public IActionResult Login(string email, string password) { if (email == null || password == null) { ViewData["login_error"] = "Fill in User and Password"; return(View()); } Employee user = dbcontext.employees.Where(x => x.Email == email).FirstOrDefault(); using (MD5 md5Hash = MD5.Create()) { string hashPwd = MD5Hash.GetMd5Hash(md5Hash, password); if (user == null || user.Password != hashPwd) { ViewData["login_error"] = "User not found/Password Incorrect"; return(View()); } } ViewData["userId"] = user.Id; HttpContext.Session.SetString("userId", user.Id); HttpContext.Session.SetString("Department", user.DepartmentsId); SharedViewModel sm = new SharedViewModel() { Name = user.Name }; if (user.Role == Role.DEPT_HEAD || user.Role == Role.DEPT_REP || user.Role == Role.EMPLOYEE) { /*return RedirectToAction("viewCatalogue", "Department");*/ return(RedirectToAction("Home", "Department")); } if (user.Role == Role.STORE_MANAGER || user.Role == Role.STORE_SUPERVISOR) { return(RedirectToAction("HomeManagerSupervisor", "StationeryStore")); } if (user.Role == Role.STORE_CLERK) { return(RedirectToAction("Home", "StationeryStore", new { userid = user.Id })); } else { return(RedirectToAction("Home", "StationeryStore", new { userid = user.Id })); } }
public MainWindowViewModel(IWizardControl wizard) { Title = "Create Supplier"; SharedViewModel = new SharedViewModel(wizard); CompletePage = new CompletePageView(SharedViewModel); ErrorPage = new ErrorPage(SharedViewModel); ProcessPage = new ProcessingPage(SharedViewModel); Pages = new ObservableCollection <IWizardPage>() { new PageOne(SharedViewModel, wizard), new PageTwo() { ViewModel = SharedViewModel, }, new PageThree() { ViewModel = SharedViewModel, }, }; }
public ActionResult PartialViewLookUp(SharedViewModel mod) { SharedViewModel vm = new SharedViewModel(); return(RedirectToAction("ManageAppointment")); }
public CompletePageView(SharedViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; }
ViewModelContainer() { SharedViewModel = new SharedViewModel(); }
public ProcessingPage(SharedViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; }
public ErrorPage(SharedViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; }