Exemplo n.º 1
0
        private void CargarItemsOC(int _index, int _nivelAutorizacion)
        {
            try
            {
                BLL.Procedures.TRAEORDENCOMPRAITEM _item = new BLL.Procedures.TRAEORDENCOMPRAITEM();

                this.dataGridViewOCItem.Rows.Clear();
                int indice;
                //TRAIGO LOS ITEMS QUE SOLO ESTÁN AUTORIZADAS
                foreach (Entities.Procedures.TRAEORDENCOMPRAITEM item in _item.ItemList(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.CODEMP].Value.ToString(), Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.NRO_OC].Value), _nivelAutorizacion))
                {
                    indice = dataGridViewOCItem.Rows.Add();
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.ARTICULO].Value    = item.articulo_id;            //ARTICULO
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.NROITEM].Value     = item.nroitem;                //ITEM OC
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.DESCRIPCION].Value = item.art_descgen.ToString(); //DESCRIP ARTICULO
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.UNIMED].Value      = item.unimed.ToString();      //DESCRIP ARTICULO
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.EXCLUIDO].Value    = item.excluido;               //excluido
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.MOTIVO].Value      = item.motivoexclusion;        //excluido
                }
                OC_ID   = Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.NRO_OC].Value);               // Salvo Orden de compra ID
                _codEmp = dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.CODEMP].Value.ToString();                     // Salvo el CODEMP
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void CargarItemsOC(int _index, int _nivelAutorizacion)
        {
            try
            {
                BLL.Procedures.TRAEORDENCOMPRAITEM _item = new BLL.Procedures.TRAEORDENCOMPRAITEM();

                this.dataGridViewOCItems.Rows.Clear();
                int indice;
                foreach (Entities.Procedures.TRAEORDENCOMPRAITEM item in _item.ItemList(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.CODEMP].Value.ToString(), Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.NRO_OC].Value), _nivelAutorizacion))
                {
                    indice = dataGridViewOCItems.Rows.Add();
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.CODEMP].Value         = item.codemp;                                //CODIGO EMPRESA
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.CODIGO].Value         = item.articulo_id;                           //ARTICULO
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.NROORDENCOMPRA].Value = item.ordencompra_id;                        //OC
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.NROITEM].Value        = item.nroitem;                               //NRO ITEM
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.DESCRIPCION].Value    = item.art_descgen.ToString();                //DESCRIP ARTICULO
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.UNIDAD].Value         = item.unimed;                                //TRAE UNIMED
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.PRECIO].Value         = item.precio.ToString().Replace(",", ".");   //CANTIDAD;//CANTIDAD
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.CANTIDAD].Value       = item.cantidad.ToString().Replace(",", "."); //CANTIDAD;//CANTIDAD
                    dataGridViewOCItems.Rows[indice].Cells[(int)Col_OCItem.FENTREGA].Value       = item.fechaentrega;                          //FECHA ENTREGA
                }
                OC_ID   = Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.NRO_OC].Value);                                  // Salvo Orden de compra ID
                _codemp = dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.CODEMP].Value.ToString();                                        // Salvo el CODEMP
                //TRAIGO LAS OBSERVACIOENS EN EL TEXT.. POR SI LA QUIERE MODIFICAR
                this.textBoxObs.Text      = dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.OBSERVACIONES].Value.ToString();
                this.comboBoxProveed.Text = dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.PROVEEDOR].Value.ToString();
                this.comboBoxLugarEntrega.SelectedValue = Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.SECTORENTREGA_ID].Value);//SECTOR DE ENTREGA
                this.checkBoxdiaria.Checked             = (Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.PEDIDO_NO_PREVISTO].Value) == 0) ? false:true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
        private void dataGridViewOCCab_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex > -1)
                {
                    //this.textBoxDetalleOC.Visible = false;
                    //this.dataGridViewOCItem.Visible = true;

                    BLL.Procedures.TRAEORDENCOMPRAITEM _item = new BLL.Procedures.TRAEORDENCOMPRAITEM();

                    this.dataGridViewOCItem.Rows.Clear();
                    int     indice;
                    decimal _totalOC = 0;
                    foreach (Entities.Procedures.TRAEORDENCOMPRAITEM item in _item.ItemList(dataGridViewOCCab.Rows[e.RowIndex].Cells[(int)Col_OCCab.CODEMP].Value.ToString(), Convert.ToInt32(dataGridViewOCCab.Rows[e.RowIndex].Cells[(int)Col_OCCab.NRO_OC].Value), 1))
                    {
                        indice = dataGridViewOCItem.Rows.Add();
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.CODEMP].Value           = item.codemp;                                //CODIGO EMPRESA
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.ARTICULO_ID].Value      = item.articulo_id;                           //ARTICULO
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.NRO_OC].Value           = item.ordencompra_id;                        //OC
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.NRO_ITEM].Value         = item.nroitem;                               //NRO ITEM
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.ARTICULO].Value         = item.art_descgen.ToString();                //DESCRIP ARTICULO
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.UNIDAD_DE_MEDIDA].Value = item.unimed;                                //TRAE UNIMED
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.PRECIO].Value           = item.precio.ToString().Replace(",", ".");   //PRECIO
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.CANTIDAD].Value         = item.cantidad.ToString().Replace(",", "."); //CANTIDAD
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.MARCA].Value            = item.marca;                                 //TRAE MARCA
                        dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.FECHA_DE_ENTREGA].Value = item.fechaentrega.ToShortDateString();      //FECHA ENTREGA

                        decimal _precio   = Convert.ToDecimal(item.precio.ToString().Replace(",", ".").ToString(), culture);
                        decimal _cantidad = Convert.ToDecimal(item.cantidad.ToString().Replace(",", ".").ToString(), culture);

                        _totalOC = Convert.ToDecimal(_totalOC + (_precio * _cantidad), culture);
                    }
                    labelImporteOC.Text = "$ " + _totalOC.ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 4
0
        private void  CargarItemsOC(int _index, int _nivelAutorizacion)
        {
            try
            {
                BLL.Procedures.TRAEORDENCOMPRAITEM _item = new BLL.Procedures.TRAEORDENCOMPRAITEM();

                this.dataGridViewOCItem.Rows.Clear();
                int indice;
                //TRAIGO LOS ITEMS QUE SOLO ESTÁN AUTORIZADAS
                foreach (Entities.Procedures.TRAEORDENCOMPRAITEM item in _item.ItemList(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.CODEMP].Value.ToString(), Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.NRO_OC].Value), _nivelAutorizacion))
                {
                    indice = dataGridViewOCItem.Rows.Add();
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.ARTICULO].Value        = item.articulo_id;                           //ARTICULO
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.NROITEM].Value         = item.nroitem;                               //ITEM OC
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.DESCRIPCION].Value     = item.art_descgen.ToString();                //DESCRIP ARTICULO
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.UNIMED].Value          = item.unimed;                                //TRAE UNIMED
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.EMBALAJE].Value        = item.embalaje;                              //EMBALAJE
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.MARCA].Value           = item.marca;                                 //MARCA
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.PRECIO].Value          = item.precio.ToString().Replace(",", ".");   //PRECIO
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.PRECIO_ORIGINAL].Value = item.precio.ToString().Replace(",", ".");   //PRECIO ORIGINAL
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.CANTIDAD].Value        = item.cantidad.ToString().Replace(",", "."); //CANTIDAD
                    dataGridViewOCItem.Rows[indice].Cells[(int)Col_OCItem.CANT_ORIGINAL].Value   = item.cantidad.ToString().Replace(",", "."); //CANTIDAD ORIGINAL
                }
                OC_ID   = Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.NRO_OC].Value);                                  // Salvo Orden de compra ID
                _codEmp = dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.CODEMP].Value.ToString();                                        // Salvo el CODEMP
                //TRAIGO LAS OBSERVACIOENS EN EL TEXT.. POR SI LA QUIERE MODIFICAR

                this.textBoxObs.Text        = dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.OBSERVACIONES].Value.ToString();
                this.comboBoxProveed.Text   = dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.PROVEEDOR].Value.ToString();
                this.checkBoxdiaria.Checked = (Convert.ToInt32(dataGridViewOCCab.Rows[_index].Cells[(int)Col_OCCab.PEDIDO_NO_PREVISTO].Value) == 0) ? false : true;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }