Пример #1
0
        public LectorLista()
        {
            InitializeComponent();

            grdDatos.AutoGenerateColumns = false;
            grdDatos.ColumnCount         = 7;

            responsables = ResponsableCn.GetResponsables();

            //Add Columns
            ///grdDatos.Columns[0].Name = "CustomerId";
            grdDatos.Columns[0].HeaderText       = "T Documento";
            grdDatos.Columns[0].DataPropertyName = "Documento";

            ///grdDatos.Columns[1].HeaderText = "Contact Name";
            grdDatos.Columns[1].Name             = "Serie";
            grdDatos.Columns[1].DataPropertyName = "Serie";

            ///grdDatos.Columns[2].Name = "Country";
            grdDatos.Columns[2].HeaderText       = "Número";
            grdDatos.Columns[2].DataPropertyName = "Numero";

            grdDatos.Columns[3].HeaderText       = "Fecha";
            grdDatos.Columns[3].DataPropertyName = "fecha";

            grdDatos.Columns[4].HeaderText       = "Cód. Responsable";
            grdDatos.Columns[4].DataPropertyName = "idresponsable";

            grdDatos.Columns[5].HeaderText       = "Nom. Responsable";
            grdDatos.Columns[5].DataPropertyName = "responsable";

            grdDatos.Columns[6].HeaderText       = "Estado";
            grdDatos.Columns[6].DataPropertyName = "estado";

            llenar();
        }
Пример #2
0
        public LectorDoc(String id)
        {
            if (id == null)
            {
                estado = "NUEVO";
            }
            else
            {
                llenarDesdeBD(id);
                if (cabecera == null)
                {
                    estado = "NUEVO";
                }
            }

            InitializeComponent();

            responsables = ResponsableCn.GetResponsables();

            var mapResponsables = new BindingList <KeyValuePair <string, string> >();

            mapResponsables.Add(new KeyValuePair <string, string>(null, "[Seleccionar]"));

            foreach (RESPONSABLE r in responsables)
            {
                mapResponsables.Add(new KeyValuePair <string, string>(r.IDRESPONSABLE, r.NOMBRES));
            }

            cboResponsable.DataSource    = mapResponsables;
            cboResponsable.ValueMember   = "Key";
            cboResponsable.DisplayMember = "Value";
            cboResponsable.SelectedIndex = 0;

            dt.Columns.Add(new DataColumn("Item"));
            dt.Columns.Add(new DataColumn("IdProducto"));
            dt.Columns.Add(new DataColumn("Descripcion"));
            dt.Columns.Add(new DataColumn("Idmedida"));
            dt.Columns.Add(new DataColumn("Cantidad"));

            grdDet.DataSource = dt;

            productos = PRODUCTOcn.GetPRODUCTOS();

            tDocumentos = ASIG_TDOCUMENTOcn.GetAsig_TDocumento("LECTOR");

            if (tDocumentos.Count == 0)
            {
                MessageBox.Show("No tiene definido documentos");
            }
            else
            {
                if (estado.Equals("NUEVO"))
                {
                    nuevo();
                    llenarVista();
                    edicion(true);
                }
                else
                {
                    llenarVista();
                    edicion(false);
                }
            }
        }