Esempio n. 1
0
        public void sbrCreaExcel(DataTable dtb, string vNomHoja)
        {
            frmInformacion.vTexto = "Creando Hoja Excel";
            Form frm = new frmInformacion();

            frm.Show();
            Application.DoEvents();

            DataTable dtEx = dtb.DefaultView.ToTable();

            cOffice oOffice = new cOffice();

            oOffice.AbreExcel(false);
            Application.DoEvents();
            oOffice.Visible = false;
            Application.DoEvents();
            oOffice.CargaExcel(dtEx, 1);
            Application.DoEvents();
            if (vNomHoja != "")
            {
                oOffice.NombreHoja(vNomHoja);
            }
            oOffice.Visible = true;
            Application.DoEvents();

            oOffice.LimpiaExcel();
            Application.DoEvents();

            frm.Close();
            Application.DoEvents();
        }
Esempio n. 2
0
        private void eliminarStockDePZsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string vMen = "Este proceso eliminara TODO el Stock de los Productos 'PZ-' (Producto Terminado),Esta seguro ?";
            string vTit = "Eliminar";

            if (MessageBox.Show(vMen, vTit, MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }


            vMen = "Peroooo Seguro, seguro ?";
            vTit = "Eliminar";
            if (MessageBox.Show(vMen, vTit, MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            frmInformacion frm = new frmInformacion();

            frm.vTex = "Eliminando Stock de 'PZ-'";
            frm.Show();
            Application.DoEvents();

            string vID = System.Guid.NewGuid().ToString();

            string    vSql = cConstantes.SQL_ElimStockPZ;
            DataTable dt   = SQLDataAccess.Trae(vSql, cUtil.SQLConec(cParamXml.strConecProduc_Prueb));

            foreach (DataRow dr in dt.Rows)
            {
                string  vProd = dr["Producto"].ToString();
                string  vCan  = dr["canreg"].ToString();
                decimal vdCan = Convert.ToDecimal(vCan);
                string  vUbi  = dr["Ubi"].ToString();
                string  vLote = dr["Lote"].ToString();
                string  vOFL  = dr["OFL"].ToString();
                try
                {
                    string vTipo = "Entrada";
                    if (vdCan < 0)
                    {
                        vTipo = "Salida";
                    }
                    //Crear movimientos de producto y materia prima
                    cMovimientos.Articulo oMov = new cMovimientos.Articulo();

                    //Movimiento de producto
                    oMov.fncAlta(cParamXml.Emp, vTipo, DateTime.Now, DateTime.Now, cParamXml.AlmacenMat, vProd, "",
                                 vCan, "Inv_" + vID, vOFL, vUbi, vLote);
                }
                catch { }
            }

            frm.Close();

            MessageBox.Show("Se han eliminado todo el Stock del los Productos 'PZ-'");
        }
Esempio n. 3
0
        private void frmAvisoPregunta_Load(object sender, EventArgs e)
        {
            if (tipo == "modal")
            {
                this.BackColor          = Color.Black;
                this.ventanaModal.Owner = this;
                this.ventanaModal.Show();
                return;
            }


            if (tipo == "")
            {
                p          = new yesno(this, this.mensaje);
                p.enviando = recibiendo;
                p.Show();
            }
            else if (tipo == "informacion")
            {
                informacion          = new frmInformacion(this, this.mensaje, this.titulo);
                informacion.enviando = recibiendo;
                informacion.Show();
            }
            else if (tipo == "error")
            {
                error          = new frmError(this.mensaje, this.titulo, this);
                error.enviando = recibiendo;
                error.Show();
            }
            else if (tipo == "exclamation")
            {
                exclamation          = new frmExclamacion(this.mensaje, this.titulo, this);
                exclamation.enviando = recibiendo;
                exclamation.Show();
            }
            else if (tipo == "question")
            {
                question          = new frmQuestion(this.mensaje, this.titulo, this);
                question.enviando = recibiendo;
                question.Show();
            }
            else
            {
                success          = new frmSuccess(this.mensaje, this.titulo, this);
                success.enviando = recibiendo;
                success.Show();
            }
        }
Esempio n. 4
0
        private void frmSrvGesInj_Load(object sender, EventArgs e)
        {
            if (cUtil.fncEnEjecucion(Application.ProductName.ToString()))
            {
                MessageBox.Show("Existe una copia de la aplicación en marcha.Acepte este mensaje y ejecute de nuevo el programa SrvGesInj");

                //Icon1.Visible = false;

                IntPtr vint = IntPtr.Zero;
                cUtil.fncCierraExe(vint, true, Application.ProductName.ToString());
                this.Close();
            }

            frmInformacion.vTexto = "Iniciando Servicios GesInject";
            Form frm = new frmInformacion();

            frm.Show();
            Application.DoEvents();

            frm.Close();
            Application.DoEvents();

            cParamXml.AlmacenMat = "Principal";

            string vTit = "Servicios  GesInject " + "" + " Versión :" + Application.ProductVersion.ToString() + "  Conectado con: " + cParamXml.Srv + " (" + cParamXml.BD + ")";

            this.Text = vTit;
            //Hacemos visible el formulario
            this.Show();
            this.WindowState = FormWindowState.Minimized;

            //Ocultamos el icono de la bandeja de sistema
            Icon1.Visible = true;
            this.Visible  = false;
            this.Hide();
        }