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 == "agenda"
                         select p).FirstOrDefault <Process>();
         per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
         btnAccept.Visible = per.Modify;
     }
     if (Request.QueryString["DiaryId"] != null)
     {
         agendaId = int.Parse(Request.QueryString["DiaryId"]);
         agenda   = CntAriCli.GetDiary(agendaId, ctx);
     }
     LoadData(agenda);
 }
Exemple #2
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 = CntAriCli.GetUser((Session["User"] as User).UserId, ctx);
            Process proc = (from p in ctx.Processes
                            where p.Code == "rtickets"
                            select p).FirstOrDefault <Process>();
            per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
        }
        // cheks if is call from another form
        if (Request.QueryString["Report"] != null)
        {
            report = Request.QueryString["Report"];
        }
        if (Request.QueryString["FDate"] != null)
        {
            fDate = CntWeb.ParseUrlDate(Request.QueryString["FDate"]);
        }
        if (Request.QueryString["TDate"] != null)
        {
            tDate = CntWeb.ParseUrlDate(Request.QueryString["TDate"]);
        }
        if (Request.QueryString["Diary"] != null)
        {
            diary = CntAriCli.GetDiary(int.Parse(Request.QueryString["Diary"]), ctx);
        }
        if (Request.QueryString["Visit"] != null)
        {
            visit = CntAriCli.GetVisit(int.Parse(Request.QueryString["Visit"]), ctx);
        }
        if (Request.QueryString["Treatment"] != null)
        {
            treatment = CntAriCli.GetTreatment(int.Parse(Request.QueryString["Treatment"]), ctx);
        }
        if (Request.QueryString["Invoice"] != null)
        {
            invoice = CntAriCli.GetInvoice(int.Parse(Request.QueryString["Invoice"]), ctx);
        }
        if (Request.QueryString["AmendmentInvoice"] != null)
        {
            aInvoice = CntAriCli.GetAmendementInvoice(int.Parse(Request.QueryString["AmendmentInvoice"]), ctx);
        }

        if (Request.QueryString["PrescriptionGlasses"] != null)
        {
            prescriptionGlasses = CntAriCli.GetPrescriptionGlasses(int.Parse(Request.QueryString["PrescriptionGlasses"]), ctx);
        }
        if (Request.QueryString["Estimate"] != null)
        {
            estimate = CntAriCli.GetEstimate(int.Parse(Request.QueryString["Estimate"]), 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 = CntAriCli.GetUser((Session["User"] as User).UserId, ctx);
         user = CntAriCli.GetUser(user.UserId, ctx);
         Process proc = (from p in ctx.Processes
                         where p.Code == "scheduler"
                         select p).FirstOrDefault <Process>();
         if (proc != null)
         {
             per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
         }
     }
     // Do you want to see a Diary?
     if (Request.QueryString["DiaryId"] != null)
     {
         diaryId = int.Parse(Request.QueryString["DiaryId"]);
         diary   = CntAriCli.GetDiary(diaryId, ctx);
         if (diary != null)
         {
             lblTitle.Text = diary.Name;
             this.Title    = diary.Name;
         }
     }
     // Do you want to see a Professional?
     if (Request.QueryString["ProfessionalId"] != null)
     {
         professionalId = int.Parse(Request.QueryString["ProfessionalId"]);
         professional   = CntAriCli.GetProfessional(professionalId, ctx);
         if (professional != null)
         {
             lblTitle.Text = professional.FullName;
         }
     }
 }
 protected void UnloadData(AppointmentInfo app)
 {
     app.Patient         = CntAriCli.GetPatient(int.Parse(rdcPatient.SelectedValue), ctx);
     app.Diary           = CntAriCli.GetDiary(int.Parse(rdcDiary.SelectedValue), ctx);
     app.Professional    = CntAriCli.GetProfessional(int.Parse(rdcProfessional.SelectedValue), ctx);
     app.AppointmentType = CntAriCli.GetAppointmentType(int.Parse(rdcAppointmentType.SelectedValue), ctx);
     app.BeginDateTime   = (DateTime)rddtBeginDateTime.SelectedDate;
     app.EndDateTime     = (DateTime)rddtEndDateTime.SelectedDate;
     app.Duration        = int.Parse(txtDuration.Text);
     app.Status          = ddlStatus.SelectedValue;
     if (rddtArrival.SelectedDate != null)
     {
         app.Arrival = (DateTime)rddtArrival.SelectedDate;
     }
     else
     {
         app.Arrival = DateTime.Parse("01/01/0001 00:00:00");
     }
     app.Subject  = CntAriCli.GetAppointmentSubject(app);
     app.Comments = txtComments.Text;
 }
    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();
        }
    }