Ejemplo n.º 1
0
 protected void BotonNuevo_Click(object sender, EventArgs e)
 {
     ClearForm();
     GridViewComisiones.SelectedIndex = -1;
     GridViewComisiones.Enabled       = false;
     PanelAcciones.Visible            = true;
     PanelABM.Visible = true;
     FormMode         = FormModes.Alta;
     LabelModo.Text   = FormMode.ToString();
     EnableForm(true);
 }
Ejemplo n.º 2
0
 protected void BotonEditar_Click(object sender, EventArgs e)
 {
     if (this.IsEntitySelected)
     {
         GridViewComisiones.Enabled = true;
         PanelAcciones.Visible      = true;
         PanelBotonesGrilla.Visible = true;
         EnableForm(true);
         PanelABM.Visible = true;
         this.FormMode    = FormModes.Modificacion;
         LabelModo.Text   = FormMode.ToString();
         this.MapearDeEntidad(SelectedID, FormMode.ToString());
     }
 }
Ejemplo n.º 3
0
        protected void ButtonEditar_Click(object sender, EventArgs e)
        {
            if (this.IsEntitySelected)
            {
                this.GridViewUsuarios.Enabled        = false;
                this.PanelAccionesFormulario.Visible = true;
                this.PanelBotonesGrilla.Visible      = false;
                this.EnableForm(true);
                this.PanelABM.Visible = true;
                this.FormMode         = FormModes.Modificacion;

                LabelModo.Text = FormMode.ToString();
                this.MapearDeUsuario(this.SelectedID, this.FormMode.ToString());
            }
        }
Ejemplo n.º 4
0
        /// <remarks> The form interface must be active before calling this. </remarks>
        private void SetMode(FormMode mode)
        {
            Form.SuspendLayout();
            try
            {
                _mode = mode;
                if ((_mode != FormMode.None) && ((MainSource == null) || (MainSource.DataView == null)))
                {
                    throw new ClientException(ClientException.Codes.MainSourceNotSpecified, _errorList != null ? _errorList.ToException() : null, mode.ToString());
                }

                _form.EnterNavigates = (_mode == FormMode.Insert) || (_mode == FormMode.Edit);
                switch (_mode)
                {
                case FormMode.Insert:
                    if (MainSource.DataView.State != DAE.Client.DataSetState.Insert)
                    {
                        MainSource.DataView.Insert();
                    }
                    break;

                case FormMode.Edit:
                    if (MainSource.DataView.State != DAE.Client.DataSetState.Edit)
                    {
                        MainSource.DataView.Edit();
                    }
                    break;
                }
                AcceptRejectChanged();
            }
            finally
            {
                Form.ResumeLayout(false);
            }
        }
Ejemplo n.º 5
0
        /// <remarks> The form interface must be active before calling this. </remarks>
        private void SetMode(FormMode mode)
        {
            _mode = mode;
            if ((_mode != FormMode.None) && ((MainSource == null) || (MainSource.DataView == null)))
            {
                throw new ClientException(ClientException.Codes.MainSourceNotSpecified, mode.ToString());
            }
            switch (_mode)
            {
            case FormMode.Insert:
                if (MainSource.DataView.State != DAE.Client.DataSetState.Insert)
                {
                    MainSource.DataView.Insert();
                }
                break;

            case FormMode.Edit:
                if (MainSource.DataView.State != DAE.Client.DataSetState.Edit)
                {
                    MainSource.DataView.Edit();
                }
                break;
            }
            UpdateAcceptReject();
        }