示例#1
0
        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;
     }
 }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!AuthRequire.CheckIfUserLoggedIn())
            {
                AuthRequire.Logout();
                Response.Redirect("/CustomerLogin");
                return;
            }

            if (!IsPostBack)
            {
                RefreshGridView();
            }
        }
示例#5
0
        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;
        }
示例#7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (AuthRequire.CheckIfUserLoggedIn() && AuthRequire.RetrieveUserRole() == "Admin")
     {
     }
     else
     {
         if (AuthRequire.RetrieveUserRole() == "Customer")
         {
             Response.Redirect("~/CustomerProfile");
         }
         else if (AuthRequire.RetrieveUserRole() == "Business")
         {
             Response.Redirect("~/BusinessProfile");
         }
     }
 }
        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 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 (!IsPostBack)
     {
         if (AuthRequire.CheckIfUserLoggedIn())
         {
             Service1Client client = new Service1Client();
             CustomerClass  cust   = client.SelectOneCustomer(Session["ae"].ToString());
             if (cust != null)
             {
                 tbFirstName.Text   = cust.FirstName;
                 tbLastName.Text    = cust.LastName;
                 tbEmail.Text       = cust.Email;
                 tbPhoneNumber.Text = cust.PhoneNumber;
                 tbBirthDate.Text   = cust.DateOfBirth.ToString("yyyy-MM-dd");
             }
         }
         else
         {
             Response.Redirect("~/CustomerLogin");
         }
     }
 }
        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;
        }
示例#15
0
        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)
 {
     if (AuthRequire.CheckIfUserLoggedIn() && AuthRequire.RetrieveUserRole() == "Customer")
     {
     }
 }