Exemple #1
0
    protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e)
    {
        // Eliminar la cita
        int id = (int)e.Appointment.ID;

        appointment = CntAriCli.GetAppointment(id, ctx);
        ctx.Delete(appointment);
        ctx.SaveChanges();
        RadAjaxManager1.ResponseScripts.Add("refreshScheduler();");
    }
Exemple #2
0
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        string estado = e.Appointment.Description;
        int    id     = (int)e.Appointment.ID;

        appointment = CntAriCli.GetAppointment(id, ctx);
        //Modificamos la apariencia según el estado
        switch (estado)
        {
        case "0":
            // Citado dejamos el item como está
            e.Appointment.CssClass = "rsCategoryWhite";
            break;

        case "1":
            // Programada
            e.Appointment.CssClass = "rsCategoryBlue";     //rsCategoryRed
            break;

        case "2":
            // Sala de espera
            e.Appointment.CssClass = "rsCategoryPink";     //rsCategoryGreen
            break;

        case "3":
            // Atendido
            e.Appointment.CssClass = "rsCategoryGreen";     //rsCategoryYellow
            break;

        case "4":
            e.Appointment.CssClass = "rsCategoryYellow";
            break;

        case "5":
            // No presentado / Sin hora?
            e.Appointment.CssClass = "rsCategoryOrange";     //rsCategoryBlue
            break;

        default:
            break;
        }
        // now we charge the new description
        e.Appointment.Description = CntAriCli.GetAppointmentDescription(appointment, ctx);
    }
Exemple #3
0
    protected void Page_Init(object sender, EventArgs e)
    {
        ctx = new AriClinicContext("AriClinicContext");
        // security control, it must be a user logged
        if (Session["User"] == null)
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            user = (User)Session["User"];
            user = CntAriCli.GetUser(user.UserId, ctx);
            Process proc = (from p in ctx.Processes
                            where p.Code == "visit"
                            select p).FirstOrDefault <Process>();
            per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
            btnAccept.Visible = per.Modify;
            if (user.Professionals.Count > 0)
            {
                professional = user.Professionals[0];
                LoadComboProfesional(professional);
            }
        }

        //
        if (Request.QueryString["VisitId"] != null)
        {
            visitId = Int32.Parse(Request.QueryString["VisitId"]);
            visit   = CntAriCli.GetVisit(visitId, ctx);
            LoadData(visit);
        }
        else
        {
            rdpVisitDate.SelectedDate = DateTime.Now;
            // load professional
            if (Session["Professional"] != null)
            {
                LoadComboProfesional((Professional)Session["Professional"]);
            }
            // called from an appointment?
            if (Request.QueryString["AppointmentId"] != null)
            {
                app = CntAriCli.GetAppointment(int.Parse(Request.QueryString["AppointmentId"]), ctx);
                if (app != null)
                {
                    Patient pat = app.Patient;
                    rdcPatient.Items.Clear();
                    rdcPatient.Items.Add(new RadComboBoxItem(pat.FullName, pat.PersonId.ToString()));
                    rdcPatient.SelectedValue = pat.PersonId.ToString();
                    //
                    rdpVisitDate.SelectedDate = app.BeginDateTime;
                    //
                    LoadComboProfesional(app.Professional);
                    //
                    AppointmentType appt = app.AppointmentType;
                    rdcAppointmentType.Items.Clear();
                    rdcAppointmentType.Items.Add(new RadComboBoxItem(appt.Name, appt.AppointmentTypeId.ToString()));
                    rdcAppointmentType.SelectedValue = appt.AppointmentTypeId.ToString();
                    //
                    fromAppointment = true;
                }
            }
        }
        //
        if (Request.QueryString["PatientId"] != null)
        {
            patientId = int.Parse(Request.QueryString["PatientId"]);
            patient   = CntAriCli.GetPatient(patientId, ctx);
            // fix rdc with patient
            rdcPatient.Items.Clear();
            rdcPatient.Items.Add(new RadComboBoxItem(patient.FullName, patient.PersonId.ToString()));
            rdcPatient.SelectedValue = patient.PersonId.ToString();
            rdcPatient.Enabled       = false;
        }
        //
        if (Request.QueryString["Type"] != null)
        {
            type = Request.QueryString["Type"];
            if (type == "InTab")
            {
                HtmlControl tt = (HtmlControl)this.FindControl("TitleArea");
                tt.Attributes["class"] = "ghost";
            }
        }
        if (Request.QueryString["Caller"] != null)
        {
            caller = Request.QueryString["Caller"];
        }
    }
    protected void Page_Init(object sender, EventArgs e)
    {
        ctx = new AriClinicContext("AriClinicContext");
        // security control, it must be a user logged
        if (Session["User"] == null)
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            user = CntAriCli.GetUser((Session["User"] as User).UserId, ctx);
            user = CntAriCli.GetUser(user.UserId, ctx);
            Process proc = (from p in ctx.Processes
                            where p.Code == "appointment"
                            select p).FirstOrDefault <Process>();
            per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
            btnAccept.Visible = per.Modify;
            if (user.Professionals.Count > 0)
            {
                professional = user.Professionals[0];
            }
        }
        if (Request.QueryString["DiaryId"] != null)
        {
            // Diary passed
            Diary dia = CntAriCli.GetDiary(int.Parse(Request.QueryString["DiaryId"]), ctx);
            if (dia != null)
            {
                LoadDiaryCombo(dia);
            }
        }
        if (Request.QueryString["PatientId"] != null)
        {
            // Patient passed
            Patient pat = CntAriCli.GetPatient(int.Parse(Request.QueryString["PatientId"]), ctx);
            LoadPatientCombo(pat);
        }
        if (Request.QueryString["AppointmentId"] != null)
        {
            appId = int.Parse(Request.QueryString["AppointmentId"]);
            app   = CntAriCli.GetAppointment(appId, ctx);
        }

        LoadData(app);

        // Must be check after load data.
        if (Request.QueryString["BeginDateTime"] != null)
        {
            beginDateTime = GetCorrectDateTime(Request.QueryString["BeginDateTime"]);
            rddtBeginDateTime.SelectedDate = beginDateTime;
        }
        if (Request.QueryString["EndDateTime"] != null)
        {
            endDateTime = GetCorrectDateTime(Request.QueryString["EndDateTime"]);
            rddtEndDateTime.SelectedDate = endDateTime;
            // TODO: Recalculate duration.
        }
        // Appointement moved
        if (beginDateTime != null && app != null)
        {
            DateTime bt = (DateTime)beginDateTime;
            DateTime et = bt.AddMinutes(app.Duration);
            rddtEndDateTime.SelectedDate = et;
        }
        // Appintment resized
        if (beginDateTime != null && endDateTime != null)
        {
            DateTime bt = (DateTime)beginDateTime;
            DateTime et = (DateTime)endDateTime;
            TimeSpan t  = et.Subtract(bt);
            int      d  = t.Minutes + (t.Hours * 60);
            txtDuration.Text = d.ToString();
        }
    }
 protected void Page_Init(object sender, EventArgs e)
 {
     ctx = new AriClinicContext("AriClinicContext");
     // security control, it must be a user logged
     if (Session["User"] == null)
     {
         Response.Redirect("Default.aspx");
     }
     else
     {
         user = CntAriCli.GetUser((Session["User"] as User).UserId, ctx);
         user = CntAriCli.GetUser(user.UserId, ctx);
         Process proc = (from p in ctx.Processes
                         where p.Code == "visit"
                         select p).FirstOrDefault <Process>();
         per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
     }
     // cheks if is call from another form
     if (Request.QueryString["Type"] != null)
     {
         type = Request.QueryString["Type"];
     }
     // read patient information
     if (Request.QueryString["PatientId"] != null)
     {
         patientId = int.Parse(Request.QueryString["PatientId"]);
         patient   = CntAriCli.GetPatient(patientId, ctx);
     }
     if (Request.QueryString["VisitId"] != null)
     {
         visitId   = Int32.Parse(Request.QueryString["VisitId"]);
         visit     = CntAriCli.GetVisit(visitId, ctx);
         patient   = visit.Patient;
         patientId = patient.PersonId;
         string title = "";
         if (visit.VisitReason != null)
         {
             title = String.Format("{0} ({1:dd/MM/yyyy}) {2}",
                                   visit.VisitReason.Name,
                                   visit.VisitDate,
                                   visit.Patient.FullName);
         }
         else
         {
             title = String.Format("{0} ({1:dd/MM/yyyy})",
                                   visit.Patient.FullName,
                                   visit.VisitDate);
         }
         lblTitle.Text = title;
         this.Title    = title;
     }
     else
     {
         lblTitle.Text = "Nueva visita";
     }
     if (Request.QueryString["AppointmentId"] != null)
     {
         appinfId = int.Parse(Request.QueryString["AppointmentId"]);
         appinf   = CntAriCli.GetAppointment(appinfId, ctx);
     }
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
     }
 }