public ActionResult PayrollReport(DateTime start, DateTime end, string idList) { int[] employees = ParseEmployeeIdList(idList); PayrollStatementsReport model = new PayrollStatementsReport(); model.Statements = ReportServices.GetPayrollStatements(start, end, employees.ToList(), base.SecurityToken.RoleName, base.LocationId); model.StartDate = start.ToShortDateString(); model.EndDate = end.ToShortDateString(); model.Header = new ReportHeaderModel("Payroll Statements"); return(View(model)); }
public async Task ReturnNotDeletedReport_WithTag_When_ParamValid() { //Arrange var options = Utils.GetOptions(nameof(ReturnNotDeletedReport_WithTag_When_ParamValid)); var report1 = TestModelsSeeder.SeedReport(); var industry1 = TestModelsSeeder.SeedIndustry(); var user = TestModelsSeeder.SeedUser(); var tag = TestModelsSeeder.SeedTag(); var tag2 = TestModelsSeeder.SeedTag2(); var tag3 = TestModelsSeeder.SeedTag3(); var report2 = TestModelsSeeder.SeedReport2(); var industry2 = TestModelsSeeder.SeedIndustry2(); var report3 = TestModelsSeeder.SeedReport3(); var industry3 = TestModelsSeeder.SeedIndustry3(); using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Reports.AddAsync(report1); await arrangeContext.Tags.AddAsync(tag); await arrangeContext.Industries.AddAsync(industry1); await arrangeContext.Reports.AddAsync(report2); await arrangeContext.Tags.AddAsync(tag2); await arrangeContext.Industries.AddAsync(industry2); await arrangeContext.Reports.AddAsync(report3); await arrangeContext.Tags.AddAsync(tag3); await arrangeContext.Industries.AddAsync(industry3); await arrangeContext.Users.AddAsync(user); await arrangeContext.SaveChangesAsync(); } //Act & Assert using var assertContext = new InsightHubContext(options); var sutTags = new TagServices(assertContext); var sut = new ReportServices(assertContext, sutTags); var act = await sut.GetReports(null, null, null, null, "TestTag1"); var result = act.ToList(); Assert.AreEqual(1, result.Count()); Assert.AreEqual(report1.Title, result[0].Title); Assert.IsTrue(result[0].Tags.Contains("TestTag1")); }
public bool ReceiveReportFromSubAgency(string xmlDoc) { try { var serializer = new XmlSerializer(typeof(ReportList)); using (var reader = new StringReader(xmlDoc)) { var xmlObj = (ReportList)serializer.Deserialize(reader); foreach (var reportXml in xmlObj.Reports) { var perform = PerformServices.GetById(reportXml.PerformID); if (reportXml != null) { var report = new Report { ReportContent = reportXml.ReportContent, PerformOnDate = reportXml.PerformOnDate, RequestID = reportXml.RequestID, Status = reportXml.Status, ReporterName = reportXml.ReporterName, DepartmentID = perform.DepartmentID }; if (reportXml.DanhSachFile != null && reportXml.DanhSachFile.Count() > 0) { ReportServices.Create(report, new List <int> { reportXml.PerformID.ToInteger() }, reportXml.DanhSachFile[0]?.Content, reportXml.DanhSachFile[0]?.FileName, AppSettings.UploadFolder); } else { ReportServices.Create(report, new List <int> { reportXml.PerformID.ToInteger() }, null, null, AppSettings.UploadFolder); } } } } return(true); } catch (Exception ex) { LogHelper.WriteLog(ex); return(false); } }
/// <summary> /// Open the Login window and connect to the SSRS server /// </summary> /// <param name="parameter"></param> private async Task OpenExecute(object parameter) { LoginWindow frmLogin = new LoginWindow(parameter as Window, _credentials); if (frmLogin.ShowDialog() == true) { _credentials = frmLogin.Credentials; _service = new ReportServices(_credentials.ServerUrl, _credentials.Login, _credentials.Password, _credentials.Domain); this.ServerUrl = _credentials.ServerUrl; this.OnPropertyChanged("ServerUrl"); await this.RefreshExecute(); } }
public async Task GetsCorrectReports_When_ParamsValid() { //Arrange var options = Utils.GetOptions(nameof(GetsCorrectReports_When_ParamsValid)); var report1 = TestModelsSeeder.SeedReport(); var industry1 = TestModelsSeeder.SeedIndustry(); var user = TestModelsSeeder.SeedUser(); var tag = TestModelsSeeder.SeedTag(); var tag2 = TestModelsSeeder.SeedTag2(); var tag3 = TestModelsSeeder.SeedTag3(); var report2 = TestModelsSeeder.SeedReport2(); var industry2 = TestModelsSeeder.SeedIndustry2(); var report3 = TestModelsSeeder.SeedReport3(); var industry3 = TestModelsSeeder.SeedIndustry3(); report1.IsDeleted = true; using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Reports.AddAsync(report1); await arrangeContext.Tags.AddAsync(tag); await arrangeContext.Industries.AddAsync(industry1); await arrangeContext.Reports.AddAsync(report2); await arrangeContext.Tags.AddAsync(tag2); await arrangeContext.Industries.AddAsync(industry2); await arrangeContext.Reports.AddAsync(report3); await arrangeContext.Tags.AddAsync(tag3); await arrangeContext.Industries.AddAsync(industry3); await arrangeContext.Users.AddAsync(user); await arrangeContext.SaveChangesAsync(); } //Act & Assert using var assertContext = new InsightHubContext(options); var sutTags = new TagServices(assertContext); var sut = new ReportServices(assertContext, sutTags); var result = await sut.GetReports(null, null, null, null, null); Assert.AreEqual(2, result.Count); }
public async Task ThrowArgumentException_WhenTitleAlreadyExists() { //Arrange var options = Utils.GetOptions(nameof(ThrowArgumentException_WhenTitleAlreadyExists)); var newSummary = "New Report Summary"; var newDescription = "New Report Description"; var newIndustry = TestModelsSeeder.SeedIndustry2(); var newImgURL = "imageurl"; var newTag = TestModelsSeeder.SeedTag2(); var report1 = TestModelsSeeder.SeedReport(); var industry1 = TestModelsSeeder.SeedIndustry(); var user = TestModelsSeeder.SeedUser(); var tag = TestModelsSeeder.SeedTag(); var report2 = TestModelsSeeder.SeedReport2(); var industry2 = TestModelsSeeder.SeedIndustry3(); var tag2 = TestModelsSeeder.SeedTag3(); using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Users.AddAsync(user); await arrangeContext.Industries.AddAsync(industry1); await arrangeContext.Industries.AddAsync(industry2); await arrangeContext.Industries.AddAsync(newIndustry); await arrangeContext.Tags.AddAsync(tag); await arrangeContext.Tags.AddAsync(newTag); await arrangeContext.Tags.AddAsync(tag2); await arrangeContext.Reports.AddAsync(report1); await arrangeContext.Reports.AddAsync(report2); await arrangeContext.SaveChangesAsync(); } //Act & Assert using var assertContext = new InsightHubContext(options); var sutTags = new TagServices(assertContext); var sutReports = new ReportServices(assertContext, sutTags); await Assert.ThrowsExceptionAsync <ArgumentException>(() => sutReports.UpdateReport(1, report2.Title, newSummary, newDescription, newImgURL, newIndustry.Name, newTag.Name)); }
public async Task UpdateReport_WhenParamsAreValid() { //Arrange var options = Utils.GetOptions(nameof(UpdateReport_WhenParamsAreValid)); var newTitle = "New Report Title"; var newSummary = "New Report Summary"; var newDescription = "New Report Description"; var newIndustry = TestModelsSeeder.SeedIndustry2(); var newImgURL = "imageurl"; var newTag = TestModelsSeeder.SeedTag2(); var report1 = TestModelsSeeder.SeedReport(); var industry1 = TestModelsSeeder.SeedIndustry(); var user = TestModelsSeeder.SeedUser(); var tag = TestModelsSeeder.SeedTag(); using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Users.AddAsync(user); await arrangeContext.Industries.AddAsync(industry1); await arrangeContext.Industries.AddAsync(newIndustry); await arrangeContext.Tags.AddAsync(tag); await arrangeContext.Tags.AddAsync(newTag); await arrangeContext.Reports.AddAsync(report1); await arrangeContext.SaveChangesAsync(); } //Act & Assert using var assertContext = new InsightHubContext(options); var sutTags = new TagServices(assertContext); var sutReports = new ReportServices(assertContext, sutTags); var act = await sutReports.UpdateReport(1, newTitle, newSummary, newDescription, newImgURL, newIndustry.Name, newTag.Name); var result = assertContext.Reports.FirstOrDefault(t => t.Title == newTitle); Assert.AreEqual(newTitle, result.Title); Assert.AreEqual(newSummary, result.Summary); Assert.AreEqual(newDescription, result.Description); Assert.AreEqual(newIndustry.Name, result.Industry.Name); Assert.AreEqual(newImgURL, result.ImgUrl); Assert.AreEqual(newTag.Name, result.ReportTags.First().Tag.Name); }
public async Task ThrowArgumentException_When_ReportIsNotFound() { var options = Utils.GetOptions(nameof(ThrowArgumentException_When_ReportIsNotFound)); var report = TestModelsSeeder.SeedReport(); using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Reports.AddAsync(report); arrangeContext.SaveChanges(); } using var assertContext = new InsightHubContext(options); var sutTag = new TagServices(assertContext); var sut = new ReportServices(assertContext, sutTag); await Assert.ThrowsExceptionAsync <ArgumentException>(() => sut.RestoreReport(1)); }
public static void SaveReport(this ReportElement reportElement, string uploadFolder) { var request = RequestServices.GetByAgencyID(reportElement.RequestID); if (request.Reports.Select(r => r.ReportContent.Trim()).Contains(reportElement.ReportContent.Trim())) { var report = new Report { ReportContent = reportElement.ReportContent, PerformOnDate = reportElement.PerformOnDate, RequestID = request.RequestID, Status = reportElement.Status, ReporterName = reportElement.ReporterName }; ReportServices.Create(report: report, performIds: null, fileContent: reportElement.DanhSachFile?.FirstOrDefault()?.Content, fileName: reportElement.DanhSachFile?.FirstOrDefault()?.FileName, uploadFolder: uploadFolder, isSendFromAgency: true); } }
public void FinderHome() { var response = new ApiResponse(); List <string> messages = new List <string>(); List <WMA.LabelLink> output = new List <WMA.LabelLink>(); var endpoint = "search/"; try { var list = ReportServices.MainEntityTotals(false); foreach (var item in list) { output.Add(new WMA.LabelLink() { Label = item.Name, Total = item.Totals, URL = ServiceHelper.externalFinderSiteURL + endpoint + item.Name.Replace(" ", ""), TestURL = ServiceHelper.baseFinderSiteURL + endpoint + item.Name.Replace(" ", "") }); } response.Result = output; if (messages.Any()) { new BaseController().SendResponse(messages); } else { response.Successful = true; //response.Result = results; //var finalResult = JObject.FromObject( new { data = results, valid = valid, status = status } ); new BaseController().SendResponse(response); } } catch (Exception ex) { LoggingHelper.LogError(ex, "API-Home.Index"); response.Messages.Add(string.Format("Error encountered returning data. {0} ", ex.Message)); response.Successful = false; new BaseController().SendResponse(response); } }
private void PopulateProjectSamastigatReport(ReportDocument repDoc) { objProjectBO = new ComProjectBO(); objProjectBO.MinistryId = ddlMinistry.SelectedValue.ToInt32(); objProjectBO.ChaumasikId = ddlChaumasik.SelectedValue.ToInt32(); objProjectBO.Priority = ddlPriority.SelectedValue.ToInt32(); objProjectBO.FiscalYearId = Session["fiscal_year_id"].ToInt32(); wbs = new ProjectService(); wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject(); dt = wbs.PopulateProjectSamastigatReport(objProjectBO); Session["dtPopulateProjectSamastigatReport"] = dt; //objPlanRpt = new PlanListRpt(); objRptFactory = new ReportFactory(); objRptFactory.SetReport(repDoc); objRptServices = new ReportServices(); objRptServices.GetReport(repDoc, RptViewer); repDoc.Database.Tables[0].SetDataSource(dt); cryParameter(repDoc); if (dt != null && dt.Rows.Count > 0) { lnkVerify.Visible = true; RptViewer.ReportSource = repDoc; Session["SamastigatReport"] = repDoc; } else { RptViewer.ReportSource = null; Session["SamastigatReport"] = null; } //chartViewer.ReportSource = objPrjBhautikPragatiGrpRpt; // crystalViewer.Zoom(75); //chartViewer.Zoom(93); }
protected override void CreateNewObject() { report = new Report { ReportContent = NoiDungThucHien.Text, PerformOnDate = ThoiGianThucHien.Text.ToDateTime(), RequestID = Parameters.Pid, Status = TrangThai.SelectedValue.ToInteger(), ReporterName = Sessions.DisplayName, DepartmentID = Sessions.DepartmentID }; ReportServices.Create(report: report, performIds: ThucHien.GetSelectedValues(), fileContent: FileDinhKem.PostedFile, fileName: FileDinhKem.PostedFile?.FileName, uploadFolder: AppSettings.UploadFolder, isStaffReport: report.Request.CoQuyenXacNhan, isSendToAgency: true); ExceptionlessClient.Default.SubmitEvent(new Event { Message = $"Nhập báo cáo thực hiện YKCD ({Sessions.DisplayName})", Type = "Nhập báo cáo", Source = AppSettings.AGENCY_NAME }); Redirector.Redirect(ViewNames.SubAgency.ThongTinYKCD, "id", Parameters.Pid); }
public async Task DeleteReport_When_ParamsValid() { //Arrange var options = Utils.GetOptions(nameof(DeleteReport_When_ParamsValid)); var report = TestModelsSeeder.SeedReport(); using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Reports.AddAsync(report); arrangeContext.SaveChanges(); } //Act & Assert using var assertContext = new InsightHubContext(options); var sutTag = new TagServices(assertContext); var sut = new ReportServices(assertContext, sutTag); await sut.DeleteReport(1); Assert.IsTrue(assertContext.Reports.First(u => u.Id == 1).IsDeleted); }
protected void LoadReport(int prjlId, ReportDocument repDoc) { objProjectBO = new ComProjectBO(); objProjectBO.ProjectId = prjlId; // prjlId.ToInt32(); wbs = new ProjectService(); wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject(); Session["dtProjectDetail"] = wbs.PopulateProjectListRpt(objProjectBO); int fiscalYearId = SessionHelper.SessionFiscalYear.ToInt32(); //Provide parameter values DataTable dtProjectDetail = (DataTable)Session["dtProjectDetail"]; if (dtProjectDetail != null && dtProjectDetail.Rows.Count > 0) { //cryParameter(repDoc); //objPlanRpt = new PlanListRpt(); //this limits the queue lnkVerify.Visible = true; objRptFactory = new ReportFactory(); objRptFactory.SetReport(repDoc); objRptServices = new ReportServices(); objRptServices.GetReport(repDoc, tabviewer); repDoc.Database.Tables[0].SetDataSource(dtProjectDetail); cryParameter(repDoc); tabviewer.ReportSource = repDoc; tabviewer.DataBind(); Session["ProjectUpdateReport"] = repDoc; } else { tabviewer.ReportSource = null; Session["ProjectUpdateReport"] = null; } }
public async Task PermanentlyDelete_When_ParamsValid() { var options = Utils.GetOptions(nameof(PermanentlyDelete_When_ParamsValid)); var report = TestModelsSeeder.SeedReport(); using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Reports.AddAsync(report); arrangeContext.SaveChanges(); } using var assertContext = new InsightHubContext(options); var sutTag = new TagServices(assertContext); var sut = new ReportServices(assertContext, sutTag); assertContext.Reports.First(r => r.Id == 1).IsDeleted = true; await sut.PermanentlyDeleteReport(report.Id); Assert.AreEqual(0, assertContext.Reports.Count()); }
public ActionResult ExportCSVCustom() { CommonDa da = new CommonDa(); AdminOrderShipDa dataAccess = new AdminOrderShipDa(); CmnEntityModel currentUser = Session["CmnEntityModel"] as CmnEntityModel; var authorityList = currentUser != null ? currentUser.USER_AUTHORITY : 0; if (currentUser == null || currentUser.USER_ID == 0) { return(RedirectToAction("Login", "UserAccount")); } var modelCondition = Session["SearchOrderShipList"] as AdminOrderList ?? new AdminOrderList(); string[] columns = this.CreateColumnsExportInfo(); string fileName = "Danh_Sách_Đơn" + Utility.GetCurrentDateTime().ToString("dd/MM/yyyy HH:mm:ss") + ".csv"; var dataExport = dataAccess.getDataForCSV(modelCondition); DataTable dt = ConvertToDataTableForExport(this, dataExport, columns); ReportServices.ExportToCsvData(this, dt, fileName, columns); return(new EmptyResult()); }
protected void btnSave_OnClick(object sender, EventArgs e) { var perform = PerformServices.GetById(Parameters.Id); var report = new Report(); if (!string.IsNullOrEmpty(BaoCaoThucHien.Text.Trim())) { report = new Report { RequestID = perform.RequestID, CreatedByName = Sessions.DisplayName, ReportContent = BaoCaoThucHien.Text.Trim(), Status = TrangThai.SelectedValue.ToInteger(), PerformOnDate = NgayHoanThanh.Text.ToDateTime(), AgencyID = perform.AgencyID }; } else if (TrangThai.SelectedValue.ToInteger() != 2 && string.IsNullOrEmpty(BaoCaoThucHien.Text.Trim())) { report = new Report { RequestID = perform.RequestID, CreatedByName = Sessions.DisplayName, ReportContent = $"Chuyển trạng thái thực hiện của {perform.AgencyName} thành {TrangThai.SelectedItem.Text.ToUpper()}", Status = TrangThai.SelectedValue.ToInteger(), PerformOnDate = NgayHoanThanh.Text.ToDateTime(), AgencyID = perform.AgencyID }; } else if (perform.Status == 3 && TrangThai.SelectedValue.ToInteger() == 2 && string.IsNullOrEmpty(BaoCaoThucHien.Text.Trim())) { report = new Report { RequestID = perform.RequestID, CreatedByName = Sessions.DisplayName, ReportContent = $"Xác nhận trạng thái thực hiện của {perform.AgencyName} thành {TrangThai.SelectedItem.Text.ToUpper()}", Status = TrangThai.SelectedValue.ToInteger(), PerformOnDate = NgayHoanThanh.Text.ToDateTime(), AgencyID = perform.AgencyID }; } else { report = new Report { RequestID = perform.RequestID, CreatedByName = Sessions.DisplayName, ReportContent = BaoCaoThucHien.Text.Trim(), Status = TrangThai.SelectedValue.ToInteger(), PerformOnDate = NgayHoanThanh.Text.ToDateTime(), AgencyID = perform.AgencyID }; } ReportServices.Create(report: report, performIds: new List <long> { Parameters.Id }, fileContent: null, fileName: "", uploadFolder: AppSettings.UploadFolder, isStaffReport: true); ExceptionlessClient.Default.SubmitEvent(new Event { Message = $"Chuyển trạng thái thực hiện của {perform.AgencyName} thành {TrangThai.SelectedItem.Text.ToUpper()} ({Sessions.DisplayName})", Type = "Chuyển trạng thái YKCD", Source = "YKCD_UBND" }); Redirector.Redirect(ViewNames.Province.ThongTinYKCD, "id", perform.RequestID); }
public async Task ReturnPendingReport_WithSortAndSearch_When_ParamValid() { //Arrange var options = Utils.GetOptions(nameof(ReturnPendingReport_WithSortAndSearch_When_ParamValid)); var report1 = TestModelsSeeder.SeedReport(); var industry1 = TestModelsSeeder.SeedIndustry(); var user = TestModelsSeeder.SeedUser(); var tag = TestModelsSeeder.SeedTag(); var tag2 = TestModelsSeeder.SeedTag2(); var tag3 = TestModelsSeeder.SeedTag3(); var report2 = TestModelsSeeder.SeedReport2(); var industry2 = TestModelsSeeder.SeedIndustry2(); var report3 = TestModelsSeeder.SeedReport3(); var industry3 = TestModelsSeeder.SeedIndustry3(); report1.IsPending = true; report2.IsPending = true; report3.IsPending = true; using (var arrangeContext = new InsightHubContext(options)) { await arrangeContext.Reports.AddAsync(report1); await arrangeContext.Tags.AddAsync(tag); await arrangeContext.Industries.AddAsync(industry1); await arrangeContext.Reports.AddAsync(report2); await arrangeContext.Tags.AddAsync(tag2); await arrangeContext.Industries.AddAsync(industry2); await arrangeContext.Reports.AddAsync(report3); await arrangeContext.Tags.AddAsync(tag3); await arrangeContext.Industries.AddAsync(industry3); await arrangeContext.Users.AddAsync(user); await arrangeContext.SaveChangesAsync(); } //Act & Assert using var assertContext = new InsightHubContext(options); var sutTags = new TagServices(assertContext); var sut = new ReportServices(assertContext, sutTags); var act = await sut.GetPendingReports("title_desc", "TestReport"); var result = act.ToList(); Assert.AreEqual(3, result.Count()); Assert.AreEqual(report3.Title, result[0].Title); Assert.AreEqual(report3.Summary, result[0].Summary); Assert.IsTrue(result[0].Title.Contains("TestReport")); Assert.AreEqual(report2.Title, result[1].Title); Assert.AreEqual(report2.Summary, result[1].Summary); Assert.IsTrue(result[1].Title.Contains("TestReport")); Assert.AreEqual(report1.Title, result[2].Title); Assert.AreEqual(report1.Summary, result[2].Summary); Assert.IsTrue(result[2].Title.Contains("TestReport")); }
protected void LoadReport(int prjlId, ReportDocument repDoc) { //repDoc = new ReportDocument(); objProjectBO = new ComProjectBO(); objProjectBO.ProjectId = prjlId.ToInt32(); wbs = new ProjectService(); wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject(); Session["dtProjectDetail"] = wbs.PopulateProjectListRpt(objProjectBO); DataTable dtProjectDetail = (DataTable)Session["dtProjectDetail"]; if (dtProjectDetail != null && dtProjectDetail.Rows.Count > 0) { lnkVerify.Visible = true; //objPlanRpt = new PlanListRpt(); objRptFactory = new ReportFactory(); objRptFactory.SetReport(repDoc); objRptServices = new ReportServices(); objRptServices.GetReport(repDoc, tabviewer); repDoc.Database.Tables[0].SetDataSource(dtProjectDetail); //cryParameter(repDoc); if (dtProjectDetail != null && dtProjectDetail.Rows.Count > 0) { tabviewer.ReportSource = repDoc; Session["ProjectReport"] = repDoc; } else { tabviewer.ReportSource = null; Session["ProjectReport"] = null; } //tabviewer.ReportSource = repDoc; //chartViewer.ReportSource = objPrjBhautikPragatiGrpRpt; // crystalViewer.Zoom(75); //chartViewer.Zoom(93); } else { //objRptFactory = new ReportFactory(); //objRptFactory.SetReport(repDoc); //objRptServices = new ReportServices(); //objRptServices.GetReport(repDoc, tabviewer); //repDoc.Database.Tables[0].SetDataSource(dtProjectDetail); //cryParameter(repDoc); //tabviewer.ReportSource = repDoc; } }
public string GetAllReport(long requestID, int agencyID) { var reports = ReportServices.GetList(requestID, agencyID); return(XmlHelper.ConvertToXmlObject(reports).ToXml()); }
public IActionResult GetClubsWithCoaches() { ReportServices report = new ReportServices(_context); return(File(report.GetClubsWithCoaches().ToArray(), "application/vnd.ms.excel", "ClubsWithCoaches.xls")); }
// This is the function that will process an event either generated // by the service, sent to it by another service on the same component, // or as a message sent by a different component. public override bool processTransitions(InternalEvent ie) { bool done = false; // Since this function can be called from multiple threads, // we use a mutex to ensure only one state transition is // active at a time. mutex.WaitOne(); // Invoke the FSM transition for this event. try { if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0)) { Receive casted_ie = (Receive)ie; int pos = 0; ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); if (id == new ReportHeartbeatPulse().getID()) { ReportHeartbeatPulse msg = new ReportHeartbeatPulse(); msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec(); pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData); done = true; } } } catch (Exception e) {} try { if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0)) { Receive casted_ie = (Receive)ie; int pos = 0; ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); if (id == new ReportServices().getID()) { ReportServices msg = new ReportServices(); msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec(); pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData); done = true; } } } catch (Exception e) {} try { if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0)) { Receive casted_ie = (Receive)ie; int pos = 0; ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); if (id == new ReportIdentification().getID()) { ReportIdentification msg = new ReportIdentification(); msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec(); pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData); done = true; } } } catch (Exception e) {} try { if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0)) { Receive casted_ie = (Receive)ie; int pos = 0; ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); if (id == new GrantNodeID().getID()) { GrantNodeID msg = new GrantNodeID(); msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos); Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec(); pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData); done = true; } } } catch (Exception e) {} try { if ((!done) && ie.getName().CompareTo("RHP_Timeout") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0)) { RHP_Timeout casted_ie = (RHP_Timeout)ie; pDiscoveryClient_ReceiveFSM.context.RHP_TimeoutTransition(); done = true; } } catch (Exception e) {} mutex.ReleaseMutex(); return(done); }
public IActionResult GetCategoriesCompetitors() { ReportServices report = new ReportServices(_context); return(File(report.GetCategoriesAndCompetitors().ToArray(), "application/vnd.ms-excel", "CategoriesWithCompetitors.xls")); }
protected internal override void ReceiveTransition(DiscoveryClient_ReceiveFSMContext context, ReportServices msg, Receive.Body.ReceiveRec transportData) { DiscoveryClient_ReceiveFSM ctxt = context.Owner; #if TRACE Trace.WriteLine( "LEAVING STATE : DiscoveryClient_ReceiveFSM_SM.Receiving_Ready"); #endif DiscoveryClient_ReceiveFSMState endState = context.State; #if TRACE Trace.WriteLine( "ENTER TRANSITION: DiscoveryClient_ReceiveFSM_SM.DiscoveryClient_ReceiveFSM_SM.Receiving_Ready.ReceiveTransition(, ReportServices msg, Receive.Body.ReceiveRec transportData)"); #endif context.ClearState(); try { ctxt.parseServiceListAction(msg, transportData); } finally { #if TRACE Trace.WriteLine( "EXIT TRANSITION : DiscoveryClient_ReceiveFSM_SM.DiscoveryClient_ReceiveFSM_SM.Receiving_Ready.ReceiveTransition(, ReportServices msg, Receive.Body.ReceiveRec transportData)"); #endif context.State = endState; } return; }
protected internal virtual void ReceiveTransition(DiscoveryClient_ReceiveFSMContext context, ReportServices msg, Receive.Body.ReceiveRec transportData) { Default(context); }
protected void LoadReport(int prjlId, ReportDocument repDoc) { //repDoc = new ReportDocument(); objBarsikService = new BarsikKaryekramService(); ProjectOutputTBarsikBO objProjectOutBarsik = new ProjectOutputTBarsikBO(); objProjectOutBarsik.Lang = SessionHelper.SessionLanguageSetting; objBarsikService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationBarsikKaryekram(); objProjectOutBarsik.ProjectId = prjlId; objProjectOutBarsik.FiscalYearId = SessionHelper.SessionFiscalYear.ToInt32(); objProjectOutBarsik.ChaumasikId = ddlChaumasik.SelectedValue.ToInt32(); /*Session["dtProjectNatija"] = objBarsikService.PopulateProjectTargetsBarsikRpt(objProjectOutBarsik); * DataTable dtProjectNatija = (DataTable) Session["dtProjectNatija"]; * * Session["dtPopulateProjectNatijaReport"] = dtProjectNatija;*/ Session["dtProjectPratifal"] = objBarsikService.PopulateProjectProgress(objProjectOutBarsik); DataTable dtProjectPratifal = (DataTable)Session["dtProjectPratifal"]; Session["dtPopulateProjectPratifalReport"] = dtProjectPratifal; objRptFactory = new ReportFactory(); objRptFactory.SetReport(repDoc); objRptServices = new ReportServices(); objRptServices.GetReport(repDoc, RptViewer); /*repDoc.Database.Tables[0].SetDataSource(dtProjectNatija);*/ repDoc.Database.Tables[0].SetDataSource(dtProjectPratifal); //cryParameter(repDoc); // RptViewer.ReportSource = repDoc; //chartViewer.ReportSource = objPrjBhautikPragatiGrpRpt; /*if (dtProjectNatija != null && dtProjectNatija.Rows.Count > 0) * { * RptViewer.ReportSource = repDoc; * Session["NatijaReport"] = repDoc; * } * else * { * RptViewer.ReportSource = null; * Session["NatijaReport"] = null; * }*/ if (dtProjectPratifal != null && dtProjectPratifal.Rows.Count > 0) { RptViewer.ReportSource = repDoc; Session["PratifalReport"] = repDoc; } else { RptViewer.ReportSource = null; Session["PratifalReport"] = null; } // crystalViewer.Zoom(75); //chartViewer.Zoom(93); }
public virtual void parseServiceListAction(ReportServices msg, Receive.Body.ReceiveRec transportData) { /// Insert User Code HERE }
public IActionResult GetClubs() { ReportServices report = new ReportServices(_context); return(File(report.GetClubs().ToArray(), "application/vnd.ms.excel", "InfoSubscribedClubs.xls")); }
//выполнить ХП private void ExecuteSP() { ReportServices rs = new ReportServices(); dataGridView1.DataSource = rs.ExecuteSP(dateTimePicker1.Value); }
public bool ReceiveReport(string xmlDoc) { try { var serializer = new XmlSerializer(typeof(ReportList)); using (var reader = new StringReader(xmlDoc)) { var xmlObj = (ReportList)serializer.Deserialize(reader); foreach (var reportXml in xmlObj.Reports) { var perform = PerformServices.GetById(reportXml.PerformID); if (!string.IsNullOrEmpty(reportXml.ReportContent)) { var report = new Report { ReportContent = reportXml.ReportContent, PerformOnDate = reportXml.PerformOnDate, RequestID = reportXml.RequestID, Status = reportXml.Status, CreatedByName = reportXml.ReporterName, AgencyID = perform.AgencyID }; ReportServices.Create(report); foreach (var reportFile in reportXml.DanhSachFile) { try { ReportFileServices.CreateReportFile(report, fileContent: reportFile.Content, fileName: reportFile.FileName, uploadFolder: AppSettings.UploadFolder); } catch (Exception ex) { LogHelper.WriteLog(ex); continue; } } } if (perform.Status != 2) { perform.Status = reportXml.Status; if (perform.Status == 2 || perform.Status == 3) { perform.Status = 3; perform.FinishedOnDate = reportXml.PerformOnDate; } perform.IsSynced = false; PerformServices.Update(perform); RequestServices.CapNhatTrangThaiYKCD(reportXml.RequestID); } } } return(true); } catch (Exception ex) { LogHelper.WriteLog(ex); return(false); } }