示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            signUp = new SignUpController();
            userControl = new UserCtrl();

            if (IsPostBack)
            {
                ResultLabel.Visible = true;
            }

            if (!IsPostBack)
            {
                EditProfileTitle.Visible = false;

                //if (Session["name"]!= null)
                if (Page.PreviousPage == null && Session["name"]!= null)
                {
                    //Manage title and button visibility for Edit Profile
                    EditProfileBtn.Visible = true;
                    SignUpBtn.Visible = false;
                    BackButton.Visible = true;
                    SignUpTitle.Visible = false;
                    EditProfileTitle.Visible = true;
                    ResultLabel.Visible = false;

                    email.ReadOnly = true;
                    confEmail.ReadOnly = true;
                    string emailString = Session["name"].ToString();

                    u = userControl.getProfileInfo(emailString);

                    email.Text = u.Email;
                    confEmail.Text = u.Email;
                    firstName.Text = u.FirstName;
                    lastName.Text = u.LastName;
                    address.Text = u.Address;
                    city.Text = u.City;
                    DropDownList1.SelectedValue = u.State;
                    zipCode.Text = u.Zip.ToString();
                    //Phone.Text = u.Phone;
                    MobilePhone.Text = u.Phone;
                    checkToText.Checked = u.Text;

                }
            }

            ServiceReference1.SUSMSClient isuService = new ServiceReference1.SUSMSClient();

            string[] carriers = isuService.getCarriers();

            if (carriers.Length > 0 && CarrierList.Items.Count <= 1)
            {
                foreach (string carrier in carriers)
                {
                    CarrierList.Items.Add(new ListItem(carrier, carrier));
                }
            }
        }
 public bool addUserCredentials(string email, string password)
 {
     bool addSuccess = false;
     if(userDao.addNewUserCredentials(email, password))
     {
         addSuccess = true;
         UserCtrl newUser = new UserCtrl();
         newUser.authenticate(email, password);
     }
     return addSuccess;
 }
        public bool addUserCredentials(string email, string password)
        {
            bool addSuccess = false;

            if (userDao.addNewUserCredentials(email, password))
            {
                addSuccess = true;
                UserCtrl newUser = new UserCtrl();
                newUser.authenticate(email, password);
            }
            return(addSuccess);
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     loginCtrl = new UserCtrl();
     if (Request.QueryString["signup"] != null)
     {
         MessagePanel.Visible = true;
     }
     else
     {
         MessagePanel.Visible = false;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     itemCtrl = new ItemController();
     userCtrl = new UserCtrl();
     smsCtrl = new TextCallController();
     MsgPanel.Visible = false;
     if(Request.QueryString["success"] != null)
     {
         SuccessPanel.Visible = true;
     }
     else
     {
         SuccessPanel.Visible = false;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["itemId"] != null)
            {
                string selectedItemId = Request.QueryString["itemId"];
                ItemController itemCtrl = new ItemController();
                UserCtrl userCtrl = new UserCtrl();

                Item result = itemCtrl.getItemByID(selectedItemId);
                ItemID.Text = result.CategoryID + result.ItemID;
                ItemName.Text = result.ItemName;
                lblCurrentPrice.Text = String.Format("{0:0.##}", result.ItemValue);
                lblMinPrice.Text = String.Format("{0:0.##}", result.MinBid);
                lblAngelPrice.Text = String.Format("{0:0.##}", result.AngelPrice);
                ItemDesc.Text = result.Description.ToString();

                if (String.IsNullOrEmpty(result.UserID.ToString()))
                {
                    LblItemStatus.Text = "UnSold";
                    LblItemStatus.CssClass = "ui grey ribbon big label";
                }
                else
                {
                    if (result.Paid)
                    {
                        LblItemStatus.Text = "Paid";
                        LblItemStatus.CssClass = "ui green ribbon big label";
                    }
                    else
                    {
                        LblItemStatus.Text = "Sold";
                        LblItemStatus.CssClass = "ui red ribbon big label";
                    }
                }

                User buyer = userCtrl.getBuyerInfo(result.UserID.ToString());

                if (buyer !=null)
                {
                    BuyerName.Text = buyer.FirstName + " " + buyer.LastName;
                    BuyerEmail.Text = buyer.Email;
                    BuyerPhone.Text = "(" + buyer.Phone.Substring(0, 3) + ")" + buyer.Phone.Substring(3, 3) + "-" + buyer.Phone.Substring(6);
                }
                else
                {

                        LblItemStatus.Text = "UnSold";
                        LblItemStatus.CssClass = "ui grey ribbon big label";
                }

                List<User> designers = itemCtrl.getDesigners(selectedItemId);

                if (designers != null)
                {
                    foreach (User d in designers)
                    {
                        DesignerName.Text += d.FirstName + " " + d.LastName + " ";
                    }
                }

                SponsorName.Text = itemCtrl.getSponsorName(result.CategoryID);

            }
        }
示例#7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     itemCtrl = new ItemController();
     userCtrl = new UserCtrl();
 }
示例#8
0
        protected void SignUpBtn_Click(object sender, EventArgs e)
        {
            string role = Request.QueryString["role"];

            bool ADMIN = false;
            bool COMMITTEE = false;
            bool DONOR = false;

            string EMAIL = email.Text;
            string FNAME = firstName.Text;
            string LNAME = lastName.Text;
            string ADDRESS = address.Text;
            string CITY = city.Text;
            string STATE = DropDownList1.SelectedValue;
            int ZIP = Convert.ToInt32(zipCode.Text);

            if (role.Equals("a"))
            {

                ADMIN = true;
                COMMITTEE = false;
            }
            if (role.Equals("s"))
            {
                ADMIN = false;
                COMMITTEE = true;
            }
            if (role.Equals("d"))
            {
                DONOR = true;
            }

            string HPHONE = Phone.Text;
            string MPHONE = MobilePhone.Text;
            bool TEXT = checkToText.Checked;
            string CARRIER = CarrierList.SelectedValue;

            //ID is produced in database
            toAdd = new User(-1, EMAIL, FNAME, LNAME, ADDRESS, CITY, STATE, ZIP, ADMIN, COMMITTEE, DONOR, MPHONE, TEXT, CARRIER);
            if (signUp.addUser(toAdd))
            {
                signUp.addUserCredentials(email.Text, password1.Text);
                if (role.Equals("a"))
                {
                    Request r = new Request()
                    {
                        RequestEmail = EMAIL,
                        Admin = true,
                        Committee = false,
                        Donor = false
                    };
                    UserCtrl uCtrl = new UserCtrl();
                    uCtrl.createRequest(r);
                }
                //Do we wnat to add a message here letting user know request was submitted successfully?
                Response.Redirect("Default.aspx?signup=1");
            }
            else
            {
                //Is this the preferred action if a user is already signed up or sign up fails?
                Response.Redirect("Default.aspx");
            }

            //This adds usercredentials right away ... needs to be modified if there is an approval action
            signUp.addUserCredentials(email.Text, password1.Text);
        }