Esempio n. 1
0
		public virtual PartialViewResult Client(long? clientId)
		{
			ViewData.TemplateInfo.HtmlFieldPrefix = "Authentication";

			if(!clientId.HasValue) return PartialView();

			var data = _clients.Get(clientId.Value);

			var model = new AuthenticationModel(data.Login);

			return PartialView(model);
		}
Esempio n. 2
0
		private void Update(
			long clientId, ClientEditData clientEditData,
			long transitId, TransitEditModel transit,
			long userId, AuthenticationModel authentication)
		{
			using(var ts = new TransactionScope())
			{
				_transits.Update(transitId, transit, null, null);

				_clients.Update(clientId, clientEditData);

				_users.SetLogin(userId, authentication.Login);

				if(!string.IsNullOrWhiteSpace(authentication.NewPassword))
				{
					_users.SetPassword(userId, authentication.NewPassword);
				}

				ts.Complete();
			}
		}