Esempio n. 1
0
            public static List <classes.User> getAllUsers()
            {
                List <classes.User> userList = new List <User>();

                try
                {
                    #region MyRegion
                    SQLiteDataReader dr = executeReader("select userId from _user");
                    if (dr != null)
                    {
                        while (dr.Read())
                        {
                            classes.User user = getUser(long.Parse(dr["userId"].ToString()));
                            if (user != null)
                            {
                                userList.Add(user);
                            }
                        }
                    }
                    #endregion
                }
                catch (Exception ex)
                {
                    throw new Exception("Unable to get users. [" + ex.Message + "]");
                }
                return(userList);
            }
Esempio n. 2
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            classes.User oUser = new classes.User();
            //oUser.Address = txtAddress.Text;
            //oUser.Website = txtWeb.Text;

            oUser.Phone    = txtPhoneNum.Text;
            oUser.Email    = txtEmail.Text.Trim();
            oUser.Fullname = txtFullName.Text.Trim();
            oUser.ID       = Convert.ToInt32(hdnUId.Value);
            oUser.AcctType = Convert.ToInt32(radioAcctType.SelectedValue);
            oUser.Voucher  = Convert.ToInt32(cboVoucher.SelectedValue);

            if (chkShowPhone.Checked)
            {
                oUser.ShowPhonenum = 1;
            }

            //***BUG was from class get/set variable = private value
            oUser.FlgBlogNotify = rdoBlogNotify.SelectedValue;

            oUser.FlgCommentNotify = rdoEmailNotify.SelectedValue;

            if (oUser.UpdateProfile())
            {
                Response.Redirect("ElJefe.aspx", true);
            }
            lblStatus.Text = "Error updating.  Check log.";
        }
Esempio n. 3
0
        //Update user profile
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            string strSQL = string.Empty;

            IDBManager dbManager = new DBManager(DataProvider.SqlServer);

            dbManager.ConnectionString = ConfigurationManager.ConnectionStrings["myConn"].ConnectionString;;

            //TODO:
            //verify form

            classes.User oUser = new classes.User();

            oUser.Phone    = txtPhoneNum.Text;
            oUser.UserName = txtDisplayName.Text;
            oUser.Address  = txtAddress.Text;
            oUser.Website  = txtWeb.Text;

            oUser.State   = txtState.Text.ToUpper();
            oUser.City    = txtCity.Text;
            oUser.Zipcode = txtZip.Text;

            oUser.ID = Convert.ToInt32(hdnUId.Value);

            //NEW Address
            if (hdnAId.Value == string.Empty)
            {
                if (oUser.SaveForCoupon())   //stored_proc
                {
                    if (hdnRDir.Value == "1")
                    {
                        Response.Redirect("Post.aspx", true);
                    }

                    Response.Redirect("Manager.aspx?m=1", true);
                }
                else
                {
                    Response.Redirect("Manager.aspx?m=2", true);
                }
            }
            else
            {
                oUser.GenData1 = hdnAId.Value;
                if (oUser.UpdateForCoupon()) //stored_proc
                {
                    Response.Redirect("Manager.aspx?m=1", true);
                }
                else
                {
                    Response.Redirect("Manager.aspx?m=2", true);
                }
            }
            //FIXME: error.
        }