protected void Page_Load(object sender, EventArgs e)
        {
            if (Roles.IsUserInRole(ERoles.InternalS.ToString()) || Roles.IsUserInRole(ERoles.Nutritionist.ToString()) || Roles.IsUserInRole(ERoles.Manager.ToString()) || Roles.IsUserInRole(ERoles.PhysicalS.ToString()))
            {
                if (!Page.IsPostBack)
                {
                    // if in

                    if (Roles.IsUserInRole(ERoles.InternalS.ToString()) || Roles.IsUserInRole(ERoles.Manager.ToString()))
                    {
                        if (Request["show"] != null)
                        {
                            show            = true;
                            lblInfo.Visible = true;
                        }
                    }

                    if (Roles.IsUserInRole(ERoles.PhysicalS.ToString()) || Roles.IsUserInRole(ERoles.Manager.ToString()) || Roles.IsUserInRole(ERoles.InternalS.ToString()) || Roles.IsUserInRole(ERoles.Manager.ToString()))
                    {
                        if (Request["ID"] != null)
                        {
                            int id = Convert.ToInt32(Request["ID"]);
                            EID = id;
                            using (ClubDBEntities club = new ClubDBEntities())
                            {
                                var result = club.getTRequestReport(id).FirstOrDefault();
                                tbDia.Text        = result.Diagnosis;
                                tbGoals.Text      = result.Goals;
                                tbPrecaution.Text = result.Precaution;
                                tbName.Text       = result.PatientName;
                                tbPhone.Text      = result.Phone;
                                tbNation.Text     = result.Nation;
                                tbDOB.Text        = result.DOB;
                                tbID.Text         = result.FileID;
                                tbDate.Text       = result.Date;
                                readOnly();
                            }
                        }
                    }
                }
            }
            else
            {
                Response.Redirect("Error.aspx");
            }
        }
Exemple #2
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.getTRequestReport(date);
             if (result.Count() != 0)
             {
                 gvRequests.DataSource = result;
                 gvRequests.DataBind();
                 pnlG.Visible = true;
             }
         }
     }
 }
        protected void btnPrint_Click(object sender, EventArgs e)
        {
            if (!saved)
            {
                Save();
            }
            ReportDocument report = new ReportDocument();

            report.Load(Server.MapPath("TRequestCR.rpt"));
            using (ClubDBEntities club = new ClubDBEntities())
            {
                report.SetDataSource(club.getTRequestReport(EID));
                string printer = ClubWebApp.Properties.Settings.Default.DefaultPrinter;
                report.PrintOptions.PrinterName = printer;
                report.PrintToPrinter(1, false, 0, 0);
            }
        }