Ejemplo n.º 1
0
        private void CmdVerEstacion_Click(object sender, EventArgs e)
        {
            int n_idite = 0;

            if (Tab2.SelectedTab.TabIndex == 0)
            {
                n_idite = Convert.ToInt32(FgProd.GetData(FgProd.Row, 1));
            }
            if (Tab2.SelectedTab.TabIndex == 1)
            {
                n_idite = Convert.ToInt32(FgInter.GetData(FgInter.Row, 1));
            }
            if (Tab2.SelectedTab.TabIndex == 2)
            {
                n_idite = Convert.ToInt32(FgTodo.GetData(FgTodo.Row, 1));
            }

            int       n_idMatPri = 0;
            DataTable dtRes      = new DataTable();

            CLS_Produccion o_pro = new CLS_Produccion();

            dtRes      = funDatos.DataTableFiltrar(dtProducto, "n_id = " + n_idite + "");
            n_idMatPri = Convert.ToInt32(funFunciones.NulosN(dtRes.Rows[0]["n_idmatpri"]));
            if (n_idMatPri == 0)
            {
                MessageBox.Show("¡ El producto no tiene materia prima como insumo principal !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                return;
            }
            o_pro.mysConec = mysConec;
            o_pro.VerEstacionalidad(n_idMatPri);
            o_pro = null;
        }
Ejemplo n.º 2
0
        private void CmdVerRec_Click(object sender, EventArgs e)
        {
            int n_idpro  = 0;
            int n_row    = 0;
            int n_posrec = 9999;
            int n_idrec  = 0;

            if (Tab2.SelectedIndex == 0)
            {
                n_idpro = Convert.ToInt32(FgProd.GetData(FgProd.Row, 1));
            }
            if (Tab2.SelectedIndex == 1)
            {
                n_idpro = Convert.ToInt32(FgInter.GetData(FgInter.Row, 1));
            }
            if (Tab2.SelectedIndex == 2)
            {
                n_idpro = Convert.ToInt32(FgTodo.GetData(FgTodo.Row, 1));
            }

            List <BE_PRO_PRODUCTOSRECETAS>        l_recetas    = new List <BE_PRO_PRODUCTOSRECETAS>();
            List <BE_PRO_PRODUCTOSRECETASINSUMOS> l_recetasins = new List <BE_PRO_PRODUCTOSRECETASINSUMOS>();

            SSF_NET_Produccion.CLS_Recetas o_recetas = new SSF_NET_Produccion.CLS_Recetas();
            CN_pro_productos o_prod = new CN_pro_productos();

            o_prod.mysConec = mysConec;
            o_prod.TraerRegistro(n_idpro);

            l_recetas    = o_prod.lstRecetas;
            l_recetasins = o_prod.lstRecetasIns;

            for (n_row = 0; n_row <= l_recetas.Count - 1; n_row++)
            {
                if (l_recetas[n_row].n_prirec == 1)
                {
                    n_posrec = n_row;
                    n_idrec  = l_recetas[n_row].n_id;
                    break;
                }
            }

            for (n_row = 0; n_row <= l_recetasins.Count - 1; n_row++)
            {
                if (l_recetasins[n_row].n_idrec != n_idrec)
                {
                    l_recetasins.RemoveAt(n_row);
                    n_row = n_row - 1;
                }
            }

            if (n_posrec == 9999)
            {
                MessageBox.Show("¡ El producto seleccionado no tiene receta principal asignada !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                return;
            }
            o_recetas.dtItems     = dtItems;
            o_recetas.dtTipExi    = dtTipExi;
            o_recetas.dtUniMed    = dtUniMed;
            o_recetas.e_Receta    = l_recetas[n_posrec];
            o_recetas.l_RecetaIns = l_recetasins;
            o_recetas.VerRecetar();
            o_recetas = null;
        }
Ejemplo n.º 3
0
        void AsignarEntidad()
        {
            int n_fila   = 0;
            int n_col    = 0;
            int n_numele = 0;
            int n_numcol = 0;
            int n_id     = 0;

            if (n_QueHace == 1)
            {
                n_id = 0;
            }
            if (n_QueHace == 2)
            {
                n_id = Convert.ToInt32(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString());
            }

            BE_DETALLE.Clear();

            BE_CABECERA.n_idemp    = STU_SISTEMA.EMPRESAID;
            BE_CABECERA.n_id       = n_id;
            BE_CABECERA.c_des      = TxtDes.Text;
            BE_CABECERA.d_fchini   = Convert.ToDateTime("01/" + Convert.ToInt32(CboMesIni.SelectedValue).ToString() + "/" + STU_SISTEMA.ANOTRABAJO.ToString());
            BE_CABECERA.d_fchfin   = Convert.ToDateTime(BE_CABECERA.d_fchini.AddMonths(12).ToString("dd/MM/yyyy"));
            BE_CABECERA.n_mesini   = Convert.ToInt32(CboMesIni.SelectedValue);
            BE_CABECERA.n_ano      = STU_SISTEMA.ANOTRABAJO;
            BE_CABECERA.n_idplapro = Convert.ToInt32(LblIdPlaVen.Text);
            BE_CABECERA.n_activo   = 1;

            n_numele = FgProd.Rows.Count - 1;
            n_numcol = FgProd.Cols.Count - 2;
            for (n_fila = 2; n_fila <= n_numele; n_fila++)
            {
                for (n_col = 4; n_col <= n_numcol; n_col++)
                {
                    BE_GES_PLANABASTECIMIENTODET e_detalle = new BE_GES_PLANABASTECIMIENTODET();
                    e_detalle.n_idplaaba = n_id;
                    e_detalle.n_idite    = Convert.ToInt32(FgProd.GetData(n_fila, 1));
                    e_detalle.n_idmes    = Buscarmes(FgProd.GetData(1, n_col).ToString());
                    e_detalle.n_idtipite = 1;
                    e_detalle.n_can      = Convert.ToDouble(FgProd.GetData(n_fila, n_col));
                    BE_DETALLE.Add(e_detalle);
                }
            }

            n_numele = FgInter.Rows.Count - 1;
            n_numcol = FgInter.Cols.Count - 2;
            for (n_fila = 2; n_fila <= n_numele; n_fila++)
            {
                for (n_col = 4; n_col <= n_numcol; n_col++)
                {
                    BE_GES_PLANABASTECIMIENTODET e_detalle = new BE_GES_PLANABASTECIMIENTODET();
                    e_detalle.n_idplaaba = n_id;
                    e_detalle.n_idite    = Convert.ToInt32(FgInter.GetData(n_fila, 1));
                    e_detalle.n_idmes    = Buscarmes(FgInter.GetData(1, n_col).ToString());
                    e_detalle.n_idtipite = 2;
                    e_detalle.n_can      = Convert.ToDouble(FgInter.GetData(n_fila, n_col));
                    BE_DETALLE.Add(e_detalle);
                }
            }
        }