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(); }
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(); }
protected void Page_Load(object sender, EventArgs e) { id = Request["id"]; Reaload_id = Request["Reaload_id"]; fb_id = Request["fb_id"]; num = Request["num"]; StringBuilder sb = new StringBuilder(); if ((id != "") && (id != null)) { BLL.BLLDefault BD = new BLL.BLLDefault(); sb.Append(BD.GetCapacity(DateTime.Now).ToString() + "," + BD.GetReaload(id, 1).ToString() + "," + BD.GetPower("1=1", DateTime.Now).ToString()); } else if ((Reaload_id != "") && (Reaload_id != null)) { BLL.BLLDefault BD = new BLL.BLLDefault(); sb.Append(BD.GetReaload(Reaload_id,Convert.ToInt32( num)).ToString()); } else if ((fb_id != "") && (fb_id != null)) { string str =""; if ((fb_id.Split(',')[1] != "") || (fb_id.Split(',')[2] != "")) { if (fb_id.Split(',')[1] != "") { str += " t_base_plant.T_COMID='" + fb_id.Split(',')[1] + "'"; } if ((fb_id.Split(',')[2] != "") && (fb_id.Split(',')[1] != "")) { str += " and t_base_plant.T_DEPID='" + fb_id.Split(',')[2] + "'"; } else if (fb_id.Split(',')[2] != "") { str += " t_base_plant.T_DEPID='" + fb_id.Split(',')[2] + "'"; } } else { str += " 1=1"; } BLL.BLLDefault BD = new BLL.BLLDefault(); sb.Append(BD.GetCapacityByDepid(str, DateTime.Now).ToString() + "," + BD.GetReaload("t_orgid='" + fb_id.Split(',')[1] + "'", 1).ToString() + "," + BD.GetPower(str, DateTime.Now).ToString()); } Response.Clear(); Response.Write(sb.ToString()); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { id = Request["id"]; Reaload_id = Request["Reaload_id"]; fb_id = Request["fb_id"]; num = Request["num"]; StringBuilder sb = new StringBuilder(); if ((id != "") && (id != null)) { BLL.BLLDefault BD = new BLL.BLLDefault(); sb.Append(BD.GetCapacity(DateTime.Now).ToString() + "," + BD.GetReaload(id, 1).ToString() + "," + BD.GetPower("1=1", DateTime.Now).ToString()); } else if ((Reaload_id != "") && (Reaload_id != null)) { BLL.BLLDefault BD = new BLL.BLLDefault(); sb.Append(BD.GetReaload(Reaload_id, Convert.ToInt32(num)).ToString()); } else if ((fb_id != "") && (fb_id != null)) { string str = ""; if ((fb_id.Split(',')[1] != "") || (fb_id.Split(',')[2] != "")) { if (fb_id.Split(',')[1] != "") { str += " t_base_plant.T_COMID='" + fb_id.Split(',')[1] + "'"; } if ((fb_id.Split(',')[2] != "") && (fb_id.Split(',')[1] != "")) { str += " and t_base_plant.T_DEPID='" + fb_id.Split(',')[2] + "'"; } else if (fb_id.Split(',')[2] != "") { str += " t_base_plant.T_DEPID='" + fb_id.Split(',')[2] + "'"; } } else { str += " 1=1"; } BLL.BLLDefault BD = new BLL.BLLDefault(); sb.Append(BD.GetCapacityByDepid(str, DateTime.Now).ToString() + "," + BD.GetReaload("t_orgid='" + fb_id.Split(',')[1] + "'", 1).ToString() + "," + BD.GetPower(str, DateTime.Now).ToString()); } Response.Clear(); Response.Write(sb.ToString()); Response.End(); }