public void loadDataUser()
 {
     //user = new User();
     //GridViewCustomer.DataSource = user.selectUser();
     users = new UserDic();
     users.selectUsers();
     GridViewCustomer.DataSource = users.Values;
     GridViewCustomer.DataBind();
 }
Exemple #2
0
 void fetchUser()
 {
     //user = new UserDic.User();
     users = new UserDic();
     users.selectUsers();
     DropDownList3.DataSource     = users.Values;
     DropDownList3.DataTextField  = "FirstName";
     DropDownList3.DataValueField = "UserID";
     DropDownList3.DataBind();
 }
        public void updateUser()
        {
            string firstname  = firstname_TextBox.Text.ToString();
            string lastname   = lastname_TextBox.Text.ToString();
            string email      = email_TextBox.Text.ToString();
            string username   = username_TextBox.Text.ToString();
            int    userid     = int.Parse(userid_TextBox.Text.ToString());
            string tel        = tel_TextBox.Text.ToString();
            string gender     = gender_TextBox.Text.ToString();
            string brithday   = birthday_TextBox.Text.ToString();
            string numaddress = numaddress_TextBox.Text.ToString();
            string tambon     = tambon_TextBox.Text.ToString();
            string amphoe     = amphoe_TextBox.Text.ToString();
            string city       = city_TextBox.Text.ToString();
            string country    = country_TextBox.Text.ToString();
            string postnumber = postnumber_TextBox.Text.ToString();

            //user = new UserDic.User(firstname, lastname, email, username, userid, tel, gender, brithday, numaddress, tambon, amphoe, city, country, postnumber)
            //{
            //    FirstName = firstname,
            //    LastName = lastname,
            //    Email = email,
            //    Username = username,
            //    UserID = userid,
            //    Tel = tel,
            //    Gender = gender,
            //    BrithDay = brithday,
            //    NumAddress = numaddress,
            //    Tambon = tambon,
            //    Amphoe = amphoe,
            //    City = city,
            //    Country = country,
            //    PostNumber = postnumber
            //};
            users = new UserDic();
            users.editUsers(firstname, lastname, email, username, userid, tel, gender, brithday, numaddress, tambon, amphoe, city, country, postnumber);
            //user.editCustomer(firstname, lastname, email, username, userid, tel, gender, brithday, numaddress, tambon, amphoe, city, country, postnumber);
        }
        public void addUser()
        {
            int    userid     = int.Parse(userid_TextBox.Text.ToString());
            string firstname  = firstname_TextBox.Text.ToString();
            string lastname   = lastname_TextBox.Text.ToString();
            string username   = username_TextBox.Text.ToString();
            string tel        = tel_TextBox.Text.ToString();
            string email      = email_TextBox.Text.ToString();
            string gen        = gender_TextBox.Text.ToString();
            string numaddress = numAddress_TextBox.Text.ToString();
            string tambon     = tambon_TextBox.Text.ToString();
            string amphoe     = amphoe_TextBox.Text.ToString();
            string city       = city_TextBox.Text.ToString();
            string country    = country_TextBox.Text.ToString();
            string postnumber = postnumber_TextBox.Text.ToString();
            string birthday   = Convert.ToString(brithday_TextBox.Text);

            //users = new UserDic.User (userid,firstname, lastname, username, tel, email, gen,numaddress, tambon, amphoe, city, country, postnumber, birthday)
            //{
            //    UserID = userid,
            //    FirstName = firstname,
            //    LastName = lastname,
            //    Username =username,
            //    Tel = tel,
            //    Email = email,
            //    Gender = gen,
            //    NumAddress = numaddress,
            //    Tambon = tambon,
            //    Amphoe = amphoe,
            //    City = city,
            //    Country = country,
            //    PostNumber = postnumber,
            //    BrithDay = birthday
            //};
            user = new UserDic();
            user.addUsers(userid, firstname, lastname, username, tel, email, gen, numaddress, tambon, amphoe, city, country, postnumber, birthday);
        }