protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } if (Request.Params["business"] == null) { Response.Redirect("~/BDBusinesses.aspx"); return; } Service1Client client = new Service1Client(); Business bo = client.GetSingleBusinessByBusinessId(Request.Params["business"].Trim()); if (bo == null) { Response.Redirect("~/BDBusinesses.aspx"); return; } tb_businessName.Text = bo.Name; tb_businessRegNum.Text = bo.RegistrationNumber; tb_businessType.Text = bo.Type; tb_businessUrl.Text = bo.Url; }
protected void logout_Click(object sender, EventArgs e) { if (AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); } }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { Response.Redirect("~/CustomerLogin"); AuthRequire.Logout(); return; } }
protected void UpdateDelete_Click(object sender, EventArgs e) { Service1Client client = new Service1Client(); CustomerClass cust = client.SelectOneCustomer(Session["ae"].ToString()); if (cust != null) { client.UpdateCustomerStatus(cust.ID, cust.Email, "deleteStatus", true); AuthRequire.Logout(); } }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } if (!IsPostBack) { RefreshGridView(); } }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } ServiceReference1.IService1 client = new ServiceReference1.Service1Client(); List <BusinessEmployeeAccess> invites = client.GetAllInvitationsByUserId(Session["userId"].ToString()).ToList(); lv_invitations.DataSource = invites; lv_invitations.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } Service1Client client = new ServiceReference1.Service1Client(); BusinessUser bu = client.GetBusinessUserByUserId(Session["userId"].ToString()); tb_name.Text = bu.Name; tb_email.Text = bu.Email; tb_phone.Text = bu.Phone; }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } if (Request.Params["business"] != null) { ServiceReference1.IService1 client = new ServiceReference1.Service1Client(); client.DeleteBusiness(Request.Params["business"].Trim()); } Response.Redirect("~/BDBusinesses.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("~/CustomerLogin"); return; } Service1Client client = new Service1Client(); lv_businesses.DataSource = client.GetAllBusinessByUserId(Session["userId"].ToString()); lv_businesses.DataBind(); lv_sharedBusinesses.DataSource = client.GetAcceptedBusinessInviteByUserId(Session["userId"].ToString()); lv_sharedBusinesses.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("~/CustomerLogin"); return; } try { businessId = Guid.Parse(Request.Params["business"]); } catch (Exception ex) { Response.Redirect("/business/my-businesses"); } hl_branch.NavigateUrl = "/business/branches?business=" + businessId.ToString(); }
protected void UpdatePassword_Click(object sender, EventArgs e) { Service1Client client = new Service1Client(); String oldPassword = (String)tbOldPassword.Text.Trim(); String password = (String)tbPassword.Text.Trim(); String cfmPassword = (String)tbPasswordCfm.Text.Trim(); Boolean resultValidation = PasswordValidation(oldPassword, password, cfmPassword); if (resultValidation) { lbOldPasswordError.Visible = false; lbPasswordError.Visible = false; lbCfmPasswordError.Visible = false; CustomerClass cust = client.SelectOneCustomer(Session["ae"].ToString()); if (cust != null) { client.UpdateCustomerPassword(cust.ID, cust.Email, password); AuthRequire.Logout(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } if (Request.Params["business"] != null) { string businessId = Request.Params["business"].Trim(); Service1Client client = new ServiceReference1.Service1Client(); Business business = client.GetSingleBusinessByBusinessId(businessId); if (business == null) { Response.Redirect("~/BDBusinesses.aspx"); return; } // business name lbl_businessName.Text = business.Name; // bind the data from wcf List <BusinessEmployeeAccess> employees = client.GetAllEmployeeByBusinessId(businessId).ToList(); if (employees.Count == 0) { lbl_feedback.Text = "You currently don't have any employees, add one?"; return; } lv_employees.DataSource = client.GetAllEmployeeByBusinessId(businessId); lv_employees.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } Guid beaId, businessId; BusinessEmployeeAccess bea = null; try { beaId = Guid.Parse(Request.Params["id"]); ServiceReference1.IService1 client = new ServiceReference1.Service1Client(); bea = client.GetOneEmployeeAccess(beaId.ToString()); client.DeleteEmployeeAccess(bea.UserId, bea.BusinessId); } catch (Exception ex) { Console.WriteLine(ex.ToString() + "\n" + ex.Message); // log? } finally { if (bea != null) { Response.Redirect("~/business/employees?business=" + bea.BusinessId); } else { Response.Redirect("~/business/employees?business"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } try { businessId = Guid.Parse(Request.Params["business"]); } catch (Exception ex) { Response.Redirect("/business/my-businesses"); } Service1Client client = new Service1Client(); lv_roles.DataSource = client.GetBusinessRoles(businessId.ToString()); lv_roles.DataBind(); lv_roles.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { if (!AuthRequire.CheckIfUserLoggedIn()) { AuthRequire.Logout(); Response.Redirect("/CustomerLogin"); return; } if (string.IsNullOrEmpty(Request.Params["business"])) { Response.Redirect("/business/my-businesses"); } try { Guid businessId = Guid.Parse(Request.Params["business"]); LoadBusinessBranches(businessId); } catch (Exception ex) { Console.WriteLine("Error in BDBranches.aspx Page_Load " + ex + " message: " + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { AuthRequire.Logout(); Response.Redirect("~/CustomerLogin"); }