public StoredReport GetCompiledReport(PreviewItemContext context)
        {
            ReportID     key    = new ReportID(context);
            StoredReport result = default(StoredReport);

            this.m_compiledReports.TryGetValue(key, out result);
            return(result);
        }
예제 #2
0
        protected override void Execute(CodeActivityContext context)
        {
            int id = ReportID.Get(context);
            ReportStatusType stat = Status.Get(context);

            var ctx    = new DAL.SwitchContext();
            var report = ctx.Switches.Where((r) => r.Id == id).SingleOrDefault();

            report.Status = (byte)stat;

            ctx.SaveChanges();
        }
예제 #3
0
 public static byte[] TimeToOutputData(DateTime time, ReportID timeType)
 {
     byte[] timeData = TimeToData(time);
     byte[] data     = new byte[timeData.Length + 2];
     data[0] = 0; // первый байт теряется почему-то
     data[1] = (byte)timeType;
     for (int i = 0; i < timeData.Length; i++)
     {
         data[i + 2] = timeData[i];
     }
     return(data);
 }
			public override bool Equals(object obj)
			{
				ReportID reportID = obj as ReportID;
				if (reportID == null)
				{
					return false;
				}
				if (reportID.Source == Source && string.Compare(reportID.Name, Name, StringComparison.OrdinalIgnoreCase) == 0)
				{
					return reportID.EmbeddedResourceAssembly == EmbeddedResourceAssembly;
				}
				return false;
			}
예제 #5
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            if (ReportID.EditValue == null || ReportID.EditValue.ToString() == "0")
            {
                Mess.Info("Please select a report!");
                ReportID.ShowPopup();
                return;
            }

            using (var db = DB.GetContext())
            {
                uint     reportID  = Convert.ToUInt32(ReportID.EditValue);
                uint[]   companies = CompanyID.GetCheckedValues();
                uint[]   locations = LocationID.GetCheckedValues();
                uint[]   drivers   = DriverID.GetCheckedValues();
                DateTime fromDt    = FromDate.DateTime;
                DateTime toDt      = ToDate.DateTime;

                var report = ReportRepository.GenerateReport(db, reportID, companies, locations, drivers, fromDt, toDt);
                //report.DataSource.WriteXmlSchema("D:\\schema.xml");
                ReportBinder.ShowReport(report);
            }
        }
        public void SetCompiledReport(PreviewItemContext context, StoredReport storedReport)
        {
            ReportID key = new ReportID(context);

            this.m_compiledReports[key] = storedReport;
        }
		public StoredReport GetCompiledReport(PreviewItemContext context)
		{
			ReportID key = new ReportID(context);
			m_compiledReports.TryGetValue(key, out StoredReport value);
			return value;
		}
예제 #8
0
        public void GetReportURL()
        {
            try
            {
                if (String.IsNullOrEmpty(CustomerName))
                {
                    throw new Exception(Print("GetReportURL [CustomerName='']", null));
                }
                if (RptID == 0)
                {
                    throw new Exception(Print("GetReportURL [RptID=0]", null));
                }
                if (Connected)
                {
                    if (String.IsNullOrEmpty(ReportTitle))
                    {
                        throw new Exception(Print("GetReportURL [ReportTitle='']", null));
                    }
                    if (String.IsNullOrEmpty(AnalystName))
                    {
                        throw new Exception(Print("GetReportURL [AnalystName='']", null));
                    }
                    Conn.OpenConn();
                    if (Conn.ConnOpened())
                    {
                        URLDomain = Call("auto.get_conf", "cst_name:" + CustomerName, "conf_name:" + "export_url_domain");
                        string profileParam = "";
                        if (ReportProfile != "")
                        {
                            profileParam = "&profile=" + ReportProfile;
                        }
                        string CompileURL = URLDomain + "/portal/auto/reports/update.php?customer_name=" + CustomerName + "&rpt_id=" + RptID.ToString() + "&rpt_title=" + ReportTitle + "&rpt_obs=" + ReportObs + "&rpt_analyst=" + AnalystName + profileParam;

                        HttpWebRequest  request   = (HttpWebRequest)WebRequest.Create(CompileURL);
                        HttpWebResponse response  = (HttpWebResponse)request.GetResponse();
                        string          URLReturn = new StreamReader(response.GetResponseStream()).ReadToEnd();
                        if (URLReturn.Contains("[Done]"))
                        {
                            Print("  Relatório gerado com sucesso! Clique no link abaixo:", null);
                            Print("    " + URLDomain + "/portal/auto/reports/" + CustomerName + "/" + RptID.ToString(), null);
                        }
                        else
                        {
                            Print("  Relatório gerado com erro!", null);
                            Print(CompileURL, null);
                        }
                    }
                    Conn.CloseConn();
                }
                else
                {
                    Print("  Teste executado, porém o relatório não foi atualizado. Clique no link abaixo para acessar o último relatório disponível:", null);
                    Print("    " + URLDomain + "/portal/auto/reports/" + CustomerName + "/" + ReportID.ToString(), null);
                }
            }
            catch (Exception ex)
            {
                Print("Exception at GetReportURL", ex);
            }
        }