本文整理汇总了C#中UserLogin类的典型用法代码示例。如果您正苦于以下问题:C# UserLogin类的具体用法?C# UserLogin怎么用?C# UserLogin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserLogin类属于命名空间,在下文中一共展示了UserLogin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load( object sender, EventArgs e )
{
if ( string.IsNullOrEmpty ( txtUserName.Text ) || string.IsNullOrEmpty ( txtPassword.Text ) )
{
UserLoginSection _userLoginSection = ( UserLoginSection ) ConfigurationManager.GetSection ( "userLoginGroup/userLogin" );
if ( _userLoginSection != null )
{
_configUser = new UserLogin () { Login = _userLoginSection.UserLogin, Password = _userLoginSection.UserPassword };
}
}
else
{
_configUser = new UserLogin () { Login = txtUserName.Text, Password = txtPassword.Text };
}
// Note: Add code to validate user name, password. This code is for illustrative purpose only.
// Do not use it in production environment.)
if ( IsAuthentic ( _configUser ) )
{
if ( Request.QueryString [ "ReturnUrl" ] != null )
{
FormsAuthentication.RedirectFromLoginPage ( _configUser.Login, false );
}
else
{
FormsAuthentication.SetAuthCookie ( _configUser.Login, false );
Response.Redirect ( "default.aspx" );
}
}
}
示例2: Setup
public void Setup() {
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
if (Directory.Exists(LoginEventStore.EventStorePath)) {
Directory.Delete(LoginEventStore.EventStorePath, true);
}
sut = new UserLogin();
}
示例3: Put
// PUT odata/UserLogin(5)
public virtual async Task<IHttpActionResult> Put([FromODataUri] string providerKey, UserLogin userLogin)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (providerKey != userLogin.ProviderKey)
{
return BadRequest();
}
try
{
await MainUnitOfWork.UpdateAsync(userLogin);
}
catch (DbUpdateConcurrencyException)
{
if (!MainUnitOfWork.Exists(providerKey))
{
return NotFound();
}
else
{
return Conflict();
}
}
return Ok(userLogin);
}
示例4: changeUsername_Click
protected void changeUsername_Click(object sender, EventArgs e)
{
Guid uid = new Guid(Session["UserID"].ToString());
UserLogin checkit = UserLogin_S.Loging(newUsername.Text);
if (checkit == null)
{
UserLogin newUser = new UserLogin();
newUser.UserName = newUsername.Text;
newUser.UserId = uid;
bool upd = UserLogin_S.ResetUsername(newUser);
if (upd == true)
{
green0.Text = "Updated";
Session["UserName"] = newUsername.Text;
username.Text = newUsername.Text;
}
else
{
green0.Text = "Something went wrong!";
}
valid.Text = "";
}
else
{
valid.Text = "Not-Available";
green0.Text = "";
}
}
示例5: BaseViewModel
protected BaseViewModel(IMessenger messenger, UserLogin userLogin)
{
Messenger = messenger;
Initialize();
if (UserLogin == null)
UserLogin = userLogin;
}
示例6: SetPasswordFromRest
/// <summary>
/// Sets the password from rest.
/// </summary>
/// <param name="value">The value.</param>
private void SetPasswordFromRest( UserLogin value )
{
UserLoginWithPlainTextPassword userLoginWithPlainTextPassword = null;
string json = string.Empty;
this.ActionContext.Request.Content.ReadAsStreamAsync().ContinueWith( a =>
{
// to allow PUT and POST to work with either UserLogin or UserLoginWithPlainTextPassword, read the the stream into a UserLoginWithPlainTextPassword record to see if that's what we got
a.Result.Position = 0;
StreamReader sr = new StreamReader( a.Result );
json = sr.ReadToEnd();
userLoginWithPlainTextPassword = JsonConvert.DeserializeObject( json, typeof( UserLoginWithPlainTextPassword ) ) as UserLoginWithPlainTextPassword;
} ).Wait();
if ( userLoginWithPlainTextPassword != null )
{
// if a UserLoginWithPlainTextPassword was posted, and PlainTextPassword was specified, encrypt it and set UserLogin.Password
if ( !string.IsNullOrWhiteSpace( userLoginWithPlainTextPassword.PlainTextPassword ) )
{
( this.Service as UserLoginService ).SetPassword( value, userLoginWithPlainTextPassword.PlainTextPassword );
}
}
else
{
// since REST doesn't serialize Password, get the existing Password from the database so that it doesn't get NULLed out
var existingUserLoginRecord = this.Get( value.Id );
if (existingUserLoginRecord != null)
{
value.Password = existingUserLoginRecord.Password;
}
}
}
示例7: resetPassword_Click
protected void resetPassword_Click(object sender, EventArgs e)
{
Guid uid = new Guid(Session["UserID"].ToString());
UserLogin checkit = UserLogin_S.NewLoging(username.Text, psHidOld.Value);
if (checkit != null)
{
UserLogin newPwdUser = new UserLogin();
newPwdUser.Password = psHid.Value;
newPwdUser.UserId = uid;
newPwdUser.PasswordStatus = "done";
bool upd = UserLogin_S.ResetPassword(newPwdUser);
if (upd == true)
{
green1.Text = "Updated";
}
else
{
green1.Text = "Something went wrong!";
}
pwdCheck.Text = "";
}
else
{
pwdCheck.Text = "Wrong-Password";
green1.Text = "";
}
}
示例8: ApollosUserLogin
public ApollosUserLogin( UserLogin userLogin )
{
Guid = userLogin.Guid;
Id = userLogin.Id;
PersonId = userLogin.PersonId;
ApollosHash = userLogin.Password;
UserName = userLogin.UserName;
}
示例9: LoginUser
public LoginUser()
{
_userLogin = new UserLogin();
_client.UserLoginCompleted += new EventHandler<UserLoginCompletedEventArgs>(_client_UserLoginCompleted);
_client.UserLoginOutCompleted += new EventHandler<UserLoginOutCompletedEventArgs>(_client_UserLoginOutCompleted);
_client.GetSystemTypeByUserIDCompleted += new EventHandler<GetSystemTypeByUserIDCompletedEventArgs>(_client_GetSystemTypeByUserIDCompleted);
}
示例10: IsAuthentic
private bool IsAuthentic( UserLogin userLogin )
{
if ( userLogin == null )
return false;
bool valid = _authenticatedUsers.Any ( u => ( u.Login == userLogin.Login && u.Password == userLogin.Password ) );
return valid;
}
示例11: FromIUserLogin
public static UserLogin FromIUserLogin(IUserLogin i)
{
UserLogin l = new UserLogin();
l.LoginProvider = i.LoginProvider;
l.ProviderDisplayName = i.ProviderDisplayName;
l.ProviderKey = i.ProviderKey;
l.SiteId = i.SiteId;
l.UserId = i.UserId;
return l;
}
示例12: Authenticate
/// <summary>
/// Authenticates the specified user name and password
/// </summary>
/// <param name="user">The user.</param>
/// <param name="password">The password.</param>
/// <returns></returns>
public override bool Authenticate( UserLogin user, string password )
{
string username = user.UserName;
if ( !String.IsNullOrWhiteSpace( GetAttributeValue( "Domain" ) ) )
username = string.Format( @"{0}\{1}", GetAttributeValue( "Domain" ), user.UserName );
var context = new PrincipalContext( ContextType.Domain, GetAttributeValue( "Server" ) );
using ( context )
{
return context.ValidateCredentials( user.UserName, password );
}
}
示例13: Login
public ActionResult Login(UserLogin model, string returnUrl) {
if (!ModelState.IsValid)
return ViewBase(DIALOG, "LoginForm", model);
//User user = userService.ValidateUser(model.UserName, model.Password);
//if (user != null) {
User user = new User {
Login = "qwe",
Name = "qwerwer"
};
SignInAsync(user, model.RememberMe);
return RedirectBase("Index", "Home");// ViewBase("#loginButtons", "_LoginPartial");
//}
ModelState.AddModelError("", "Неверное имя пользователя или пароль.");
return ViewBase("#dialogsContainer", "LoginForm", model);
}
示例14: calculatePrint
protected void calculatePrint(UserLogin userData)
{
try
{
UserMapping map = UserMapping_S.MapUser(userData.UserId);
if (map != null)
{
DateTime frDate = DateTime.ParseExact(fromDate.Value + ",000", "dd/MM/yyyy HH:mm:ss,fff",
System.Globalization.CultureInfo.InvariantCulture);
DateTime tDate = DateTime.ParseExact(toDate.Value + ",000", "dd/MM/yyyy HH:mm:ss,fff",
System.Globalization.CultureInfo.InvariantCulture);
if (frDate != null && tDate != null)
{
Utilities utFr = Utilitie_S.DateTimeToEpoch(frDate);
Utilities utTo = Utilitie_S.DateTimeToEpoch(tDate);
List<FetchingEnergy> energy = FetchingEnergy_s.fetchBillingData(utFr.Epoch, utTo.Epoch, map.MeterId, map.Apartment);
if (energy != null)
{
float en = energy[1].FwdHr - energy[0].FwdHr;
float untPrice = 3;
decimal bill = Convert.ToDecimal(en * untPrice);
bill = Math.Round(bill, 2);
fullName.InnerText = userData.FullName;
unitsConsumed.InnerText = (energy[1].FwdHr - energy[0].FwdHr).ToString();
address.InnerText = userData.Apartment;
mobile.InnerText = userData.Mobile;
meterNo.InnerText = map.Apartment + " - " + map.MeterId.ToString();
billPeriod.InnerText = frDate.ToString("dd-MMM-yyyy") + " - " + tDate.ToString("dd-MMM-yyyy");
unitRate.InnerText = untPrice.ToString() + " Rs/unit";
total.InnerText = bill.ToString();
billAmount.InnerHtml = "Bill Amount: Rs " + bill.ToString();
dueDate.InnerHtml = "Due Date: " + DateTime.Now.AddDays(15).ToString("dd-MMM-yyyy");
billNo.InnerText = "Rep " + meterNo.InnerText + " - " + DateTime.Today.ToString("dd-MMM-yyyy");
billDate.InnerText = DateTime.Now.ToString("dd-MMM-yyyy");
}
}
}
}
catch (Exception e)
{
}
}
示例15: lazyinit
private void lazyinit()
{
repositoy = new ServiceRepository();
IService entity = null;
entity = new GetUserInfo();
repositoy.storeServiceEntity(service_type.GET_USER_INFO, entity);
entity = new RegistUser();
repositoy.storeServiceEntity(service_type.REGIST_USER, entity);
entity = new UserLogin();
repositoy.storeServiceEntity(service_type.USER_LOGIN, entity);
entity = new DeleteTravelDiary();
repositoy.storeServiceEntity(service_type.DELETE_TRAVEL_DIARY, entity);
entity = new UpdateTravelDiary();
repositoy.storeServiceEntity(service_type.UPDATE_TRAVEL_DIARY, entity);
entity = new PublishTravelDiary();
repositoy.storeServiceEntity(service_type.PUBLISH_TRAVEL_DIARY, entity);
entity = new GetTravelDiariesList();
repositoy.storeServiceEntity(service_type.GET_TRAVEL_DIARYLIST, entity);
entity = new GetTravelDiaryDetailInfo();
repositoy.storeServiceEntity(service_type.GET_TRAVEL_DIARY_DETAIL, entity);
entity = new GetTravelComments();
repositoy.storeServiceEntity(service_type.GET_TRAVEL_COMMENT, entity);
entity = new GetAssociatedProductsInfo();
repositoy.storeServiceEntity(service_type.GET_ASSOCIATED_PRODUCT, entity);
entity = new GetCategory();
repositoy.storeServiceEntity(service_type.GET_DISPLAY_CATEGORY, entity);
entity = new CollectTravelDiary();
repositoy.storeServiceEntity(service_type.COLLECT_TRAVEL_DIARY, entity);
entity = new ReserveProduct();
repositoy.storeServiceEntity(service_type.RESERVE_PRODUCT, entity);
return;
}