Exemplo n.º 1
0
        public void BindData()
        {
            DB.Cloud cloud = new DB.Cloud();

            //DataTable dt_ServerAlertList = new DataTable();

            //서버리스트 읽어오기
            string MyServerList = "";

            cloud.SetCmd("Cloud");
            cloud.get_MyServerList(MemberNum);
            if (cloud.dsReturn.Tables[0].Rows.Count == 0)
            {
                return;
            }

            foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows)
            {
                MyServerList += dr["ServerNum"].ToString() + ",";
            }
            if (MyServerList.Length > 0)
            {
                MyServerList = MyServerList.Substring(0, MyServerList.Length - 1);
            }
            cloud.SetCmd("Cloud");
            int           nReturn  = cloud.get_ServerStatus(MyServerList);
            DataSet       ds       = cloud.dsReturn;
            List <string> dt_Group = new List <string>();

            if (ds != null)
            {
                dt_ServerList = Lib.ConvertingProc.w_Dashboard(ds.Tables[0]);
                var tmp_Group = from tbl in ds.Tables[0].AsEnumerable()
                                orderby tbl["DisplayGroup"] ascending
                                group tbl by tbl["DisplayGroup"] into tmp
                                select tmp;
                foreach (var i in tmp_Group)
                {
                    dt_Group.Add(i.Key.ToString());
                }
                tmp_Group = null;
            }
            else
            {
                return;
            }

            ds.Clear();
            ds.Dispose();

            rpt_ServerStatus.DataSource = dt_Group;
            rpt_ServerStatus.DataBind();

            dt_Group.Clear();
            //nReturn = cloud.W_AlertCountList(MemberNum, CompanyNum, numAlertDataDuration);
            //if (cloud.dsReturn != null)
            //{
            //    dt_ServerAlertList = cloud.dsReturn.Tables[0];
            //    var tmp_Group = from tbl in dt_ServerAlertList.AsEnumerable()
            //                    orderby tbl["DisplayGroup"] ascending
            //                    group tbl by tbl["DisplayGroup"] into tmp
            //                    select tmp;
            //    foreach (var i in tmp_Group)
            //    {

            //        SetAlertDic(dt_ServerAlertList, i.Key.ToString());
            //        dt_Group.Add(i.Key.ToString());
            //    }
            //    cloud.dsReturn.Clear();
            //    cloud.dsReturn.Dispose();
            //    tmp_Group = null;
            //}
            //else
            //{
            //    return;
            //}
            ////rpt_Alert.DataSource = dt_Group;
            ////rpt_Alert.DataBind();
            dt_Group.Clear();
            cloud.CloseCon();
        }