public static bool HasFlag(this ReportState state, ReportState value) { var obj = (int)state; var toCheck = (int)value; return((obj & toCheck) == toCheck); }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { //rptdoc.Close(); //rptdoc.Dispose(); //GC.Collect(); rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("EFSubmitted.rpt")); rptdoc.SetDataSource(dt); ExamFormSubmitted.ReportSource = rptdoc; // UpdateSectionHeight(rptdoc, "GroupHeaderSection1", 2400); paramField.Name = "title"; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); ExamFormSubmitted.ParameterFieldInfo = paramFields; ExamFormSubmitted.EnableDatabaseLogonPrompt = false; ExamFormSubmitted.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { ExamFormSubmitted.Visible = false; } catch (CrystalReportsException ex) { ExamFormSubmitted.Visible = false; Response.Write(ex); } catch (IndexOutOfRangeException ex) { ExamFormSubmitted.Visible = false; } catch (SqlException ex) { ExamFormSubmitted.Visible = false; } catch (ArgumentNullException ex) { ExamFormSubmitted.Visible = false; } catch (COMException ex) { Response.Redirect("../../Login.aspx"); } } else { ExamFormSubmitted.ReportSource = (ReportDocument)Session["cr"]; } }
public void ReportStateAsync(string host, Guid clientId, bool isMining) { Task.Factory.StartNew(() => { TimeSpan timeSpan = TimeSpan.FromSeconds(3); try { using (HttpClient client = new HttpClient()) { client.Timeout = timeSpan; ReportState request = new ReportState { ClientId = clientId, IsMining = isMining }; Task <HttpResponseMessage> message = client.PostAsJsonAsync($"http://{host}:{WebApiConst.ControlCenterPort}/api/{SControllerName}/{nameof(IReportController.ReportState)}", request); Write.DevDebug($"{nameof(ReportStateAsync)} {message.Result.ReasonPhrase}"); } } catch (Exception e) { if (e is TaskCanceledException) { Write.DevError($"本次ReportStateAsync已取消,因为耗时超过{timeSpan.TotalSeconds}秒"); } else { e = e.GetInnerException(); Logger.ErrorDebugLine(e.Message, e); } } }); }
/// <summary> /// Writes a report group /// </summary> public void WriteReportGroup(ICombatGroup group, bool isAttacker, ReportState state) { WriteBeginReport(); if (state != ReportState.Staying) { SnappedImportantEvent = true; } // Holds the id of the group for the current battle report uint reportedGroupId; bool alreadySnapped = ReportedGroups.TryGetValue(group, out reportedGroupId); if (!alreadySnapped) { // Snap the group reportedGroupId = battleReportWriter.SnapGroup(ReportId, group, state, isAttacker); ReportedGroups[group] = reportedGroupId; } else if (state != ReportState.Staying) { battleReportWriter.SnapGroupState(reportedGroupId, group, state); } // Snap each object in the group foreach (var combatObject in group) { battleReportWriter.SnapCombatObject(reportedGroupId, combatObject); } }
public TextLogTarget(Action <int, LogType, int, string> write, int threadIndex = 0) { m_lock = new object(); m_state = new ReportState(threadIndex, m_prefixFun(threadIndex)); m_stateTable = new Dictionary <int, ReportState>(); WriteAct = write; }
public void Log(int threadIndex, LogMsg msg) { if (msg.Level > Verbosity) { return; } if (!Synchronized) { Log(msg); return; } lock (m_lock) { if (threadIndex != m_state.TIdx) { if (m_state.Level <= Verbosity && m_state.Buffer.Length > 0 && !LogCompleteLinesOnly) { WriteAct(m_state.TIdx, m_state.Type, m_state.Level, "\n"); // crlf for clean start m_state.DoneCount = 0; // trigger the line to be printed again by the thread later } if (!m_stateTable.TryGetValue(threadIndex, out m_state)) { m_stateTable[threadIndex] = m_state = new ReportState(threadIndex, m_prefixFun(threadIndex)); } } Log(msg); } }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("ApplicationStatusSumCrt.rpt")); rptdoc.SetDataSource(dt); ApplicationStatusSum.ReportSource = rptdoc; paramField.Name = "tittle"; // paramDValue.Value =""; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); ApplicationStatusSum.ParameterFieldInfo = paramFields; ApplicationStatusSum.EnableDatabaseLogonPrompt = false; ApplicationStatusSum.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { ApplicationStatusSum.Visible = false; // lblExceptioN.Text = ""; } catch (CrystalReportsException ex) { ApplicationStatusSum.Visible = false; Response.Write(ex); } catch (IndexOutOfRangeException ex) { ApplicationStatusSum.Visible = false; // lblExceptioN.Text = "Null Value ."; } catch (SqlException ex) { ApplicationStatusSum.Visible = false; // lblExceptioN.Text = "Null Value ."; } catch (ArgumentNullException ex) { ApplicationStatusSum.Visible = false; // lblExceptioN.Text = "Null Value ."; } catch (COMException ex) { Response.Redirect("../../Login.aspx"); } } else { ApplicationStatusSum.ReportSource = (ReportDocument)Session["cr"]; } }
public void LoadReport(ReportState rptState, CrystalDecisions.Web.CrystalReportViewer crivew, string report) { if (rptState != ReportState.FromPostBack) { try { rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath(report)); rptdoc.SetDataSource(dt); crivew.ReportSource = rptdoc; paramField.Name = "title"; paramDValue.Value = "Date:" + txtDate1.Text.ToString() + " To " + txtDate2.Text; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); crivew.ParameterFieldInfo = paramFields; crivew.EnableDatabaseLogonPrompt = false; crivew.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { crivew.Visible = false; } catch (CrystalReportsException ex) { crivew.Visible = false; Response.Write(ex); } catch (IndexOutOfRangeException ex) { crivew.Visible = false; Response.Write(ex); } catch (SqlException ex) { crivew.Visible = false; Response.Write(ex); } catch (ArgumentNullException ex) { crivew.Visible = false; Response.Write(ex); } catch (COMException ex) { Response.Redirect("../../Login.aspx"); } } else { crivew.ReportSource = (ReportDocument)Session["cr"]; } }
public void LoadReport(ReportState rptState) { Rptdoc = new ReportDocument(); try { string st; string str; if (rptState != ReportState.FromPostBack) { Reportdata data = new Reportdata(); if (ddlStatus.SelectedValue == "Approved") { st = "select * from Apprecord where Session='" + ddlSession.SelectedValue + txtYear.Text + "' and FormType like '%" + ddlSelect.SelectedValue + "%' and Status!='NotApproved' and Status!='Hold' order by AppNo"; str = ddlSession.SelectedValue + txtYear.Text + " " + ddlSelect.SelectedValue + " Approved"; } else { st = "select * from Apprecord where Session='" + ddlSession.SelectedValue + txtYear.Text + "' and FormType like '%" + ddlSelect.SelectedValue + "%' and Status='" + ddlStatus.SelectedValue + "' order by AppNo"; str = ddlSession.SelectedValue + txtYear.Text + " " + ddlSelect.SelectedValue + " " + ddlStatus.SelectedValue; } string FileName = "FormTypeCrt.rpt"; data.Report(Rptdoc, str, con, st, FileName, FormType); Session["cr"] = Rptdoc; } else { FormType.ReportSource = (ReportDocument)Session["cr"]; } } catch (Exception ex) { FormType.Visible = false; } }
public void ReportStateAsync(Guid clientId, bool isMining) { ReportState request = new ReportState { ClientId = clientId, IsMining = isMining }; RpcRoot.FirePostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IReportController.ReportState), null, request, null, 5000); }
public ReportState RunGenareteReport(ReportType reportType, ReportTimePeriod timePeriod, Guid[] managers) { var reportData = GetReportData(reportType, timePeriod, managers); if (reportData == null) { throw new Exception(CRMReportResource.ErrorNullReportData); } var tmpFileName = DocbuilderReportsUtility.TmpFileName; var script = GetReportScript(reportData, reportType, tmpFileName); if (string.IsNullOrEmpty(script)) { throw new Exception(CRMReportResource.ErrorNullReportScript); } var reportStateData = new ReportStateData( GetFileName(reportType), tmpFileName, script, (int)reportType, ReportOrigin.CRM, SaveReportFile, null, _tenantManager.GetCurrentTenant().TenantId, _securityContext.CurrentAccount.ID); var state = new ReportState(_serviceProvider, reportStateData, _httpContext); _docbuilderReportsUtilityHelper.Enqueue(state); return(state); }
public static string StepDescription(ReportState reportState, string user, string[] roles, string originatingOfficer) { var description = string.Empty; switch (reportState) { case ReportState.Approved: description = "Report approved by " + user; break; case ReportState.Complete: description = "Report workflow complete"; break; case ReportState.InProgress: description = "Report started by " + user; break; case ReportState.Rejected: description = GetRejectDescription(user, roles, originatingOfficer); break; case ReportState.Review: description = GetReviewDescription(roles); break; case ReportState.Submitted: description = "Report submitted by " + user; break; case ReportState.Unknown: break; } return(description); }
public void Update() { if (Threaded && asyncResult != null && asyncResult.IsCompleted) { try { cachedState = stateCheck.EndInvoke(asyncResult); } catch (System.Exception e) { Debug.LogException(e); } finally { asyncResult = null; } } if (cachedState == ReportState.Unknown) { if (Threaded) { if (asyncResult == null) { asyncResult = stateCheck.BeginInvoke((a) => { }, this); } } else { cachedState = stateCheck.Invoke(); } } }
private void InitValue(string reportID, SqlHelper sqlHelper, IEmrHost app) { DataTable dt = sqlHelper.GetReportCardInfo(reportID); if (dt.Rows.Count > 0) { string status = dt.Rows[0]["state"].ToString(); string usercode = dt.Rows[0]["create_usercode"].ToString(); ReportState rs = (ReportState)Enum.Parse(typeof(ReportState), status); if (app.User.DoctorId == usercode) { if (rs == ReportState.Save || rs == ReportState.Withdraw || rs == ReportState.UnPassApprove) { //提交的表单处于“保存”“撤回”“否决”状态,且表单的创建人必须是系统登录人 m_CanSave = true; m_CanDelete = true; //add by yxy m_CanSubmit = true; } else { m_CanSave = false; m_CanDelete = false; m_CanSubmit = false; } } } }
public static bool TryCreateReport(string query, out ReportState state) { var p = ReportFilterSerializer.GetParameterFromUri(query, "reportType"); if (string.IsNullOrEmpty(p)) { throw new Exception(ReportResource.ErrorParse); } ReportType reportType; if (!Enum.TryParse(p, out reportType)) { throw new Exception(ReportResource.ErrorParse); } var filter = ReportFilterSerializer.FromUri(query); var template = new ReportTemplate(reportType) { Id = -1, Filter = filter, CreateBy = SecurityContext.CurrentAccount.ID }; return(TryCreateReportFromTemplate(template, template.SaveDocbuilderReport, null, out state)); }
public uint SnapGroup(uint reportId, ICombatGroup group, ReportState state, bool isAttacker) { Resource loot = group.GroupLoot; uint battleTroopId = (uint)BattleReport.BattleTroopIdGenerator.GetNext(); dbManager.Query(string.Format(@"INSERT INTO `{0}` (`id`, `battle_report_id`, `owner_type`, `owner_id`, `group_id`, `name`, `state`, `is_attacker`, `gold`, `crop`, `iron`, `wood`) VALUES (@id, @report_id, @owner_type, @owner_id, @group_id, @name, @state, @is_attacker, @gold, @crop, @iron, @wood)", BATTLE_REPORT_TROOPS_DB), new[] { new DbColumn("id", battleTroopId, DbType.UInt32), new DbColumn("report_id", reportId, DbType.UInt32), new DbColumn("owner_type", group.Owner.Type.ToString(), DbType.String, 15), new DbColumn("owner_id", group.Owner.Id, DbType.UInt32), new DbColumn("group_id", group.Id, DbType.UInt32), new DbColumn("name", group.TroopId == 1 ? "[LOCAL]" : group.TroopId.ToString(CultureInfo.InvariantCulture), DbType.String, 32), new DbColumn("state", state, DbType.Byte), new DbColumn("is_attacker", isAttacker, DbType.Boolean), new DbColumn("gold", loot.Gold, DbType.Int32), new DbColumn("crop", loot.Crop, DbType.Int32), new DbColumn("iron", loot.Iron, DbType.Int32), new DbColumn("wood", loot.Wood, DbType.Int32) }); return(battleTroopId); }
public void ReportState([FromBody] ReportState request) { try { ClientData clientData = HostRoot.Instance.ClientSet.GetByClientId(request.ClientId); if (clientData == null) { clientData = new ClientData { ClientId = request.ClientId, IsMining = request.IsMining, CreatedOn = DateTime.Now, ModifiedOn = DateTime.Now, MinerIp = ClientIp }; HostRoot.Instance.ClientSet.Add(clientData); } else { clientData.IsMining = request.IsMining; clientData.ModifiedOn = DateTime.Now; clientData.MinerIp = ClientIp; } } catch (Exception e) { Logger.ErrorDebugLine(e); } }
public void ReportState(ReportState state, string minerIp, bool isFromWsServerNode) { if (!IsReadied) { return; } if (state == null || state.ClientId == Guid.Empty) { return; } if (string.IsNullOrEmpty(minerIp)) { return; } ClientData clientData = GetByClientId(state.ClientId); if (clientData == null) { clientData = ClientData.Create(state, minerIp); Add(clientData); } else { clientData.Update(state, minerIp, out bool isMinerDataChanged); if (isMinerDataChanged) { DoUpdateSave(MinerData.Create(clientData)); } } if (!isFromWsServerNode) { var speedData = clientData.ToSpeedData(); _speedDataRedis.SetAsync(speedData); } }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { ReportDocument rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("DiaryTypeCrt.rpt")); rptdoc.SetDataSource(dt); DiaryTypeReport.ReportSource = rptdoc; paramField.Name = "tittle"; if (rblICE.SelectedValue == "Date") { paramDValue.Value = "Date: " + txtDate.Text; } if (rblICE.SelectedValue == "Diary") { paramDValue.Value = "Diary No: " + txtDate.Text.ToString(); } paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); DiaryTypeReport.ParameterFieldInfo = paramFields; DiaryTypeReport.EnableDatabaseLogonPrompt = false; DiaryTypeReport.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { //lblExceptioN.Text = "Null Date ."; } catch (CrystalReportsException ex) { // Response.Write(ex); } catch (IndexOutOfRangeException ex) { // lblExceptioN.Text = "Null Date ."; } catch (SqlException ex) { // lblExceptioN.Text = "Null Date ."; } catch (ArgumentNullException ex) { // lblExceptioN.Text = "Null Date ."; } } else { DiaryTypeReport.ReportSource = (ReportDocument)Session["cr"]; } }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("ExamFormCrt.rpt")); rptdoc.SetDataSource(dt); ExamForm.ReportSource = rptdoc; paramField.Name = "tittle"; paramDValue.Value = "Session:" + ddlSession.SelectedItem.Text + txtYear.Text; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); ExamForm.ParameterFieldInfo = paramFields; ExamForm.EnableDatabaseLogonPrompt = false; ExamForm.EnableParameterPrompt = false; Session["cr"] = rptdoc; // rptdoc.Dispose(); } catch (NullReferenceException ex) { ExamForm.Visible = false; } catch (CrystalReportsException ex) { ExamForm.Visible = false; } catch (IndexOutOfRangeException ex) { ExamForm.Visible = false; } catch (SqlException ex) { ExamForm.Visible = false; } catch (ArgumentNullException ex) { ExamForm.Visible = false; } catch (COMException ex) { Response.Redirect("../../Login.aspx"); } } else { ExamForm.ReportSource = (ReportDocument)Session["cr"]; } }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { // IM_Letter_Report.Visible = true; ReportDocument rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); // paramDValue.Value = "Project Dtails:"; dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("IMLetterCrt.rpt")); rptdoc.SetDataSource(dt); IM_Letter_Report.ReportSource = rptdoc; paramField.Name = "title"; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); IM_Letter_Report.ParameterFieldInfo = paramFields; // rptdoc.SetParameterValue("tittle", paramDValue.Value, "View Details"); IM_Letter_Report.EnableDatabaseLogonPrompt = false; IM_Letter_Report.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { IM_Letter_Report.Visible = false; //lblExceptioN.Text = "Null Date ."; } catch (CrystalReportsException ex) { // Response.Write(ex); } catch (IndexOutOfRangeException ex) { IM_Letter_Report.Visible = false; // lblExceptioN.Text = "Null Date ."; } catch (SqlException ex) { IM_Letter_Report.Visible = false; // lblExceptioN.Text = "Null Date ."; } catch (ArgumentNullException ex) { IM_Letter_Report.Visible = false; // lblExceptioN.Text = "Null Date ."; } } else { IM_Letter_Report.ReportSource = (ReportDocument)Session["cr"]; } }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("MarksStatementsCrt.rpt")); rptdoc.SetDataSource(dt); MarksStatements.ReportSource = rptdoc; paramField.Name = "title"; paramDValue.Value = "Session:" + lblHiddenSeason.Text.ToString() + " and Course: " + ddlCourse.SelectedItem.Text.ToString() + " " + ddlPart.SelectedItem.Text.ToString(); paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); MarksStatements.ParameterFieldInfo = paramFields; MarksStatements.EnableDatabaseLogonPrompt = false; MarksStatements.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { MarksStatements.Visible = false; } catch (CrystalReportsException ex) { MarksStatements.Visible = false; Response.Write(ex); } catch (IndexOutOfRangeException ex) { MarksStatements.Visible = false; } catch (SqlException ex) { MarksStatements.Visible = false; } catch (ArgumentNullException ex) { MarksStatements.Visible = false; } catch (COMException ex) { Response.Redirect("../../Login.aspx"); } } else { MarksStatements.ReportSource = (ReportDocument)Session["cr"]; } }
/// <summary> /// Initializes a new instance of the <see cref="ReportTemplateCreatedEvent" /> class. /// </summary> /// <param name="key">The key.</param> /// <param name="version">The version.</param> /// <param name="systemAccountKey">The system account key.</param> /// <param name="name">The name.</param> /// <param name="reportType">Type of the report.</param> /// <param name="parameters">The parameters.</param> /// <param name="reportState">State of the report.</param> public ReportTemplateCreatedEvent(Guid key, int version, Guid systemAccountKey, string name, ReportType reportType, object parameters, ReportState reportState) : base(key, version) { SystemAccountKey = systemAccountKey; Name = name; ReportType = reportType; Parameters = parameters; ReportState = reportState; }
protected void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDValue = new ParameterDiscreteValue(); rptTitle = "Report"; DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("MemberFeesCrt.rpt")); rptdoc.SetDataSource(dt); MemberFees_Report.ReportSource = rptdoc; paramField.Name = "tittle"; paramDValue.Value = rptTitle; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); MemberFees_Report.ParameterFieldInfo = paramFields; MemberFees_Report.EnableDatabaseLogonPrompt = false; MemberFees_Report.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { MemberFees_Report.Visible = false; } catch (CrystalReportsException ex) { MemberFees_Report.Visible = false; } catch (IndexOutOfRangeException ex) { MemberFees_Report.Visible = false; } catch (SqlException ex) { MemberFees_Report.Visible = false; } catch (ArgumentNullException ex) { MemberFees_Report.Visible = false; } catch (COMException ex) { Response.Redirect("../../Login.aspx"); } } else { MemberFees_Report.ReportSource = (ReportDocument)Session["cr"]; } }
private void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { // CrystalReportViewer1.Visible = true; ReportDocument rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("CourierServiceCrt.rpt")); rptdoc.SetDataSource(dt); CourierServiceReport.ReportSource = rptdoc; paramField.Name = "tittle"; paramDValue.Value = "Courier Service:" + strt + " and Session:" + str; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); CourierServiceReport.ParameterFieldInfo = paramFields; CourierServiceReport.EnableDatabaseLogonPrompt = false; CourierServiceReport.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { //lblExceptioN.Text = "Null Date ."; } catch (CrystalReportsException ex) { // Response.Write(ex); } catch (IndexOutOfRangeException ex) { // lblExceptioN.Text = "Null Date ."; } catch (SqlException ex) { // lblExceptioN.Text = "Null Date ."; } catch (ArgumentNullException ex) { // lblExceptioN.Text = "Null Date ."; } } else { CourierServiceReport.ReportSource = (ReportDocument)Session["cr"]; } }
void mainWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { //主线程报告不必用代理方法 ReportState state = e.UserState as ReportState; string message = string.Format("{0} {1}", DateTime.Now.ToString("HH:mm:ss"), state.Message); progressBarTotal.Position = state.Persentage; ConsumerDown.Items.Insert(0, message); }
public void ReportState([FromBody] ReportState request) { try { WebApiRoot.ClientDataSet.ReportState(request, MinerIp, isFromWsServerNode: false); } catch (Exception e) { Logger.ErrorDebugLine(e); } }
public Report(int id, int userid, int reporterid, string message, string xy, int state) { ReportID = id; UserID = userid; ReportedID = reporterid; Message = message; x = float.Parse(xy.Split(':')[0]); y = float.Parse(xy.Split(':')[1]); State = (ReportState)state; }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { ReportDocument rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("D2DCrt.rpt")); rptdoc.SetDataSource(dt); DiaryToDepartment.ReportSource = rptdoc; paramField.Name = "title2"; paramDValue.Value = rptTitle; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); DiaryToDepartment.ParameterFieldInfo = paramFields; // SetBDLoginInfo(cinfo); DiaryToDepartment.EnableDatabaseLogonPrompt = false; DiaryToDepartment.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { DiaryToDepartment.Visible = false; lblExceptioN.Text = ""; } catch (CrystalReportsException ex) { // Response.Write(ex); } catch (IndexOutOfRangeException ex) { // lblExceptioN.Text = "Null Date ."; } catch (SqlException ex) { // lblExceptioN.Text = "Null Date ."; } catch (ArgumentNullException ex) { // lblExceptioN.Text = "Null Date ."; } } else { DiaryToDepartment.ReportSource = (ReportDocument)Session["cr"]; } }
public void LoadReport(ReportState rptState) { if (rptState != ReportState.FromPostBack) { try { ReportDocument rptdoc = new ReportDocument(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); paramDValue = new ParameterDiscreteValue(); DataTable dt = new DataTable(); dt = getdata(); ds.Tables[0].Merge(dt); rptdoc.Load(Server.MapPath("SubscriptionCrt.rpt")); rptdoc.SetDataSource(dt); Subscription_Details_Report.ReportSource = rptdoc; ds.Dispose(); Subscription_Details_Report.EnableDatabaseLogonPrompt = false; Subscription_Details_Report.EnableParameterPrompt = false; Session["cr"] = rptdoc; paramField.Name = "tittle"; paramField.CurrentValues.Add(paramDValue); paramField.HasCurrentValue = true; paramFields.Add(paramField); Subscription_Details_Report.ParameterFieldInfo = paramFields; Subscription_Details_Report.EnableDatabaseLogonPrompt = false; Subscription_Details_Report.EnableParameterPrompt = false; Session["cr"] = rptdoc; } catch (NullReferenceException ex) { Subscription_Details_Report.Visible = false; } catch (CrystalReportsException ex) { Subscription_Details_Report.Visible = false; } catch (IndexOutOfRangeException ex) { Subscription_Details_Report.Visible = false; } catch (SqlException ex) { Subscription_Details_Report.Visible = false; } catch (ArgumentNullException ex) { Subscription_Details_Report.Visible = false; } } else { Subscription_Details_Report.ReportSource = (ReportDocument)Session["cr"]; } }
public static RantResponse FromRant(Rant Rant, ReportState ReportState) { var rant = new RantResponse() { Id = Rant.Id, ReportState = ReportState, Text = Rant.Text, }; var timeElapsed = DateTime.Now - Rant.Timestamp; if (timeElapsed.Days >= 365) { rant.Timestamp = string.Format("{0} years ago", Math.Floor(timeElapsed.Days / 365.0)); } else if (timeElapsed.Days >= 1) { rant.Timestamp = string.Format("{0} days ago", timeElapsed.Days); } else if (timeElapsed.Hours >= 1) { rant.Timestamp = string.Format("{0} hours ago", timeElapsed.Hours); } else if (timeElapsed.Minutes >= 1) { rant.Timestamp = string.Format("{0} minutes ago", timeElapsed.Minutes); } else { rant.Timestamp = string.Format("{0} seconds ago", timeElapsed.Seconds); } rant.Tags.AddRange(Rant.Tags.Select(x => x.Text)); return rant; }