public BaseVm GetPaymentStatus() { var model = new BaseVm(); var userId = HttpContext.Current.User.Identity.GetUserId(); var checkMember = _db.ActiveMember.AsNoTracking() .FirstOrDefault(x => x.ActiveMemberId == userId); if (checkMember != null) { int memReg = Convert.ToInt32(PaymentType.MembershipRegistration); int monDues = Convert.ToInt32(PaymentType.MonthlyDues); var memberFee = _db.MembershipFee.Where(x => x.ActiveMemberId == checkMember.ActiveMemberId && x.Status == true && x.FeeCategory == PaymentType.MembershipRegistration) .ToList(); var monthDues = _db.MembershipFee.Where(x => x.ActiveMemberId == checkMember.ActiveMemberId && x.Status == true && x.FeeCategory == PaymentType.MonthlyDues) .ToList(); } return(model); }
public ActionResult Detail(int id) { BaseVm <DocumentDomain> vm = new BaseVm <DocumentDomain> { _Document = DocumentService.GetDocumentById(id) }; return(View(vm)); }
// GET: /<controller>/ public IActionResult Index() { var model = new BaseVm { Title = "Application Setup" }; return(View(model)); }
public AddTest(BaseVm parent, string code, string gold) { _selectedNode = parent; _code = code; _gold = gold; InitializeComponent(); _testPath = MakeDefaultTestPath(); _testName.Text = Path.GetFileNameWithoutExtension(_testPath); }
public void CurrentVmIsNotUpdatedIfNoTextSelected() { GlobalContext ctx = CreateGlobalCtx(); MainController sut = CreateSUT(ctx, ""); BaseVm prevVm = ctx.CurrentVm; sut.OnMagicCombinationPressed().Wait(); Assert.That(ctx.CurrentVm, Is.EqualTo(prevVm)); }
public static bool IsValidationVm(BaseVm viewModel) { var properties = viewModel.GetType().GetProperties(); return((from property in properties let dataType = property.PropertyType.Name where AppConsts.StringDataTypeName == dataType.ToLower() select(string) property.GetValue(viewModel)) .All(IsValidationInput)); }
protected override void OnSetParentVm(BaseVm parentVm) { base.OnSetParentVm(parentVm); var group = this.DashboardVm.ObtainFilterGroup(this.Widget); if (group != null) { group.PropertyChanged += FilterGroup_PropertyChanged; } this.ApplyAsync(false).GetAwaiter().GetResult(); }
public ActionResult Map(int id) { BaseVm <MapDomain> vm = new BaseVm <MapDomain> { _Document = MapService.GetMapByDocumentId(id) }; if (vm._Document == null || vm._Document.TypeId != Enums.DocumentType.Map) { // If not a valid map, redirect to document detail page. return(RedirectToAction("Detail", "Home", new RouteValueDictionary(new { Id = id }))); } return(View(vm)); }
/// <summary> /// The init window. /// </summary> /// <param name="vm"> /// The vm. /// </param> /// <param name="title"> /// The title. /// </param> /// <param name="width"> /// The width. /// </param> /// <param name="height"> /// The height. /// </param> /// <param name="left"> /// The left. /// </param> /// <param name="top"> /// The top. /// </param> /// <param name="minHeight"> /// The min height. /// </param> /// <param name="minWidth"> /// The min width. /// </param> /// <param name="startupLocation"> /// The startup location. /// </param> /// <param name="maxHeigh"> /// The max heigh. /// </param> /// <param name="maxWidth"> /// The max width. /// </param> /// <param name="resizeMode"> /// The resize Mode. /// </param> /// <param name="removeWindowButtons"> /// The remove Window Buttons. /// </param> /// <returns> /// The <see cref="Window"/>. /// </returns> private static Window InitWindow( BaseVm vm, string title, double?width, double?height, double?left, double?top, double?minHeight, double?minWidth, WindowStartupLocation?startupLocation, double?maxHeigh, double?maxWidth, ResizeMode?resizeMode) { var window = new Window(); if (!string.IsNullOrEmpty(title)) { window.Title = title; } window.Content = vm; window.Closing += vm.OnClosing; if (width.HasValue) { window.Width = width.Value; } if (height.HasValue) { window.Height = height.Value; } if (left.HasValue) { window.Left = left.Value; } if (top.HasValue) { window.Top = top.Value; } if (minHeight.HasValue) { window.MinHeight = minHeight.Value; } if (minWidth.HasValue) { window.MinWidth = minWidth.Value; } if (startupLocation.HasValue) { window.WindowStartupLocation = startupLocation.Value; } if (maxHeigh.HasValue) { window.MaxHeight = maxHeigh.Value; } if (maxWidth.HasValue) { window.MaxWidth = maxWidth.Value; } if (resizeMode.HasValue) { window.ResizeMode = resizeMode.Value; } return(window); }
protected void SetAuditInfo <T>(BaseVm <T> baseVm) { baseVm.CreatorUserId = CurrentUserId; }