public appusersWS LogIn(string userName, string password) { //Valida Nombre de usuario y contrasena appusersWS _appusersWS = entities.appusersWS.FirstOrDefault(e => e.username == userName); appusersWS _appusersWSResult = new appusersWS(); _appusersWSResult.MensajeErrorLogIn = string.Empty; if (_appusersWS == null) { _appusersWSResult.MensajeErrorLogIn = "******"; return _appusersWSResult; } if (_appusersWS.password != password) { _appusersWSResult.MensajeErrorLogIn = "******"; return _appusersWSResult; } if (_appusersWS.isApproved == 0) { _appusersWSResult.MensajeErrorLogIn = string.Format("El usuario {0} no está activado", userName); return _appusersWSResult; } if (_appusersWS.isLockedOut == 1) { _appusersWSResult.MensajeErrorLogIn = string.Format("El usuario {0} se encuentra bloqueado", userName); return _appusersWSResult; } return _appusersWSResult; }
public appusersWS Edit(appusersWS model) { entities.appusersWS.Attach(model); entities.ObjectStateManager.ChangeObjectState(model, EntityState.Modified); this.Commit(); return model; }
/// <summary> /// Deprecated Method for adding a new object to the appusersWS EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToappusersWS(appusersWS appusersWS) { base.AddObject("appusersWS", appusersWS); }
public appusersWS Create(appusersWS model) { entities.appusersWS.AddObject(model); this.Commit(); return model; }
/// <summary> /// Create a new appusersWS object. /// </summary> /// <param name="username">Initial value of the username property.</param> /// <param name="password">Initial value of the password property.</param> /// <param name="isApproved">Initial value of the isApproved property.</param> /// <param name="isLockedOut">Initial value of the isLockedOut property.</param> public static appusersWS CreateappusersWS(global::System.String username, global::System.String password, global::System.Byte isApproved, global::System.Byte isLockedOut) { appusersWS appusersWS = new appusersWS(); appusersWS.username = username; appusersWS.password = password; appusersWS.isApproved = isApproved; appusersWS.isLockedOut = isLockedOut; return appusersWS; }