示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Session["USER_ID"] != null)
                {
                    String idSession = Session["USER_ID"].ToString();
                    int    id        = Convert.ToInt32(idSession);
                    psycho = new Psychologist(id);

                    ConsultPsychoInformationCommand psychoConsult = new ConsultPsychoInformationCommand(psycho);

                    try
                    {
                        psychoConsult.execute();
                        psychoConsulted = psychoConsult.getAnswer();

                        String name    = psychoConsulted._Name;
                        String surname = psychoConsulted._Surname;

                        //anchorPsycho.Attributes["data-toggle"] = "dropdown";
                        //anchorPsycho.Attributes.Add("class", "dropdown-toggle");
                        anchorPsycho.InnerText = name + " " + surname;
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                else
                {
                    Response.Redirect("~/View/Home/index.aspx", false);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Session["USER_ID"] == null)
                {
                    Response.Redirect("~/View/Home/index.aspx", false);
                }
                else
                {
                    String idSession = Session["USER_ID"].ToString();
                    int    id        = Convert.ToInt32(idSession);
                    psychoConsulted = new Psychologist(id);

                    ConsultPsychoInformationCommand psychoConsult = new ConsultPsychoInformationCommand(psychoConsulted);

                    try
                    {
                        psychoConsult.execute();
                        psychoConsulted = psychoConsult.getAnswer();

                        nameTXT.Text               = psychoConsulted._Name;
                        secondNameTXT.Text         = psychoConsulted._SecondName;
                        surnameTXT.Text            = psychoConsulted._Surname;
                        secondSurnameTXT.Text      = psychoConsulted._SecondSurname;
                        registrationNumberTXT.Text = psychoConsulted._RegistrationNumber;
                        email_txt.Value            = psychoConsulted._Email;

                        DateTime birthdatePsycho = psychoConsulted._Birthdate;

                        date.Value = birthdatePsycho.ToString("yyyy-MM-dd");
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Session["USER_ID"] == null)
                {
                    Response.Redirect("~/View/Home/index.aspx", false);
                }
                else
                {
                    String idSession = Session["USER_ID"].ToString();
                    int    id        = Convert.ToInt32(idSession);
                    psycho = new Psychologist(id);

                    ConsultPsychoInformationCommand psychoConsult = new ConsultPsychoInformationCommand(psycho);

                    try
                    {
                        psychoConsult.execute();
                        psychoConsulted = psychoConsult.getAnswer();

                        DateTime datePsycho       = psychoConsulted._Birthdate;
                        String   datePsychoString = datePsycho.ToString("dd-MM-yyyy");

                        cedula_txt.Value         = Convert.ToString(psychoConsulted._ID);
                        matricula_txt.Value      = psychoConsulted._RegistrationNumber;
                        nombreCompleto_txt.Value = psychoConsulted._Name + " " + psychoConsulted._SecondName + " " + psychoConsulted._Surname + " " + psychoConsulted._SecondSurname;
                        fechaNac_txt.Value       = datePsychoString;
                        correo_txt.Value         = psychoConsulted._Email;
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
        }