protected void btnPrint_Click(object sender, EventArgs e) { if (!saved) { Save(); } ReportDocument report = new ReportDocument(); report.Load(Server.MapPath("DischargeCR.rpt")); using (ClubDBEntities club = new ClubDBEntities()) { report.SetDataSource(club.getDischargeReport(EID)); string printer = ClubWebApp.Properties.Settings.Default.DefaultPrinter; report.PrintOptions.PrinterName = printer; report.PrintToPrinter(1, false, 0, 0); } }
protected void btnGo_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(tbDate.Text)) { DateTime date = Convert.ToDateTime(tbDate.Text, cul); using (ClubDBEntities club = new ClubDBEntities()) { var result = club.getDischargeReport(date); if (result.Count() != 0) { gvRequests.DataSource = result; gvRequests.DataBind(); pnlG.Visible = true; lblError.Visible = false; } else { pnlG.Visible = false; lblError.Visible = true; lblError.Text = "No Data"; } } } if (!string.IsNullOrEmpty(tbID.Text)) { using (ClubDBEntities club = new ClubDBEntities()) { var result = club.getDischargeReport(tbID.Text); if (result.Count() != 0) { gvRequests.DataSource = result; gvRequests.DataBind(); pnlG.Visible = true; lblError.Visible = false; } else { pnlG.Visible = false; lblError.Visible = true; lblError.Text = "No Data"; } } } }
protected void Page_Load(object sender, EventArgs e) { if (Roles.IsUserInRole(ERoles.Manager.ToString()) || Roles.IsUserInRole(ERoles.PhysicalS.ToString())) { if (!Page.IsPostBack) { if (Request["ID"] != null) { show = true; pnlClient.Visible = true; pnlInfo.Visible = true; readOnly(); int id = Convert.ToInt32(Request["ID"]); using (ClubDBEntities club = new ClubDBEntities()) { var re = club.getDischargeReport(id).First(); tbID.Text = re.FileID; tbName.Text = re.PatientName; tbDate.Text = re.Date; tbNation.Text = re.Nation; tbPhone.Text = re.Phone; tbGoals.Text = re.Goals; tbTreat.Text = re.Treatment; tbDia.Text = re.Diagnosis; tbPreReferrals.Text = re.PreReferral; tbInitialSession.Text = re.InitialSession.ToString("dd/MM/yyyy"); tbFinalSession.Text = re.FinalSession.ToString("dd/MM/yyyy"); tbTotalSession.Text = re.TotalSessions; tbDischarge.Text = re.Discharge; rbGoals.SelectedValue = re.GoalsBool; tbComments.Text = re.Comments; EID = id; } //lblInfo.Visible = true; } } } else { Response.Redirect("Error.aspx"); } }