Esempio n. 1
0
        private void TraeRequerimientosPendientes()
        {
            try
            {
                BLL.Procedures.REQUERIMIENTOS_PARAORDENDECOMPRA _detalle = new BLL.Procedures.REQUERIMIENTOS_PARAORDENDECOMPRA();
                this.dataGridViewReqDisponibles.Rows.Clear();
                //this.labelDiario.Visible = false;
                this.textBoxLugarEntrega.Text = string.Empty;
                //REQUERIMIENTOS DE LA EMPRESA QUE INGRESO
                var q = (dynamic)null;

                q = (from item in _detalle.ItemList(2)
                     where item.codemp == Clases.Usuario.EmpresaLogeada.EmpresaIngresada.ToString()
                     select item);

                int indice;
                foreach (Entities.Procedures.REQUERIMIENTOS_PARAORDENDECOMPRA item in q)     //TRAIGO LOS REQUERIMIENTOS CON AUT=2 QUE SON LOS AUTORIZADOS
                {
                    indice = dataGridViewReqDisponibles.Rows.Add();
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.CODEMP].Value               = item.codemp;                    //CODIGO DE EMPRESA
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.SECTOR_REQ_ID].Value        = item.codemp;                    //SECTOR-ID
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.NRO_REQUERIMIENTO].Value    = item.requerimiento_id;          //TTRAE ID DE REQUERIMIENTO
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.FECHA_DE_PEDIDO].Value      = item.fecha.ToShortDateString(); //TRAE FECHA DE PEDIDO
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.SECTOR_REQUERIMIENTO].Value = item.descripcion;               //TRAE DESCRIPCION DEL SECTOR
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.OBSERVACIONES].Value        = item.obs;                       //TRAE OBSERVACION
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.DIARIO].Value               = item.pedidodiario;              //ME DICE SI EL REQUIERIMIENTO ES DIARIO
                    dataGridViewReqDisponibles.Rows[indice].DefaultCellStyle.BackColor = (item.pedidodiario) ? Color.YellowGreen:Color.White;
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.LUGARENTREGA].Value = item.Lugarentrega;                      //LUGAR DE ENTREGA
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        //FIN PERMISOS

        private void TraeRequerimientosPendientes()
        {
            try
            {
                BLL.Procedures.REQUERIMIENTOS_PARAORDENDECOMPRA _detalle = new BLL.Procedures.REQUERIMIENTOS_PARAORDENDECOMPRA();
                this.dataGridViewReqDisponibles.Rows.Clear();
                //REQUERIMIENTOS DE LA EMPRESA QUE INGRESO
                var q = (dynamic)null;

                q = (from item in _detalle.ItemList(2)
                     where item.codemp == Clases.Usuario.EmpresaLogeada.EmpresaIngresada.ToString()
                     select item);

                int indice;
                foreach (Entities.Procedures.REQUERIMIENTOS_PARAORDENDECOMPRA item in q) //TRAIGO LOS REQUERIMIENTOS CON AUT=2 QUE SON LOS AUTORIZADOS
                {
                    indice = dataGridViewReqDisponibles.Rows.Add();
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.CODEMP].Value               = item.codemp;                    //CODIGO DE EMPRESA
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.SECTOR_REQ_ID].Value        = item.sectorrequerimiento_id;    //SECTOR-ID
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.NRO_REQUERIMIENTO].Value    = item.requerimiento_id;          //TTRAE ID DE REQUERIMIENTO
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.FECHA_DE_PEDIDO].Value      = item.fecha.ToShortDateString(); //TRAE FECHA DE PEDIDO
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.SECTOR_REQUERIMIENTO].Value = item.descripcion;               //TRAE DESCRIPCION DEL SECTOR
                    dataGridViewReqDisponibles.Rows[indice].Cells[(int)Col_RequerimientoCab.OBSERVACIONES].Value        = item.obs;                       //TRAE OBSERVACION
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }