コード例 #1
0
ファイル: Report.aspx.cs プロジェクト: weddingjuma/Guardian
        protected void btnReports_Click(object sender, EventArgs e)
        {
            //btnReports.Visible = false;
            try
            {
                string AuthToken = AuthID.Value;
                string UserType  = UType.Value;

                ServiceProxy _serviceProxy = new ServiceProxy();
                lblUserCount.Text = "0";

                lblMissed.Text    = _serviceProxy.MissedActivationCount(AuthToken, UserType).ToString();
                lblUserCount.Text = _serviceProxy.UserCount(AuthToken, UserType).ToString();

                gvGroups.DataSource = _serviceProxy.GroupUsers(AuthToken, UserType);
                gvGroups.DataBind();

                grdActiveSOS.DataSource = _serviceProxy.ActiveSOSData(AuthToken, UserType);
                grdActiveSOS.DataBind();
            }

            catch (Exception ex)
            {
            }
        }
コード例 #2
0
        public void GetReport()
        {
            ServiceProxy _serviceProxy = new ServiceProxy();

            try
            {
                // btnReports.Visible = false;

                AuthToken = AuthID.Value;
                UserType  = UType.Value;

                var    sosList     = _serviceProxy.ActiveSOSData(AuthToken, UserType);
                string tablestring = "";
                // tablestring = tablestring + "<table width=\"100%\"><tr  style=\"background:#E2EBFC\"> <td colspan=\"5\" style=\"text-align:center;\"><b> <font color=\"black\" size=\"5\">  Active SOS Sessions Report </font></b></td>";

                if (sosList.Count != 0)
                {
                    tablestring = tablestring + "<table width=\"100%\"><tr style=\"background:#dcdcdc\"><td><b>SNo</b></td><td><b>UserName</b></td><td><b>MobileNumber</b></td><td><b>StartTime</b></td><td><b>GroupName</b></td><td><b>Action</b></td></tr>";
                    foreach (var sos in sosList)
                    {
                        tablestring = tablestring + "<tr style=\"background:#f5f5f5\"><td >" + sos.SNo + "</td><td>" + sos.UserName + "</td><td>" + sos.MobileNumber + "</td><td>" + sos.StartTime + "</td><td>" + sos.GroupName + "</td><td>" + "<button id='Stop SOS' onclick=\"sosJSFunction('" + sos.ProfileId + "')\">Stop SOS</button>" + "</td></tr>";
                    }
                }
                else
                {
                    tablestring = tablestring + "<tr style=\"background:#dcdcdc\"><td colspan=\"5\"> No Active SOS alerts available at Present </td></tr>";
                }
                tablestring   = tablestring + "</table>";
                lblTable.Text = tablestring;
            }


            catch (Exception ex)
            {
            }
        }