public void SlipPurchaseOrder(string reportName, Dictionary <string, string> parameters) { rptReport.LocalReport.ReportPath = String.Format(@"{0}/{1}", ConfigurationManager.AppSettings[ApplicationSettingKeys.ReportFolder], reportName + ".rdlc"); ReportService.ConnectionString = ManagementService.GetConnectionString(UserSessionHelper.GetCurrentCompanyCode()); var detail = ReportService.GetPurchaseOrderDetail(parameters["DocumentNo"]); var header = ReportService.GetPurchaseOrderHeader(parameters["DocumentNo"]); var rdsHeader = new ReportDataSource("Header", header); var rdsDetail = new ReportDataSource("Detail", detail); rptReport.LocalReport.DataSources.Add(rdsHeader); rptReport.LocalReport.DataSources.Add(rdsDetail); rptReport.LocalReport.Refresh(); }
public void ListPurchaseOrder(string reportName, Dictionary <string, string> parameters) { rptReport.LocalReport.ReportPath = String.Format(@"{0}/{1}", ConfigurationManager.AppSettings[ApplicationSettingKeys.ReportFolder], reportName + ".rdlc"); ReportService.ConnectionString = ManagementService.GetConnectionString(UserSessionHelper.GetCurrentCompanyCode()); DateTime fromDate = Convert.ToDateTime(parameters["FromDate"]); DateTime toDate = Convert.ToDateTime(parameters["ToDate"]); var reportData = ReportService.ListPurchaseOrder(fromDate, toDate); var rds = new ReportDataSource("ListPurchaseOrder", reportData); var reportParameters = new List <ReportParameter>(); reportParameters.Add(new ReportParameter("FromDate", fromDate.ToString("dddd, dd MMMM yyyy"))); reportParameters.Add(new ReportParameter("ToDate", toDate.ToString("dddd, dd MMMM yyyy"))); rptReport.LocalReport.DataSources.Add(rds); rptReport.LocalReport.SetParameters(reportParameters); rptReport.LocalReport.Refresh(); }
/// <summary> /// Load your modules or register your services here! /// </summary> /// <param name="kernel">The kernel.</param> private static void RegisterServices(IKernel kernel) { kernel.Bind <ManagementDataContext>() .ToConstructor( o => new ManagementDataContext( ConfigurationManager.ConnectionStrings["ManagementConnectionString"].ConnectionString)) .InRequestScope(); ////.WhenInjectedInto<string>() //.WithParameter(new ConstructorArgument("connection", // ConfigurationManager.ConnectionStrings["ManagementConnectionString"].ConnectionString // )); kernel.Bind <IPrincipal>().ToMethod(ctx => HttpContext.Current.User); kernel.Bind <ArtileriDataContext>() .ToMethod(ctx => new ArtileriDataContext(ctx.Kernel.Get <ManagementProvider>() .GetConnectionString(HttpContext.Current == null ? "" : UserSessionHelper.GetCurrentCompanyCode()))) .InRequestScope(); }
protected void Page_Load(object sender, EventArgs e) { sdsMaster.ConnectionString = ManagementService.GetConnectionString(UserSessionHelper.GetCurrentCompanyCode()); grdMaster.Columns[0].Visible = false; }
protected void Page_Load(object sender, EventArgs e) { //var userSession = ManagementService.GetUserSession(Page.User.Identity.Name); lblCurrentActiveCompany.Text = String.Format("{0}", UserSessionHelper.GetCurrentCompanyCode()); }