protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { if (Session["login"].Equals("") || Session["userLoggedIn"].Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { //Get Logged in data from LoginBO loginBO = (LoginBO)Session["login"]; UserBO userBO = (UserBO)Session["userLoggedIn"]; collectionlistGV.DataSource = bl.getCollectionList(); collectionlistGV.DataBind(); // deptName.Text = bl.getDepartmentName(loginBO.DepID); //Get the department Name int collectionPointID = (int)bl.getCollectionPoint(loginBO.DepID); //Get the collection point id and name by dept ID collectionpoint.Text = bl.getName(collectionPointID); //Call the method to change the method changeCollectionPoint(collectionPointID); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public ApiResponse <LoginResponse> Login(LoginBO bo) { return(new ApiResponse <LoginResponse>(ResponseCode.Ok, new LoginResponse() { Token = Service.Login(bo) })); }
public HttpResponseMessage get(long id) { ILoginBO loginBO = new LoginBO(); Retorno retorno = new Retorno(); try { retorno = loginBO.consultar(id); return(new HttpResponseMessage(HttpStatusCode.Created) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } catch (Exception ex) { retorno.status = false; retorno.mensagem = ex.Message; return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } }
void checkUserLogin() { string username = txtUsername.Text; string password = MD5Hash(txtPassword.Text); string[] inputs = { username }; foreach (string i in inputs) { if (!Regex.IsMatch(i, "^[a-zA-Z0-9]+$")) { MessageBox.Show("Invalid characters have been entered. \nOnly letters and/or numbers are allowed."); return; } } if (username == "" | password == "") { return; } LoginBO newLogin = new LoginBO(username, password); if (LoginBLL.databaseQuery(newLogin) == true) { var newWindow = new Thread(() => Application.Run(new Drews_Goods(loginCredentials))); newWindow.Start(); Close(); } }
public static LoginBO getUserbyEmail(string Email) { bool userfound = false; MongoCollection <User> objCollection = db.GetCollection <User>("c_User"); var query = Query.EQ("Email", Email); LoginBO objClass = new LoginBO(); foreach (User item in objCollection.Find(query)) { userfound = true; objClass.UserId = item._id.ToString(); objClass.Email = item.Email; objClass.FirstName = item.FirstName; objClass.LastName = item.LastName; objClass.PhoneNumber = item.PhoneNumber; break; } if (userfound) { return(objClass); } else { return(null); } }
public LoginBO sp_sel_loginBLL(int usuario, string pass) { DataTable dt = new DataTable(); LoginBO log = new LoginBO(); try { dt = new LoginDAL().sp_sel_loginDAL(usuario, pass); if (dt.Rows[0].ItemArray[0].ToString() == "0") { log.EsValido = "0"; } else { log.EsValido = "1"; log.Rut_persona = Convert.ToInt32(dt.Rows[0].ItemArray[0].ToString()); log.Dv_persona = dt.Rows[0].ItemArray[1].ToString(); log.Nom_persona = dt.Rows[0].ItemArray[3].ToString(); log.Funcion = dt.Rows[0].ItemArray[4].ToString(); log.DesTerminal = dt.Rows[0].ItemArray[5].ToString(); log.CodTerminal = dt.Rows[0].ItemArray[6].ToString(); } } catch (Exception ex) { throw ex; } return(log); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Change representative a twat ka UserDA and EmployeeDA twae mhar yay htar tal try { if (Session["login"].Equals("") || Session["userLoggedIn"].Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { //Get department Name by loggined user id (Get information after login) LoginBO lbo = (LoginBO)Session["login"]; ViewState["depID"] = lbo.DepID; UserBO ubo = (UserBO)Session["userLoggedIn"];//get the loggined user object lblDepartmentName.Text = lbo.DeptName + " Department"; ViewState["newRep"] = 0; checkPrimaryRole(lbo.DepID); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } }
public void setUp() { options = new ChromeOptions(); options.AddArgument("--ignore-ssl-errors=yes"); options.AddArgument("--ignore-certificate-errors"); driver = new ChromeDriver(options); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://opencart.abstracta.us"); var loginPage = new LoginPage(driver); loginPage.NavigateToLoginPage(driver); LoginBO loginBO = new LoginBO(); loginPage.LoginApplication(loginBO); var myAccountPage = new MyAccountPage(driver); myAccountPage.NavigateToMyAccountPage(driver); var addressPage = new AddressPage(driver); addressPage.NavigateToAddressPage(driver); changeAddressPage = new ChangeAddressPage(driver); }
protected void btnLogar(Object sender, EventArgs e) { _loginBO = new LoginBO(); var nomeUsuario = TxtUsuario.Text; var senha = txtSenha.Text; try { var usuario = _loginBO.obterUsuarioParaLogar(nomeUsuario, senha); //Auth o usuário FormsAuthentication.RedirectFromLoginPage(nomeUsuario, false); //Abrir sessão para usuário, aparti do perfil Session.Timeout = 30; Session["Perfil"] = usuario.Perfil; } catch (UsuarioNaoCadastradoException) { lblStatus.Text = "Usuário não cadastrado"; } catch (Exception) { lblStatus.Text = "Ocorrreu um erro inesperado, favor consultar o ADMIN"; } }
public LoginBO ResetLoginBAL(LoginBO lb) { LoginDAL dl = new LoginDAL(); LoginBO lbo = dl.LoginCheckDAL(lb); string des = lb.Login_Designation; if (lbo != null) { if (lbo.Login_ID == lb.Login_ID) { LoginBO sessionlogin = new LoginBO(); sessionlogin.Login_ID = lbo.Login_ID; sessionlogin.Login_Designation = lbo.Login_Designation; sessionlogin.Login_Role = lb.Login_Role; return(sessionlogin); } else { return(null); } } else { return(null); } }
public async Task <bool> AuthenticateUser(LoginBO loginBo) { using (var context = CreateContext()) { return(await context.User.AsNoTracking().Where(w => w.Username == loginBo.Username && w.Password == loginBo.UserPassword && w.Status == (int)RecordStatusEnum.Active).AnyAsync()); } }
protected void Page_Load(object sender, EventArgs e) { try { compareValidatorStartToday.ValueToCompare = DateTime.Now.ToShortDateString(); compareValidatorEndToday.ValueToCompare = DateTime.Now.ToShortDateString(); if (Session["userLoggedIn"].Equals("") || Session["login"].Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { if (!IsPostBack) { //Get department Name by loggined user id LoginBO lbo = (LoginBO)Session["login"]; ViewState["depID"] = lbo.DepID; //get the loggined user object UserBO ubo = (UserBO)Session["userLoggedIn"]; lblCurrentManager.Text = lbo.DeptName; ViewState["newManager"] = 0; checkPrimaryRole(lbo.DepID); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { try { compareValidatorStartToday.ValueToCompare = DateTime.Now.ToShortDateString(); compareValidatorEndToday.ValueToCompare = DateTime.Now.ToShortDateString(); if (!IsPostBack) { if (Session["login"].Equals("") || Session["userLoggedIn"].Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { //Use Employee DA and User DA LoginBO loginBO = (LoginBO)Session["login"]; ViewState["depID"] = loginBO.DepID; UserBO userBO = (UserBO)Session["userLoggedIn"]; ViewState["newHead"] = ""; checkPrimaryOrDelegate(loginBO.DepID); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public HttpResponseMessage postLogin([FromBody] LOGIN login) { ILoginBO loginBO = new LoginBO(); Retorno retorno = new Retorno(); String usuario = login.USUARIO; String senha = login.SENHA; try { retorno = loginBO.logar(usuario, senha); return(new HttpResponseMessage(HttpStatusCode.Created) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } catch (Exception ex) { retorno.status = false; retorno.mensagem = ex.Message; return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } }
public LoginBO AuthenticateUser(string UserName, string Password, bool rememberMe) { HttpContext context = HttpContext.Current; if (rememberMe) { HttpCookie username = new HttpCookie("username", UserName); HttpCookie password = new HttpCookie("password", Password); context.Response.Cookies.Add(username); context.Response.Cookies.Add(password); } else { context.Response.Cookies["username"].Expires = DateTime.Now.AddDays(-1); context.Response.Cookies["password"].Expires = DateTime.Now.AddDays(-1); } LoginBO objLoginBO = new LoginBO(); objLoginBO.UserName = UserName; objLoginBO.Password = new MD5Secure().Encrypt(Password); // objLoginBO.Password = Password; LoginBL objLoginBL = new LoginBL(); objLoginBO = objLoginBL.AuthenticateUser(UserName, objLoginBO.Password); if (objLoginBO != null) { HttpContext.Current.Session["RoleId"] = objLoginBO.RoleId; HttpContext.Current.Session["UserId"] = objLoginBO.Id; HttpContext.Current.Session["Email"] = objLoginBO.Email; HttpContext.Current.Session["UserName"] = objLoginBO.UserName; } return(objLoginBO); }
public static string spellingSuggestion(string Email) { bool userfound = false; MongoCollection <User> objCollection = db.GetCollection <User>("c_User"); var query = Query.Or( Query.EQ("Email", Email), Query.GT("Email", Email), Query.LT("Email", Email)); LoginBO objClass = new LoginBO(); foreach (User item in objCollection.Find(query)) { userfound = true; //objClass.Id = item._id.ToString(); objClass.UserId = item._id.ToString(); objClass.Email = item.Email; objClass.FirstName = item.FirstName; objClass.LastName = item.LastName; break; } if (userfound) { return(objClass.Email); } else { return(""); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { if (Session["login"].ToString().Equals("") || Session["userLoggedIn"].ToString().Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { LoginBO user = (LoginBO)Session["login"]; departmentID = user.DepID; if (!IsPostBack) { destinationBL = new DestinationBL(); Session["items"] = destinationBL.getDisbursementItems(departmentID); disbursementGV.DataSource = Session["items"]; disbursementGV.DataBind(); } } }//End of Ispost backevent } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
protected void disbursementGV_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { LoginBO user = (LoginBO)Session["login"]; departmentID = user.DepID; HiddenField hdn = (HiddenField)disbursementGV.Rows[e.RowIndex].FindControl("HiddenField1"); HiddenField hdf = (HiddenField)disbursementGV.Rows[e.RowIndex].FindControl("HiddenField2"); int itemID = Convert.ToInt32(hdn.Value); int disbursementID = Convert.ToInt32(hdf.Value); TextBox txtQuantity = disbursementGV.Rows[e.RowIndex].Cells[2].Controls[0] as TextBox; string qty = txtQuantity.Text; int quantity = Convert.ToInt32(qty); destinationBL = new DestinationBL(); destinationBL.updateDisbursement(departmentID, disbursementID, itemID, quantity); disbursementGV.EditIndex = -1; Session["items"] = destinationBL.getDisbursementItems(departmentID); //Bind in the gridview disbursementGV.DataSource = Session["items"]; disbursementGV.DataBind(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
//3..Save to Database public void addRequisitionList(List <ReqBO> rlst, LoginBO loginBo) { //create purchase object Requisition robj = new Requisition(); robj.DepartmentID = loginBo.DepID; robj.EmployeeID = loginBo.EmpID; robj.Status = "Pending"; robj.OrderDate = DateTime.Now; robj.Reason = ""; //For requistion items list List <Requisition_Item> rst = new List <Requisition_Item>(); foreach (ReqBO r in rlst) //from parameter pass { Requisition_Item ri = new Requisition_Item(); ri.ItemID = r.ItemID; ri.Status = "New"; ri.RequestedQty = r.RequestedQty; ri.ReceivedQty = 0; ri.UnfulfilledQty = r.RequestedQty; ri.RetrievedQty = 0; ri.ToRetrieveQty = 0; rst.Add(ri); } da.addRequisitionList(robj, rst); }
protected void Button1_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); LoginBO lbo = new LoginBO(); lbo.UserName = TextBox1.Text; LoginBLL lbll = new LoginBLL(); ds = lbll.login(lbo); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Password_"].ToString() == TextBox2.Text) { Session["UserName"] = ds.Tables[0].Rows[0]["UserName"].ToString(); Session["UserRoleID"] = ds.Tables[0].Rows[0]["UserRoleID"].ToString(); if (ds.Tables[0].Rows[0]["UserRoleID"].ToString() == "1") { Response.Redirect("welcomeAdmin.aspx"); } else { Response.Redirect("welcomeGuest.aspx"); } } else { Lab5.Text = "invalid credentials"; } } }
private void Button_Click(object sender, RoutedEventArgs e) { LoginBO bo = new LoginBO(); if (bo.login(txbkullaniciadi.Text, txbsifre.Text)) { Login l = new Login(); l = bo.getir2(txbkullaniciadi.Text); if (l.yetki == 1) { MainWindow m = new MainWindow(); m.Show(); this.Hide(); } else { egitimMain egitim = new egitimMain(); egitim.Show(); } } else { MessageBox.Show("Hatalı kullanıcı adı veya şifre"); } }
public ActionResult Login(LoginBO credentials) { try { LoginBO login = new LoginBO(); var response = consumer.CheckUser(credentials); if ((int)response.StatusCode == 200) { var user = JsonConvert.DeserializeObject <LoginBO>(response.Content); Session["Uid"] = user.id; if (!user.Empid.Equals(0)) { Session["EmpId"] = user.Empid; } return(RedirectToAction("Details", "Employee")); } else if ((int)response.StatusCode == 401) { ModelState.AddModelError(string.Empty, "UserId and password missmatch"); } else if ((int)response.StatusCode == 0) { if (ModelState.IsValid) { ModelState.AddModelError(string.Empty, "Apex service unavilable"); } } } catch (Exception es) { ModelState.AddModelError(string.Empty, es.Message); } return(View()); }
protected void btnSave_Click(object sender, EventArgs e) { try { LoginBO loginBo = (LoginBO)Session["login"]; rlst = (List <ReqBO>)Session["cart"]; rl.addRequisitionList(rlst, loginBo); //Change to New Original Default // TELL JANE ABOUT this cartView.DataSource = null; cartView.DataBind(); Session["cart"] = new List <ReqBO>(); if (cartView.Rows.Count >= 1) { btnSave.Visible = true; btnCancel.Visible = true; } else //ask to jane { btnSave.Visible = false; btnCancel.Visible = false; } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public LoginBO sp_login_clienteBLL(int rut, string pass) { DataTable dt = new DataTable(); LoginBO fw = new LoginBO(); try { dt = new ForwardersDAL().sp_login_clienteDAL(rut, pass); if (dt.Rows[0].ItemArray[0].ToString() == "0") { fw.EsValido = "0"; } else { fw.EsValido = "1"; fw.Rut_persona = Convert.ToInt32(dt.Rows[0].ItemArray[0].ToString()); fw.Dv_persona = dt.Rows[0].ItemArray[1].ToString(); fw.Nom_persona = dt.Rows[0].ItemArray[3].ToString(); fw.Funcion = "Cliente"; fw.DesTerminal = ""; fw.CodTerminal = ""; } } catch (Exception ex) { throw ex; } return(fw); }
public async Task <LoginBO> Login(LoginBO login) { try { con = await ApexService.DataAccess.DBConnection.ApexConnection(); cmd = new DBConnection().BuildProcedureCommand("P_SEL_LOGIN", con); cmd.Parameters.AddWithValue("@EMAIL", login.email); cmd.Parameters.AddWithValue("@PASSWORD", new Authenticate().Encryptdata(login.password)); using (var reader = await cmd.ExecuteReaderAsync()) { if (reader.Read()) { login.id = reader.GetInt32(0); login.email = reader.GetString(1).ToString(); login.password = ""; login.isEmailVerified = reader.GetInt32(2).Equals(1) ? true : false; login.VerificationCode = reader.GetString(3); login.Empid = reader.GetInt32(4); } } con.Close(); return(login); } catch (Exception es) { throw es; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { //If there is no login user, go to login page if (Session["userLoggedIn"].Equals("") || Session["login"].Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { //Check disbursement list LoginBO loginBO = (LoginBO)Session["login"]; lblUserName.Text = loginBO.EmpName; if (Session["role"].ToString().Equals("DeptHead")) { lnkbtnCatalogue.Visible = false; lnkbtnRequisition.Visible = false; //btnNotification.Visible = false; lnkbtnDisbursement.Visible = false; } else if (Session["role"].ToString().Equals("Emp")) { lnkbtnApprove.Visible = false; lnkbtnDelegateRole.Visible = false; lnkbtnChange.Visible = false; lnkbtnChangeRep.Visible = false; // btnNotification.Visible = false; lnkbtnDisbursement.Visible = false; } else if (Session["role"].ToString().Equals("EmpRep")) { lnkbtnApprove.Visible = false; lnkbtnDelegateRole.Visible = false; lnkbtnChangeRep.Visible = false; } else if (Session["role"].ToString().Equals("EmpHead")) { lnkbtnCatalogue.Visible = false; lnkbtnRequisition.Visible = false; lnkbtnDelegateRole.Visible = false; //Disbursement myin kwint ma shi } else if (Session["role"].ToString().Equals("EmpRepHead")) { lnkbtnCatalogue.Visible = false; lnkbtnRequisition.Visible = false; lnkbtnDelegateRole.Visible = false; } } } }catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { if (Session["userLoggedIn"].Equals("") || Session["login"].Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { LoginBO loginBO = (LoginBO)Session["login"]; lblUserName.Text = loginBO.EmpName; if (Session["role"].ToString().Equals("StoreManager")) { lnkRetrieval.Visible = false; lnkDistribution.Visible = false; lnkPurchase.Visible = false; lnkbtnDelegateSupervisor.Visible = false; lnkSupplier.Visible = false; } else if (Session["role"].ToString().Equals("StoreSupervisor")) { lnkRetrieval.Visible = false; lnkDistribution.Visible = false; lnkPurchase.Visible = false; lnkbtnDelegateManager.Visible = false; //Confirm and ask and change lnkSupplier.Visible = false; } else if (Session["role"].ToString().Equals("ClerkManager")) { lnkbtnDelegateManager.Visible = false; lnkbtnDelegateSupervisor.Visible = false; } else if (Session["role"].ToString().Equals("ClerkSupervisor")) { lnkbtnDelegateManager.Visible = false; lnkbtnDelegateSupervisor.Visible = false; } else if (Session["role"].ToString().Equals("StoreClerk")) { lnkbtnDelegateManager.Visible = false; lnkbtnDelegateSupervisor.Visible = false; lnkStockVocher.Visible = false; } else { Response.Redirect("~/LoggedInPage.aspx"); } } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public void change_password_dal(LoginBO lb) { con = new SqlConnection(ConnectionString); con.Open(); SqlCommand cmd = new SqlCommand("update E_Data_Login set DL_Password = '******' Where DL_LoginID=" + lb.Login_ID + "", con); cmd.ExecuteNonQuery(); con.Close(); }
public int Common_Login(string empUsername, string empPassword) { LoginBO objLoginBO = new LoginBO(); objLoginBO.empUsername = empUsername; objLoginBO.empPassword = empPassword; LoginDL objLoginDL = new LoginDL(); return objLoginDL.Login(objLoginBO); }
public string chk_change_password_dal(LoginBO lb) { con = new SqlConnection(ConnectionString); con.Open(); SqlCommand cmd = new SqlCommand("select DL_Password from E_Data_login where DL_LoginID='" + lb.Login_ID + "'", con); string cur_db_pass = Convert.ToString(cmd.ExecuteScalar()); return(cur_db_pass); }
public void testeListar() { ILoginBO loginBO = new LoginBO(); LOGIN login = new LOGIN(); Retorno retorno = new Retorno(); retorno = loginBO.listar(); Assert.AreEqual(true, retorno.status, retorno.mensagem); }
public void Common_InsertTemporaryLogin(int empId, string empUsername, string empPassword) { LoginBO objLoginBO = new LoginBO(); objLoginBO.empId = empId; objLoginBO.empUsername = empUsername; objLoginBO.empPassword = empPassword; LoginDL objLoginDL = new LoginDL(); objLoginDL.InsertTemporaryLogin(objLoginBO); }
public void InsertTemporaryLogin(LoginBO objLoginBO) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()); SqlCommand cmd = new SqlCommand("spAddTemporaryLogin", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@empId", objLoginBO.empId); cmd.Parameters.Add("@empUsername", objLoginBO.empUsername); cmd.Parameters.Add("@empPassword", objLoginBO.empPassword); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); }
public int Login(LoginBO objLoginBO) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()); SqlCommand cmd = new SqlCommand("spLogin", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@empUsername", objLoginBO.empUsername); cmd.Parameters.Add("@empPassword", objLoginBO.empPassword); conn.Open(); int empId = Convert.ToInt32(cmd.ExecuteScalar()); conn.Close(); return empId; }
protected void Page_Load(object sender, EventArgs e) { if (!Request.QueryString.HasKeys()) Response.Redirect("../../Default.aspx"); Label lblTitle = (Label)Page.Master.FindControl("lblTitle"); lblTitle.Text = Global.RESET_YOUR_PASSWORD; if (Request.QueryString.Get(0).Contains("@"))//if email provided { lblEmail.Text = Request.QueryString.Get(0); LoginBO user = new LoginBO(); user = LoginBLL.getUserbyEmail(Request.QueryString.Get(0)); if (user != null) { lblUserName.Text = user.FirstName + user.LastName; lblPhone.Visible = true; lblPhoneValue.Visible = true; lblPhoneValue.Text = user.PhoneNumber; } else { Response.Redirect("Recover.aspx?AccountNotfound=" + "true1"); } } else//phone provided { lblPhone.Visible = true; lblPhoneValue.Visible = true; lblPhoneValue.Text = Request.QueryString.Get(0); LoginBO user = new LoginBO(); user = LoginBLL.getUserbyPhone(lblPhoneValue.Text); if (user != null) { lblEmail.Text = user.Email; lblUserName.Text = user.FirstName + " " + user.LastName; } else { Response.Redirect("Recover.aspx?AccountNotfound=" + "true1"); } } }
public static LoginBO getUserbyPhone(string Phone) { bool userfound = false; MongoCollection<User> objCollection = db.GetCollection<User>("c_User"); var query = Query.EQ("PhoneNumber", Phone); LoginBO objClass = new LoginBO(); foreach (User item in objCollection.Find(query)) { userfound = true; objClass.UserId = item._id.ToString(); objClass.Email = item.Email; objClass.FirstName = item.FirstName; objClass.LastName = item.LastName; objClass.PhoneNumber = Phone; break; } if (userfound) return objClass; else return null; }
public static string spellingSuggestion(string Email) { bool userfound = false; MongoCollection<User> objCollection = db.GetCollection<User>("c_User"); var query = Query.Or( Query.EQ("Email", Email), Query.GT("Email", Email), Query.LT("Email", Email)); LoginBO objClass = new LoginBO(); foreach (User item in objCollection.Find(query)) { userfound = true; //objClass.Id = item._id.ToString(); objClass.UserId = item._id.ToString(); objClass.Email = item.Email; objClass.FirstName = item.FirstName; objClass.LastName = item.LastName; break; } if (userfound) { return objClass.Email; } else { return ""; } }