public static DataSet ExecuteRequest(XmlDocument req)
    {
        try
        {
            string cmd = GetCommandName(req);
            if (string.Compare(cmd, "get_list_of_olap_reports", true) == 0)
            {
                byte[] userIdBytes = GetCommandParameter(req, "user_id");
                long   userId      = BitConverter.ToInt64(userIdBytes, 0);

                // exec
                DataTable dt  = ReportSystem.GetReportHeaders(Convert.ToDecimal(userId), typeof(OlapReport)) as DataTable;
                DataSet   ret = new DataSet();
                ret.Tables.Add(dt);
                return(ret);
            }
            else if (string.Compare(cmd, "GetOlapReportResult", true) == 0)
            {
                byte[] reportIdBytes = GetCommandParameter(req, "report_id");
                long   reportId      = BitConverter.ToInt64(reportIdBytes, 0);

                // todo

                return(null);
            }
        }
        catch (Exception exc)
        {
            return(ExceptionResult(exc));
        }

        return(new DataSet());
    }
示例#2
0
 public static ReportSystemViewModel ToViewModel(this ReportSystem entity)
 {
     return(entity != null ? new ReportSystemViewModel
     {
         TotalReports = entity.TotalReports
     } : null);
 }
示例#3
0
 public void SetContextByMessage(CommunityChatMessage message)
 {
     this.m_message = message;
     this.m_destroyButton.SetActive(this.m_message.CanBeDestroyed());
     this.m_reportButton.SetActive(!this.m_message.CreatedBySelf() && ReportSystem.CanReportPlayer(this.m_message.GetAsPlayerLocation()));
     this.m_divider.SetActive(this.m_destroyButton.activeSelf && this.m_reportButton.activeSelf);
 }
示例#4
0
        public async Task <ReportSystem> GetTotalReportsbCountAsync(CancellationToken cancellationToken)
        {
            var query = from reports in this.context.Reports

                        select reports.Id;
            var result = await query.CountAsync(cancellationToken);

            var reportSystem = new ReportSystem
            {
                TotalReports = result
            };

            return(reportSystem);
        }
    public static string GetUserDataSources(XmlElement cmdEl)
    {
        decimal     userId = decimal.Parse(cmdEl.GetAttribute("USERID"));
        FIDataTable dt     = ReportSystem.GetReportHeaders(userId, typeof(OlapReport));

        XmlDocument doc    = new XmlDocument();
        XmlElement  rootEl = (XmlElement)doc.AppendChild(doc.CreateElement("DATASOURCES"));

        if (dt != null && dt.Rows.Count != 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                XmlElement el = (XmlElement)rootEl.AppendChild(doc.CreateElement("DATASOURCE"));
                el.SetAttribute("TYPE", "OLAP");
                el.SetAttribute("ID", dr["id"].ToString());
                el.SetAttribute("NAME", dr["name"].ToString());
                el.SetAttribute("DESCR", dr["description"].ToString());
            }
        }
        return(doc.OuterXml);
    }
 private bool CanOpenContextMenu()
 {
     return(!this.m_message.Destroyed && (this.m_message.CanBeDestroyed() || ReportSystem.CanReportPlayer(this.m_message.GetAsPlayerLocation())));
 }
 public static void GetOlapReportList(decimal userId)
 {
     ReportSystem.GetReportHeaders(userId, typeof(OlapReport));
 }
示例#8
0
        public void SendOffReport()
        {
            uint num = ReportSystem.InitiateReportPlayer(this.m_reasonForReport, new PlayerLocation?(this.m_reportedMessage.GetAsPlayerLocation()));

            ReportSystem.SendReportPlayer(num, this.m_inputField.text);
        }