Esempio n. 1
0
        public string GetData(string id)
        {
            BLL.BLLDefault bll_df = new BLL.BLLDefault();
            DBLink dl = new DBLink();
            string errMsg = "";
            string sql = "select * from t_info_graphic where t_graphicid ='"+id+"'";

            DataTable dtt = new DataTable();//select * from t_info_graphic where t_graphicid ='1' order by t_controlid asc
            DataTable dt = dl.RunDataTable(sql, out errMsg);
            string str = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {//select * from (select * from t_info_histvalue where T_TAG='GHPV_1_000WG001' order by t_time desc) where ROWNUM =1 order by ROWNUM asc
               // string sql_value = "select * from (select * from t_info_histvalue where T_TAG='" + dt.Rows[i]["t_tag"].ToString() + "' order by t_time desc) where ROWNUM =1 order by ROWNUM asc";

                dtt = bll_df.GetDT(dt.Rows[i]["t_tag"].ToString(),DateTime.Now);
                if ((dtt.Rows.Count > 0) && (dtt.Rows[0]["D_VALUE"].ToString() !=""))
                {

                    str += dt.Rows[i]["t_controlid"].ToString() + "," + Convert.ToDouble( dtt.Rows[0]["D_VALUE"].ToString()).ToString("f2") + ";";
                }
                else
                {
                    str += dt.Rows[i]["t_controlid"].ToString() + ",0;";
                }

            }

            return str;
        }
Esempio n. 2
0
        public string GetData(string id)
        {
            BLL.BLLDefault bll_df = new BLL.BLLDefault();
            DBLink         dl     = new DBLink();
            string         errMsg = "";
            string         sql    = "select * from t_info_graphic where t_graphicid ='" + id + "'";


            DataTable dtt = new DataTable();//select * from t_info_graphic where t_graphicid ='1' order by t_controlid asc
            DataTable dt  = dl.RunDataTable(sql, out errMsg);
            string    str = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {//select * from (select * from t_info_histvalue where T_TAG='GHPV_1_000WG001' order by t_time desc) where ROWNUM =1 order by ROWNUM asc
             // string sql_value = "select * from (select * from t_info_histvalue where T_TAG='" + dt.Rows[i]["t_tag"].ToString() + "' order by t_time desc) where ROWNUM =1 order by ROWNUM asc";

                dtt = bll_df.GetDT(dt.Rows[i]["t_tag"].ToString(), DateTime.Now);
                if ((dtt.Rows.Count > 0) && (dtt.Rows[0]["D_VALUE"].ToString() != ""))
                {
                    str += dt.Rows[i]["t_controlid"].ToString() + "," + Convert.ToDouble(dtt.Rows[0]["D_VALUE"].ToString()).ToString("f2") + ";";
                }
                else
                {
                    str += dt.Rows[i]["t_controlid"].ToString() + ",0;";
                }
            }

            return(str);
        }
Esempio n. 3
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();
        }
Esempio n. 4
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();
        }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (HttpContext.Current.Request.Cookies["T_USERID"] != null)
     {
         string      id = HttpContext.Current.Request.Cookies["T_USERID"].Value;
         BLL.BLLRole br = new BLL.BLLRole();
         User_id = br.GetRoleId(id);
     }
     BLL.BLLDefault BD = new BLL.BLLDefault();
     this.lbl_Capacity.Text = BD.GetCapacity(DateTime.Now).ToString();
     this.lbl_Reaload.Text  = BD.GetReaload("1=1", 1).ToString();
     this.lbl_Power.Text    = BD.GetPower("1=1", DateTime.Now).ToString();
 }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (HttpContext.Current.Request.Cookies["T_USERID"] != null)
     {
         string id = HttpContext.Current.Request.Cookies["T_USERID"].Value;
          BLL.BLLRole br = new BLL.BLLRole();
          User_id = br.GetRoleId(id);
     }
     BLL.BLLDefault BD = new BLL.BLLDefault();
     this.lbl_Capacity.Text = BD.GetCapacity(DateTime.Now).ToString();
     this.lbl_Reaload.Text = BD.GetReaload("1=1", 1).ToString();
     this.lbl_Power.Text = BD.GetPower("1=1",DateTime.Now).ToString();
 }
Esempio n. 7
0
        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();
        }
Esempio n. 8
0
        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();
        }