コード例 #1
0
ファイル: EditDemanda.cs プロジェクト: themuerte/sistema_mrp
 public EditDemanda(Administracion papa, PlanProducto pp)
 {
     InitializeComponent();
     this.papa = papa;
     this.pp   = pp;
     lMes.Text = "Mes NO. " + pp.IdPlanAgregado;
 }
コード例 #2
0
 // con bd
 public FuerzaNivelada(int numPeriodo, Producto prod, Empresa empresa)
 {
     NumPeriodo   = numPeriodo;
     Prod         = prod;
     Empresa      = empresa;
     aDemanda     = PlanProducto.GetDemandaEstimadaByProducto(prod.IdProducto);
     aDiasHabiles = PlanAgregado.getDiasHabiles();
 }
コード例 #3
0
ファイル: MRP.cs プロジェクト: themuerte/sistema_mrp
        private void btnCalcular2_Click(object sender, EventArgs e)
        {
            dtg_resultado.Rows.Clear();
            dtg_resultado.Columns.Clear();

            int        index          = dgvProducto.SelectedRows[0].Index;
            int        idProducto     = int.Parse(dgvProducto.Rows[index].Cells[0].Value.ToString());
            Producto   prod           = Producto.GetProductoById(idProducto);
            int        numSemanas     = int.Parse(tbSemanas.Text);
            Empresa    empresa        = Empresa.GetEmpresa();
            List <int> demandaSemanal = new List <int>();

            double[] demandaMensual = PlanProducto.GetDemandaEstimadaByProducto(prod.IdProducto);
            int      contador       = 0;

            for (int i = 0; i < demandaMensual.Length; i++)
            {
                int semana = 0;
                while (semana < 4)
                {
                    if (contador == numSemanas)
                    {
                        break;
                    }
                    else
                    {
                        demandaSemanal.Add((int)Math.Round(demandaMensual[i] / 4));
                        contador++;
                    }
                }
            }
            if (rdr_L4L.Checked == true)
            {
                L4L l4 = new L4L(numSemanas, prod.CostoPedir, prod.CostoUnitario, prod.CostoMantenimiento, demandaSemanal);
                l4.get_L4L(dtg_resultado);
            }

            if (rdr_EOQ.Checked == true)
            {
                EOQ oQ = new EOQ(numSemanas, prod.CostoPedir, prod.CostoUnitario, prod.CostoMantenimiento, demandaSemanal);
                oQ.get_EOQ(dtg_resultado);
            }

            if (rdr_LTC.Checked == true)
            {
                LTC tC = new LTC(numSemanas, prod.CostoPedir, prod.CostoUnitario, prod.CostoMantenimiento, demandaSemanal);
                tC.get_LTC(dtg_resultado);
            }
        }
コード例 #4
0
        public void llenarDatosDemanda()
        {
            List <PlanProducto> demandaProd = PlanProducto.GetPlanProductosByProducto(productoSel.IdProducto);

            if (demandaProd.Count == 0)
            {
                PlanProducto.GenerarDemandaDefault(productoSel.IdProducto);
            }
            Trucazos.vaciarDataGridView(dgvDemanda);
            foreach (PlanProducto dp in demandaProd)
            {
                Object[] row = { dp.IdPlanProducto, dp.IdPlanAgregado, dp.DemandaEstimada };
                dgvDemanda.Rows.Add(row);
            }
        }
コード例 #5
0
        private void dgvDemanda_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                PlanProducto pp;
                int          index          = dgvDemanda.SelectedRows[0].Index;
                var          celda          = dgvDemanda.Rows[index].Cells[0].Value.ToString();
                int          idPlanProducto = int.Parse(celda);
                pp = PlanProducto.GetPlanProductosById(idPlanProducto);

                EditDemanda editDemanda = new EditDemanda(this, pp);
                editDemanda.Show();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }