Esempio n. 1
0
    private void cargarPlantas()
    {
        Dictionary <string, object> parametersP = new Dictionary <string, object>();

        parametersP.Add("@ACTION", 2);
        DataTable dtPlantas = dempaque.executeStoreProcedureDataTable("ev2_spr_get_PackFarms", parametersP);

        CommonReportAudit.FillDropDownList(ref ddlPlant, dtPlantas);
    }
Esempio n. 2
0
    public static string paintHtmlTable(int IDWareHouse, int xlength, int ylength, DataTable dtInformation, string sLiClass, string WareHouseName, string sDivClass, DataTable dtSemaforo, DataTable dtExtraHours, string identificador)
    {
        if (xlength < 1 && ylength < 1)
        {
            return(string.Empty);
        }

        if (dtInformation == null || dtInformation.Rows.Count < 1)
        {
            return(paintHtmlTableNoTable(IDWareHouse, xlength, ylength, WareHouseName, sDivClass));
        }

        StringBuilder sbTable   = new StringBuilder();
        string        tblOpen   = "<table class=\"tableWareHouseClass\">";
        string        tblClose  = "</table>";
        string        trClose   = "</tr>";
        string        trOpen    = "<tr>";
        string        tdClose   = "</td>";
        string        tdOpen    = "<td>";
        string        spanOpen  = "<span>";
        string        spanClose = "</span>";

        int iCount = 0;

        sbTable.Append(tblOpen);
        sbTable.Append(trOpen);
        sbTable.Append(tdOpen);
        sbTable.Append(tdClose);

        for (int i = 0; i < xlength; i++)
        {
            sbTable.AppendFormat("{0}{1}{2}{3}{4}", tdOpen, spanOpen, Convert.ToChar(Convert.ToInt32(('A' + i).ToString())), spanClose, tdClose);
        }

        sbTable.Append(trClose);

        DataRow[] drResult = null;

        for (int y = 1; y <= ylength; y++)
        {
            //Open new Row ( TR )
            sbTable.Append(trOpen);
            sbTable.AppendFormat("{0}{1}{2}{3}{4}", tdOpen, spanOpen, (y).ToString(), spanClose, tdClose);
            for (int x = 1; x <= xlength; x++)
            {
                sbTable.AppendFormat("{0} class=\"tdBorderBig\" >", tdOpen.Substring(0, tdOpen.Length - 1));

                //Si ya no hay filas no buscar y asignar nulo
                drResult = iCount < dtInformation.Rows.Count ? dtInformation.Select(string.Format("XPosition = {0} AND YPosition = {1}", x, y)) : null;

                //Paint Div Container Dropable
                sbTable.AppendFormat("<div id=\"IDDrop-{0}-{1}-{2}\" class=\"classGray {3}\">", IDWareHouse, x, y, sDivClass);
                if (drResult != null && drResult.Length > 0)
                {
                    //Paint li Dragable
                    sbTable.Append("<ul class='ui-helper-reset'>");

                    foreach (DataRow item in drResult)
                    {
                        //sbTable.Append(liPreformated(item["Folio"].ToString(), item["TimeIn"].ToString(), item["SKU"].ToString()
                        //        , item["GreenHouse"].ToString(), item["internalID"].ToString(), item["internalQty"].ToString(), sLiClass, item["internalProductClass"].ToString()));
                        /*Obtener TimeIn para compararlo con semáforo*/
                        //TODO ALEX Poner Maximo tiempo
                        sbTable.Append(liPreformated(item, sLiClass, CommonReportAudit.getHexColorFromSemaphore(dtSemaforo, dtExtraHours, item["GreenHouse"].ToString(), item["Folio"].ToString(), (int)item["TimeIn"]), CommonReportAudit.getMaxTimeToRed(dtSemaforo, dtExtraHours, item["GreenHouse"].ToString(), item["Folio"].ToString()), identificador));
                        //sbTable.Append(liPreformated(item, sLiClass));
                        iCount++;
                    }
                    sbTable.Append("</ul>");
                }
                //Close Div Container Droppable
                sbTable.Append("</div>");
                sbTable.Append(tdClose);
            }
            sbTable.Append(trClose);
        }
        //Paint The Name, Set it down the table
        sbTable.Append(trOpen);
        sbTable.Append(tdOpen);
        sbTable.Append(tdClose);
        sbTable.AppendFormat("<td class=\"tdClassNameWareHouse\" colspan=\"{0}\">{1}{2}", xlength, WareHouseName, tdClose);
        sbTable.Append(trClose);

        sbTable.Append(tblClose);

        return(sbTable.ToString());
    }