コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: duydp/WebviewChatBot
        protected void LoadData(string Keyword)
        {
            int PageNumber = int.Parse(ConfigurationManager.AppSettings["PageNumber"].ToString());
            int PageSize   = int.Parse(ConfigurationManager.AppSettings["PageSize"].ToString());

            string Authen_key = ConfigurationManager.AppSettings["Authen_key"].ToString();


            WSChatBot.CommonInfo wsINSUJ = new WSChatBot.CommonInfo();

            // Su dung WS insureJ theo dinh nghia

            wsINSUJ.Url = ConfigurationSettings.AppSettings["INSUJ_SERVICE_URL"].ToString();

            XmlDocument Xml = new XmlDocument();

            Xml.LoadXml(wsINSUJ.GetPolicyFireInfo(Authen_key, "", "", "", "", Keyword, PageNumber, PageSize));


            //int RowCount = 0;
            //int PageCount = 0;

            DataSet ds = new DataSet();

            ds.ReadXml(new XmlTextReader(new StringReader(Xml.DocumentElement.OuterXml)));


            DataTable dt = ds.Tables[0];

            if (dt.Columns.Count == 1 && dt.Rows[0]["DATA"].ToString() == "NO DATA FOUND")
            {
                //< i class='fa fa-warning'></i>
                lblWarningTableData.Text = "<div class='alert text-danger'>"
                                           + "<strong>Thông báo!</strong> Không tìm thấy dữ liệu</div>";

                //lblWarningTableData.Text= "<i class='fa fa-warning'></i> Không có dữ liệu";
                lblWarningTableData.Visible = true;
            }
            else
            {
                lblWarningTableData.Visible = false;

                //dt.Columns.Add("STT", typeof(string));

                //int i = 0;
                //foreach (DataRow dr in dt.Rows)
                //{
                //    i++;
                //    dr["STT"] = i.ToString();
                //}

                //RowCount = dt.Rows.Count * PageCount;

                Session["dtSelect"]   = dt;
                gvListData.DataSource = dt;
                gvListData.DataBind();
                gvListData.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }
コード例 #2
0
ファイル: Vessel.aspx.cs プロジェクト: duydp/WebviewChatBot
        protected void LoadData(string KeywordSearch)
        {
            int    PageNumber = int.Parse(ConfigurationManager.AppSettings["PageNumber"].ToString());
            int    PageSize   = int.Parse(ConfigurationManager.AppSettings["PageSize"].ToString());
            string Authen_key = ConfigurationManager.AppSettings["Authen_key"].ToString();

            WSChatBot.CommonInfo wsINSUJ = new WSChatBot.CommonInfo();
            wsINSUJ.Url     = ConfigurationSettings.AppSettings["INSUJ_SERVICE_URL"].ToString();
            wsINSUJ.Timeout = 1000000;
            XmlDocument Xml = new XmlDocument();

            if (ServiceType == "tau_sodon")
            {
                Xml.LoadXml(wsINSUJ.GetPolicyVesselInfo(Authen_key, KeywordSearch, "", "", "", "", "", PageNumber, PageSize));
            }

            if (ServiceType == "tau_ten")
            {
                Xml.LoadXml(wsINSUJ.GetPolicyVesselInfo(Authen_key, "", "", "", "", KeywordSearch, "", PageNumber, PageSize));
            }

            if (ServiceType == "tau_imo")
            {
                Xml.LoadXml(wsINSUJ.GetPolicyVesselInfo(Authen_key, "", "", "", "", "", KeywordSearch, PageNumber, PageSize));
            }

            DataSet ds = new DataSet();

            ds.ReadXml(new XmlTextReader(new StringReader(Xml.DocumentElement.OuterXml)));
            DataTable dt = ds.Tables[0];

            if (dt.Columns.Count == 1 && dt.Rows[0]["DATA"].ToString() == "NO DATA FOUND")
            {
                lblWarningTableData.Text = "<div class='alert text-danger'>"
                                           + "<strong>Thông báo!</strong> Không tìm thấy dữ liệu</div>";

                lblWarningTableData.Visible = true;
            }
            else
            {
                lblWarningTableData.Visible = false;
                Session["dtSelect"]         = dt;
                gvListData.DataSource       = dt;
                gvListData.DataBind();
                gvListData.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }