Exemplo n.º 1
0
        //FIN PERMISOS

        private void CargarTipos()
        {
            try
            {
                BLL.Tables.STKSUBTIPOMOV _sector = new BLL.Tables.STKSUBTIPOMOV();
                _sector.OrderByParameter.Add(DAL.Tables.STKSUBTIPOMOV.ColumnEnum.descripcion);
                this.bindingSourceStkTipoMov.DataSource = _sector.ItemList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void toolStripButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                Entities.Tables.STKSUBTIPOMOV _item = new Entities.Tables.STKSUBTIPOMOV();
                BLL.Tables.STKSUBTIPOMOV      _tipo = new BLL.Tables.STKSUBTIPOMOV();

                _item.SUBTIPOMOV_ID = _idTipo;
                _item.DESCRIPCION   = this.textBoxDescrip.Text.Trim();
                //verifico si la variable es distinta de cero
                if (_idTipo != 0)
                {
                    //ESTOY ACTUALIZANDO UN TIPO
                    if (this.textBoxDescrip.Text.Trim() != string.Empty)
                    {
                        _tipo.Update(_item);
                        _idTipo = 0;
                        this.textBoxDescrip.Text = string.Empty;
                        MessageBox.Show("La Operación se realizó correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Debe ingresar una descripción", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.textBoxDescrip.Focus();
                    }
                }
                else
                {
                    //ES UN NUEVO INGRESO
                    if (this.textBoxDescrip.Text.Trim() != string.Empty)
                    {
                        _tipo.Add(_item);
                        _idTipo = 0;
                        this.textBoxDescrip.Text = string.Empty;
                        MessageBox.Show("La Operación se realizó correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Debe ingresar una descripción", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.textBoxDescrip.Focus();
                    }
                }
                CargarTipos();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }