/// <summary>
 /// se usa para agregar
 /// </summary>
 /// <param name="modo"></param>
 public EditarProducto(Modo modo, FormInicio formInicio)
 {
     InitializeComponent();
     this.modo       = modo;
     this.formInicio = formInicio;
     this.Text       = "Agregar Nuevo Producto";
     groupProd.Text  = "Agregar Nuevo Producto";
     // ocultar el boton de editar
     btnEditar.Enabled = false;
     btnEditar.Visible = false;
 }
 public EditarProducto(DataProducto prod, Modo modo, FormInicio formInicio) : this(prod, modo)
 {
     this.formInicio = formInicio;
 }
예제 #3
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            //guardar los mensajes de error
            string errores       = "";
            bool   errorBool     = false;
            string nombreUsuario = txtuser.Text.Trim();
            string password      = txtpassword.Text.Trim();

            if (string.IsNullOrEmpty(nombreUsuario))
            {
                errores  += "ingrese el nombre de usuario\n";
                errorBool = true;
            }
            if (string.IsNullOrEmpty(password))
            {
                errores  += "ingrese el pasword\n";
                errorBool = true;
            }
            if (!errorBool)
            {
                //llamaria a login
                Usuario usr = new Usuario(nombreUsuario, password);//
                //usr.Ingresar(nombreUsuario, password, Variables.programa);
                bool ingreso = usr.Ingresar(nombreUsuario, password, Variables.programa);
                if (ingreso == true)
                {
                    FormInicio p = new FormInicio();
                    p.Show();
                    //p.ShowDialog();
                }
                else
                {
                    string            title   = "Close Window";
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    DialogResult      result  = MessageBox.Show("password incorrecto", title, buttons, MessageBoxIcon.Warning);
                }
            }
            else
            {
                //muestro lo errores
                //string message = "Do you want to abort this operation?";
                string            title   = "Close Window";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                DialogResult      result  = MessageBox.Show(errores, title, buttons, MessageBoxIcon.Warning);
            }
            //Usuario usr = new Negocio.Modelo.Usuario();


            /*if (checkrecordar.Checked == true)
             * {
             *  Properties.Settings.Default.UserName = txtuser.Text;
             *  Properties.Settings.Default.password = txtpassword.Text;
             *  Properties.Settings.Default.Save();
             * }
             * else
             * {
             *  Properties.Settings.Default.UserName = "";
             *  Properties.Settings.Default.password = "";
             *  Properties.Settings.Default.Save();
             * }*/



            //guardo los datos
        }