Пример #1
0
        public ActionResult AddUser(user acc)
        {
            //context.users.Add(acc);
            //context.SaveChanges();
            string json = JsonConvert.SerializeObject(acc);

            client.AddUser_BE(json);
            return(RedirectToAction("List", "BackendUser", new { area = "Backend" }));
        }
Пример #2
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            if (CheckInfo() == 1)
            {
                if (userNames.Contains(txtUsername.Text))
                {
                    MessageBox.Show("username bị trùng");
                }
                else
                {
                    user acc = new user(txtUsername.Text, txtPassword.Text, int.Parse(comboBoxRoleID.Text), txtFullname.Text, txtEmail.Text, txtPhone.Text, txtAddress.Text);
                    client.AddUser_BE(JsonConvert.SerializeObject(acc));

                    FormUser_Load(sender, e);
                    MessageBox.Show("Thêm Thành Công");
                    ClearTextBox();
                }
            }
        }