Пример #1
0
        private void GetPlant(string id)
        {
            string fz = "", fs = "", wd = "", sd = "", gl = "";

            BLL.BLLSBLB sb = new BLL.BLLSBLB();

            StringBuilder st  = new StringBuilder();
            DataTable     dt  = sb.GetPoint(id);
            string        str = sb.GetPointRealValue(id);

            if (str != "")
            {
                gl = str.Split(',')[0];
                fz = str.Split(',')[1];
                sd = str.Split(',')[2];
                wd = str.Split(',')[3];
                fs = str.Split(',')[4];
            }
            string s = "{\"gl\":[" + str.Split(',')[0] + "]}";

            BLL.BLLDefault df   = new BLL.BLLDefault();
            string         d_dl = sb.GetElcValue("1", id).ToString("f0");
            // string m_dl = sb.GetElcValue("2", id).ToString("f0");
            string y_dl = sb.GetElcValue("3", id).ToString("f0");
            string day  = "{\"day\":[" + d_dl + "]}";
            //string mon = "{\"mon\":[" + m_dl + "]}";
            string rz  = "{\"rz\":[" + y_dl + "]}";
            double rl  = df.GetCapacityByDepid("t_plantid ='" + id + "'", DateTime.Now);
            double num = sb.GerUnitNum("t_plantid ='" + id + "'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                st.Append("<input name=\"btn" + i + 1 + "\" type=\"button\" value=\"" + dt.Rows[i]["t_patitionname"].ToString() + "\" class=\"button\" onclick=\"query('" + dt.Rows[i]["T_PATITIONID"].ToString() + "')\" />");
            }
            object obj = new
            {
                fj_count = num,
                fz       = fz, //辐照
                sd       = sd, //湿度
                wd       = wd, //温度
                fs       = fs, //风速
                rl       = rl, //容量
                gl       = gl,
                glb      = s,
                d_dl     = d_dl,
                // m_dl = m_dl,
                y_dl = y_dl,
                day  = day,
                //mon = mon,
                rz = rz,
                tb = st.ToString()
            };

            string result = Newtonsoft.Json.JsonConvert.SerializeObject(obj);

            Response.Write(result);
            Response.End();
        }
Пример #2
0
        private void GetPlant(string id)
        {
            string fz = "",fs="",wd="",sd="",gl="";
            BLL.BLLSBLB sb = new BLL.BLLSBLB();

            StringBuilder st = new StringBuilder();
            DataTable dt = sb.GetPoint(id);
            string str = sb.GetPointRealValue(id);
            if (str != "")
            {
                gl = str.Split(',')[0];
                fz = str.Split(',')[1];
                sd=str.Split(',')[2];
                wd=str.Split(',')[3];
                fs = str.Split(',')[4];
            }
            string s = "{\"gl\":[" + str.Split(',')[0] + "]}";
            BLL.BLLDefault df = new BLL.BLLDefault();
            string d_dl = sb.GetElcValue("1", id).ToString("f0");
               // string m_dl = sb.GetElcValue("2", id).ToString("f0");
            string y_dl = sb.GetElcValue("3", id).ToString("f0");
            string day = "{\"day\":[" + d_dl + "]}";
            //string mon = "{\"mon\":[" + m_dl + "]}";
            string rz = "{\"rz\":[" + y_dl + "]}";
            double rl= df.GetCapacityByDepid("t_plantid ='"+id+"'",DateTime.Now);
            double num = sb.GerUnitNum("t_plantid ='" + id + "'");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                st.Append("<input name=\"btn" + i + 1 + "\" type=\"button\" value=\"" + dt.Rows[i]["t_patitionname"].ToString() + "\" class=\"button\" onclick=\"query('" + dt.Rows[i]["T_PATITIONID"].ToString() + "')\" />");
            }
            object obj = new
            {
                fj_count = num,
                fz = fz,//辐照
                sd = sd,//湿度
                wd = wd,//温度
                fs = fs,//风速
                rl =rl,//容量
                gl = gl,
                glb = s,
                 d_dl = d_dl,
            // m_dl = m_dl,
             y_dl = y_dl,
             day = day,
             //mon = mon,
             rz = rz,
                tb = st.ToString()
            };

            string result = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
            Response.Write(result);
            Response.End();
        }
Пример #3
0
        //初始化风机信息
        private void GetInit(string id)
        {
            BLL.BLLSBLB sb = new BLL.BLLSBLB();
            ArrayList   ld = sb.GetPOINTS_UNIT(id);

            st.Append("<table height=\"100%\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
            st.Append("<tr><td colspan=\"2\" style=\"background-image:url(../img/SY_CZ_bg_1.jpg); height:5px;\"></td></tr>");
            st.Append("<tr><td><div><table height=\"100%\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
            for (int i = 1; i <= ld.Count; i++)
            {
                if ((i == 0) && (i % 5 == 0))
                {
                    st.Append("<tr>");
                }
                //else if ((i % 5 == 1)&&(i!=1))
                //{
                //    st.Append("<tr>");
                //}
                st.Append("<td class=\"div_1\"><div class=\"div_top_1\">#" + (i) + "</div><div class=\"div_top_2\">" + sb.GetPointValue(ld[i - 1].ToString()) + "</td>");
                if ((i != 0) && (i % 5 == 0))
                {
                    st.Append("</tr><tr>");
                }
            }



            st.Append("</tr></table></div></td></tr></table>");

            object obj = new
            {
                tb = st.ToString()
            };

            string result = Newtonsoft.Json.JsonConvert.SerializeObject(obj);

            Response.Write(result);
            Response.End();
        }
Пример #4
0
        //初始化风机信息
        private void GetInit(string id)
        {
            BLL.BLLSBLB sb = new BLL.BLLSBLB();
            ArrayList ld= sb.GetPOINTS_UNIT(id);

            st.Append("<table height=\"100%\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
            st.Append("<tr><td colspan=\"2\" style=\"background-image:url(../img/SY_CZ_bg_1.jpg); height:5px;\"></td></tr>");
            st.Append("<tr><td><div><table height=\"100%\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
            for (int i = 1; i <= ld.Count; i++)
            {
                if ((i == 0) && (i % 5 == 0))
                {
                    st.Append("<tr>");
                }
                //else if ((i % 5 == 1)&&(i!=1))
                //{
                //    st.Append("<tr>");
                //}
                st.Append("<td class=\"div_1\"><div class=\"div_top_1\">#" +(i) + "</div><div class=\"div_top_2\">" + sb.GetPointValue(ld[i-1].ToString()) + "</td>");
                if((i!=0)&& (i % 5 == 0))
                {
                    st.Append("</tr><tr>");
                }

            }

            st.Append("</tr></table></div></td></tr></table>");

            object obj = new
            {
                tb = st.ToString()
            };

            string result = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
            Response.Write(result);
            Response.End();
        }