protected void btnPrint_Click(object sender, EventArgs e) { if (!saved) { Save(); } ReportDocument report = new ReportDocument(); report.Load(Server.MapPath("EvaluationCR.rpt")); using (ClubDBEntities club = new ClubDBEntities()) { report.SetDataSource(club.getEvaluationreport(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.getEvaluationreport(date); if (result.Count() != 0) { gvRequests.DataSource = result; gvRequests.DataBind(); pnlG.Visible = true; lblError.Visible = false; } else { pnlG.Visible = false; lblError.Text = "No Data"; lblError.Visible = true; } } } if (!string.IsNullOrEmpty(tbID.Text)) { using (ClubDBEntities club = new ClubDBEntities()) { var result = club.getEvaluationreport(tbID.Text); if (result.Count() != 0) { gvRequests.DataSource = result; gvRequests.DataBind(); pnlG.Visible = true; lblError.Visible = false; } else { pnlG.Visible = false; lblError.Text = "No Data"; lblError.Visible = true; } } } }
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; lblInfo.Visible = false; int id = Convert.ToInt32(Request["ID"]); using (ClubDBEntities club = new ClubDBEntities()) { var result = club.getEvaluationreport(id).First(); tbID.Text = result.FileID; tbDate.Text = result.Date; tbDOB.Text = result.DOB.ToString(); tbName.Text = result.PatientName; tbNation.Text = result.Nation; tbPhone.Text = result.Phone; tbObjective.Text = result.Objective; tbHistory.Text = result.History; tbAssess.Text = result.Assessment; tbGoals.Text = result.Goals; tbTreat.Text = result.Treatment; tbDia.Text = result.Diagnosis; readOnly(); EID = id; } } } } else { Response.Redirect("Error.aspx"); } }