Beispiel #1
0
    private static void agregarChecks(Dictionary <string, object> Checks, CConexion pConexion, int IdLevantamiento)
    {
        CLevantamientoCheck       check       = new CLevantamientoCheck();
        CLevantamientoChecklist   checklist   = new CLevantamientoChecklist();
        CLevantamientoChecklistOp checklistop = new CLevantamientoChecklistOp();

        Dictionary <string, object> Parametros = new Dictionary <string, object>();

        for (int index = 1; index <= 170; index++)
        {
            //Parametros.Clear();
            //Parametros.Add("IdLevantamientoChecklistOp",index);
            checklistop.LlenaObjeto(index, pConexion);

            check.IdLevantamiento            = IdLevantamiento;
            check.IdLevantamientoChecklist   = checklistop.IdLevantamientoChecklist;
            check.IdLevantamientoChecklistOp = index;
            check.Cantidad      = Convert.ToInt32(Checks["cantidad" + index]);
            check.Observaciones = Convert.ToString(Checks["Observacion" + index]);
            check.SINO          = Convert.ToBoolean(Checks["sino" + index]);

            check.Agregar(pConexion);
            checklistop = new CLevantamientoChecklistOp();
        }
    }
Beispiel #2
0
    public static JArray ObtenerJsonChecksLevantamiento(int pIdLevantamiento, int pIdCheckEncabezado, CConexion pConexion)
    {
        JArray JAChecks  = new JArray();
        JArray JAChecks2 = new JArray();
        bool   activo    = false;

        Dictionary <string, object> Parametros = new Dictionary <string, object>();

        Parametros.Add("IdLevantamiento", pIdLevantamiento);
        Parametros.Add("IdLevantamientoChecklist", pIdCheckEncabezado);

        CLevantamientoCheck       checkOp     = new CLevantamientoCheck();
        CLevantamientoChecklistOp checklistOp = new CLevantamientoChecklistOp();

        foreach (CLevantamientoCheck oCheckOp in checkOp.LlenaObjetosFiltros(Parametros, pConexion))
        {
            JObject JCheckOp = new JObject();

            Parametros.Clear();
            checklistOp.LlenaObjeto(oCheckOp.IdLevantamientoChecklistOp, pConexion);

            JCheckOp.Add("IdCheck", checklistOp.IdLevantamientoChecklistOp);
            JCheckOp.Add("Check", oCheckOp.SINO);
            JCheckOp.Add("Descripcion", checklistOp.Descripcion);
            JCheckOp.Add("Cantidad", oCheckOp.Cantidad);
            JCheckOp.Add("Observacion", oCheckOp.Observaciones);

            if (oCheckOp.Observaciones != "")
            {
                activo = true;//JAChecks.Add("1");
            }
            JAChecks.Add(JCheckOp);
        }

        if (activo)
        {
            JAChecks2.Add("1");
        }

        for (int i = 0; i < JAChecks.Count; i++)
        {
            JAChecks2.Add(JAChecks[i]);
        }

        return(JAChecks2);
    }
Beispiel #3
0
    private static void editarChecks(Dictionary <string, object> Checks, CConexion pConexion, int IdLevantamiento)
    {
        CLevantamientoCheck check = new CLevantamientoCheck();

        Dictionary <string, object> Parametros = new Dictionary <string, object>();

        for (int index = 1; index <= 170; index++)
        {
            Parametros.Clear();
            Parametros.Add("IdLevantamiento", IdLevantamiento);
            Parametros.Add("IdLevantamientoChecklistOp", index);
            check.LlenaObjetoFiltros(Parametros, pConexion);

            check.Cantidad      = Convert.ToInt32(Checks["cantidad" + index]);
            check.Observaciones = Convert.ToString(Checks["Observacion" + index]);
            check.SINO          = Convert.ToBoolean(Checks["sino" + index]);

            check.Editar(pConexion);
        }
        check = new CLevantamientoCheck();
    }