private void GetMandants() { try { WaitIndicatorVisible = true; var user = WMSEnvironment.Instance.AuthenticatedUser; Mandants.Clear(); if (user == null) { return; } using (var mgr = IoC.Instance.Resolve <IBaseManager <User2Mandant> >()) { var res = mgr.GetFiltered(string.Format("USERCODE_R = '{0}'", WMSEnvironment.Instance.AuthenticatedUser.GetSignature())).ToArray(); if (!res.Any()) { return; } Array.Sort(res, (x, y) => string.Compare(x.MandantCode, y.MandantCode, StringComparison.Ordinal)); Mandants.AddRange(res); } } finally { WaitIndicatorVisible = false; } }
private void LoadMandants() { if (Commons.Statics.CurrentLogin.IsDevLogin) { Mandants = _db.LoadMandants(); } else { Mandants.Clear(); Mandants.Add(Commons.Statics.CurrentLogin.Mandant); // TODO: Childmandanten anzeigen } }
protected override void Dispose(bool disposing) { if (Mandants != null) { Mandants.Clear(); } if (Fields != null) { Fields.Clear(); } SelectedMandant = null; base.Dispose(disposing); }