Esempio n. 1
0
        private void añadirConcepto(int id)
        {
            cotizaciones_local cotizaciones = new cotizaciones_local();

            var modulos = (from x in cotizaciones.modulos_cotizaciones where x.merge_id == merged_id select x).Count();

            if (modulos < 5)
            {
                if (datagridviewNE2.Rows.Count <= 0)
                {
                    borrarImagenPredeterminada(merged_id);
                }
                setDir dir = new setDir(id, merged_id, img, getMedidas(id, "largo"), getMedidas(id, "alto"));
                dir.ShowDialog();
                if (dir.close == true)
                {
                    cargarMergedItems(merged_id);
                    cargarModulosCotizados();
                }
            }
            else
            {
                MessageBox.Show("[Error] este concepto ya tiene demaciados artículos.", constants.msg_box_caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        //Añadir a concepto
        private void añadirAConceptoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (datagridviewNE1.RowCount > 0)
            {
                if (datagridviewNE1.CurrentRow.Cells[4].Value.ToString() != "-2")
                {
                    cotizaciones_local cotizaciones = new cotizaciones_local();

                    var modulos = (from x in cotizaciones.modulos_cotizaciones where x.merge_id == perso_id select x).Count();

                    if (modulos < 5)
                    {
                        if (modulos <= 0)
                        {
                            borrarImagenPredeterminada(perso_id);
                        }
                        int    id  = (int)datagridviewNE1.CurrentRow.Cells[0].Value;
                        setDir dir = new setDir(id, perso_id, constants.byteToImage((byte[])datagridviewNE1.CurrentRow.Cells[1].Value), getMedidas(id, "largo"), getMedidas(id, "alto"));
                        dir.ShowDialog();
                        if (dir.close == true)
                        {
                            constants.getItemsToGetMerged(datagridviewNE1);
                            if (Application.OpenForms["articulos_cotizacion"] != null)
                            {
                                ((articulos_cotizacion)Application.OpenForms["articulos_cotizacion"]).reloadModulos();
                            }
                            if (datagridviewNE1.RowCount <= 0)
                            {
                                this.Close();
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "[Error] este concepto ya tiene demaciados artículos.", constants.msg_box_caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(this, "[Error] no posible añadir esté artículo.", constants.msg_box_caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }