Пример #1
0
        private void btnModifySaveUser_Click(object sender, EventArgs e)
        {
            if (!filledValues())
            {
                //MessageBox.Show("Complete la información");
            }
            else
            {
                serviceDA                    = new DBControllerWSClient();
                currentUser.password         = txtModifyUserPassword.Text;
                currentUser.expirationDate   = (DateTime)dtpModifyUserExpirationDate.Value.Date;
                currentUser.modificationDate = DateTime.Now;
                currentUser.user1            = txtUserName.Text;

                //usuario1.employee.role = "Vendedor";
                if (cbActive.Checked == true)
                {
                    currentUser.state = 1;
                }
                else
                {
                    currentUser.state = 0;
                }

                try
                {
                    int salio = serviceDA.updateUser(currentUser);
                    if (salio == 1)
                    {
                        MessageBox.Show("El usuario se modificó satisfactoriamente");
                    }
                }
                catch
                {
                    MessageBox.Show("Sistema en mantenimiento :(");
                }

                this.Close();
            }
        }