public FormModificarOrden()
        {
            InitializeComponent();
            this.SuspendLayout();

            BLConsultorio enlaceConsultorio = new BLConsultorio();
            BLMedico      enlaceMedico      = new BLMedico();

            ComboExamen.AutoCompleteSource = AutoCompleteSource.ListItems;
            ComboExamen.DataSource         = new BindingSource(ControlSistemaInterno.ListaAnalisis.GetInstance().Coleccion, null);
            ComboExamen.DisplayMember      = "Value";
            ComboExamen.ValueMember        = "Key";

            ComboBoxConsultorio.DataSource    = new BindingSource(enlaceConsultorio.ObtenerLista(), null);
            ComboBoxConsultorio.DisplayMember = "Value";
            ComboBoxConsultorio.ValueMember   = "Key";

            ComboBoxMedico.DataSource    = new BindingSource(enlaceMedico.ObtenerListaHabil(), null);
            ComboBoxMedico.DisplayMember = "Value";
            ComboBoxMedico.ValueMember   = "Key";

            tabla = new DataTable("Lista");
            //DeshabilitarFormulario();
            //Si existen tarifas en el Tarifario BD
            if (ControlSistemaInterno.ListaAnalisis.GetInstance().Coleccion.Count > 0)
            {
                InicializarTablaOrdenDetalle();
            }
            DeshabilitarFormulario();
            //CampFecha.Text = DateTime.Now.ToShortDateString();
            this.ResumeLayout(false);
        }
Exemple #2
0
        private void InicializarTablaOrdenDetalle()
        {
            BLMedico      enlaceMedico      = new BLMedico();
            BLConsultorio enlaceConsultorio = new BLConsultorio();

            this.SuspendLayout();

            BtnEliminar.Visible = false;
            ComboExamen.Enabled = true;
            BtnAgregar.Enabled  = true;

            ComboExamen.AutoCompleteSource = AutoCompleteSource.ListItems;
            ComboExamen.DataSource         = new BindingSource(ControlSistemaInterno.ListaAnalisis.GetInstance().Coleccion, null);
            ComboExamen.DisplayMember      = "Value";
            ComboExamen.ValueMember        = "Key";

            ComboBoxConsultorio.DataSource    = new BindingSource(enlaceConsultorio.ObtenerLista(), null);
            ComboBoxConsultorio.DisplayMember = "Value";
            ComboBoxConsultorio.ValueMember   = "Key";

            ComboBoxMedico.DataSource    = new BindingSource(enlaceMedico.ObtenerListaHabil(), null);
            ComboBoxMedico.DisplayMember = "Value";
            ComboBoxMedico.ValueMember   = "Key";

            //CampFecha.Text = DateTime.Now.ToShortDateString();

            tabla.TableNewRow += Tabla_TableNewRow;
            tabla.RowDeleted  += Tabla_RowDeleted;
            // Configuracion de Tablas


            tabla.Columns.Add("id", typeof(int));
            tabla.Columns.Add("codigo", typeof(string));
            tabla.Columns.Add("nombre", typeof(string));
            tabla.Columns.Add("cobertura", typeof(object));
            tabla.Columns.Add("idUnique", typeof(int));

            this.dataGridView.Columns[0].DataPropertyName = "id";
            this.dataGridView.Columns[0].Visible          = false;
            this.dataGridView.Columns[0].ReadOnly         = true;

            this.dataGridView.Columns[1].DataPropertyName = "codigo";
            this.dataGridView.Columns[1].ReadOnly         = true;
            this.dataGridView.Columns[1].Resizable        = DataGridViewTriState.False;

            this.dataGridView.Columns[2].DataPropertyName = "nombre";
            this.dataGridView.Columns[2].ReadOnly         = true;
            this.dataGridView.Columns[2].Resizable        = DataGridViewTriState.False;
            this.dataGridView.Columns[2].HeaderText       = "Nombre";

            this.dataGridView.Columns[3].DataPropertyName = "cobertura";   // The DataTable column name.
            this.dataGridView.Columns[3].HeaderText       = "Cobertura";
            ((DataGridViewComboBoxColumn)this.dataGridView.Columns[3]).DataSource    = new BindingSource(DiccionarioGeneral.GetInstance().TipoCobertura, null);
            ((DataGridViewComboBoxColumn)this.dataGridView.Columns[3]).DisplayMember = "Value";
            ((DataGridViewComboBoxColumn)this.dataGridView.Columns[3]).ValueMember   = "Key";
            this.dataGridView.Columns[3].Resizable = DataGridViewTriState.False;


            this.dataGridView.Columns[4].DataPropertyName = "idUnique";   // The DataTable column name.
            this.dataGridView.Columns[4].Visible          = false;
            this.dataGridView.Columns[4].ReadOnly         = true;


            bindingSource = new BindingSource();
            this.dataGridView.DataSource    = bindingSource;
            bindingSource.DataSource        = tabla;
            this.dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView.RowsAdded    += DataGridView_RowsAdded;
            this.dataGridView.RowsRemoved  += DataGridView_RowsRemoved;
            this.ResumeLayout(false);
        }