private void btnDeactivate_Click(object sender, RoutedEventArgs e) { SellerValidations vf = new SellerValidations(); bool?b = null; dgViewprop.ItemsSource = vf.viewProp(sellerId, b); }
protected void btnRegister_Click(object sender, EventArgs e) { SellerValidations sellerObj = new SellerValidations(); Property addProperty = new Property(); int userId = int.Parse(Session["userId"].ToString()); addProperty.SellerId = userId; addProperty.PropertyName = txtPropName.Text; string propType = " "; if (rdbFlat.Checked == true) { propType = "Flat"; } else if (rdbOffice.Checked == true) { propType = "Office"; } else { propType = "Villa"; } addProperty.PropertyType = propType; string propOption = ""; if (rdbRent.Checked == true) { propOption = "Rent"; } else { propOption = "Sell"; } addProperty.PropertyOption = propOption; addProperty.Address = txtAddress.Text; addProperty.Landmark = txtLandMark.Text; addProperty.InitialDeposit = decimal.Parse(txtInitialDeposit.Text); addProperty.PriceRange = decimal.Parse(txtPriceRange.Text); State state = states[ddlState.SelectedIndex]; stateId = state.StateId; addProperty.StateId = stateId; City city = cities[ddlCity.SelectedIndex]; cityId = city.CityId; addProperty.CityId = cityId; sellerObj.AddProperty(addProperty); Response.Redirect("SellerHome.aspx"); }
private void btnLogin_Click(object sender, RoutedEventArgs e) { try { User login = new User(); UsersValidations userObj = new UsersValidations(); SellerValidations sellerObj = new SellerValidations(); BuyerValidations buyerObj = new BuyerValidations(); login.UserName = txtUserName.Text; login.Password = txtPass.Password; login = userObj.LoginUser(login); if (login != null) { if (login.UserType.ToLower() == "admin") { Admin sp = new Admin(); this.NavigationService.Navigate(sp); } else if (login.UserType.ToLower() == "seller") { int sellerId = sellerObj.SellerId(login.UserName); SellerPage sp = new SellerPage(sellerId); this.NavigationService.Navigate(sp); } else if (login.UserType.ToLower() == "buyer") { int buyerId = buyerObj.BuyerId(login.UserName); ShowAllProperties_Buyer sp = new ShowAllProperties_Buyer(buyerId); this.NavigationService.Navigate(sp); } MessageBox.Show("Login Successful!!"); } else { txtUserName.Text = ""; txtPass.Password = ""; throw new UserException("UserName/Password is required"); } } catch (UserException ex) { MessageBox.Show(ex.Message, "Alert"); } }
protected void btnLogin_Click(object sender, EventArgs e) { User login = new User(); UsersValidations userObj = new UsersValidations(); SellerValidations sellerObj = new SellerValidations(); BuyerValidations buyerObj = new BuyerValidations(); login.UserName = txtUserName.Text; login.Password = txtPassword.Text; login = userObj.LoginUser(login); if (login != null) { if (login.UserType.ToLower() == "admin") { Session["userName"] = login.UserName; Response.Redirect("Admin.aspx"); } else if (login.UserType.ToLower() == "seller") { int sellerId = sellerObj.GetSellerId(login.UserName); Session["userId"] = sellerId; Session["userName"] = login.UserName; Response.Redirect("SellerHome.aspx"); } else if (login.UserType.ToLower() == "buyer") { int buyerId = buyerObj.BuyerId(login.UserName); Session["userId"] = buyerId; Session["userName"] = login.UserName; Response.Redirect("DisplayResults.aspx"); } Response.Write("<script type='text/javascript'>alert( '" + login.UserName + "');</script>"); } //else //{ // throw new UserException("UserName/Password is invalid"); //} }
private void btnVerify_Click(object sender, RoutedEventArgs e) { SellerValidations vf = new SellerValidations(); dgViewprop.ItemsSource = vf.viewProp(sellerId, true); }
void SellerPage_Loaded(object sender, RoutedEventArgs e) { SellerValidations vf = new SellerValidations(); dgViewprop.ItemsSource = vf.viewProp(sellerId); }