Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClPersona     = new Cl_Persona();
            ClUtilitarios = new Cl_Utilitarios();
            ClTraductor   = new Cl_Traductor();
            ClUsuario     = new Cl_Usuario();
            ClCita        = new Cl_Cita();

            BtnGrabar.Click += BtnGrabar_Click;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                int     PersonaId = Convert.ToInt32(ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["Person"].ToString()), true));
                DataSet DsArchivo = new DataSet();
                DsArchivo = ClPersona.Get_Datos_Persona(Convert.ToInt32(PersonaId), Session["Idioma"].ToString());
                //LblNombreUsuario.Text = DsArchivo.Tables["DATOS"].Rows[0]["Nombre"].ToString();
                if (DsArchivo.Tables["DATOS"].Rows[0]["Foto_Perfil"].ToString() != "")
                {
                    byte[] bytes = (byte[])DsArchivo.Tables["DATOS"].Rows[0]["Foto_Perfil"];
                    ImgPerfil.Src = "data:image/png;base64," + Convert.ToBase64String(bytes);
                }
                LblNombreDato.InnerText = DsArchivo.Tables["DATOS"].Rows[0]["Nombres"] + " " + DsArchivo.Tables["DATOS"].Rows[0]["Apellidos"];
                DsArchivo.Clear();
                DataSet dsEspecialidad = ClPersona.Get_Especialidad_Usuario(PersonaId, Session["Idioma"].ToString());
                if (dsEspecialidad.Tables["Datos"].Rows.Count > 0)
                {
                    string Especialidades = "";
                    for (int i = 0; i < dsEspecialidad.Tables["Datos"].Rows.Count; i++)
                    {
                        if (Especialidades == "")
                        {
                            Especialidades = dsEspecialidad.Tables["Datos"].Rows[i]["Espe"].ToString();
                        }
                        else
                        {
                            Especialidades = Especialidades + ", " + dsEspecialidad.Tables["Datos"].Rows[i]["Espe"].ToString();
                        }
                    }
                    LblEspecialidadesDato.InnerText = Especialidades;
                }
                else
                {
                    LblEspecialidadesDato.InnerText = "";
                }
                Traduce();

                var localDateTime = DateTime.Now.ToString("yyyy-MM-dd");
                TxtFecCita.Value = localDateTime;

                var localTime = DateTime.Now.ToString("HH:mm");
                TxtHoraCita.Value = localTime;
            }
        }
Ejemplo n.º 2
0
        private void GrdDetalle_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            int     UsuarioId = Convert.ToInt32(ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["Benutzer"].ToString()), true));
            DataSet ds        = ClUsuario.GetDatosUsuarioId(UsuarioId, Session["Idioma"].ToString());
            int     PersonaId = Convert.ToInt32(ds.Tables["Datos"].Rows[0]["PersonaId"]);

            ds.Clear();
            ClUtilitarios.LlenaGrid(ClPersona.Get_Especialidad_Usuario(PersonaId, Session["Idioma"].ToString()), GrdDetalle, Session["Idioma"].ToString());
        }