Esempio n. 1
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 == "examinationassigned"
                            select p).FirstOrDefault <Process>();
            per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
            btnAccept.Visible = per.Modify;
        }

        //
        if (Request.QueryString["GlassesTestId"] != null)
        {
            id            = Int32.Parse(Request.QueryString["GlassesTestId"]);
            glassesTest   = CntAriCli.GetGlassesTest(id, ctx);
            refractometry = glassesTest.Refractometry;
            LoadData(glassesTest);
        }
        if (Request.QueryString["RefractometryId"] != null)
        {
            id            = int.Parse(Request.QueryString["RefractometryId"]);
            refractometry = (Refractometry)CntAriCli.GetExaminationAssigned(id, ctx);
        }
    }
Esempio n. 2
0
 protected bool CreateChange()
 {
     if (!DataOk())
     {
         return(false);
     }
     if (glassesTest == null)
     {
         glassesTest = new GlassesTest();
         glassesTest.Refractometry = refractometry;
         UnloadData(glassesTest);
         ctx.Add(glassesTest);
     }
     else
     {
         glassesTest = CntAriCli.GetGlassesTest(glassesTest.Id, ctx);
         UnloadData(glassesTest);
     }
     ctx.SaveChanges();
     RadAjaxManager1.ResponseScripts.Add(String.Format("showDialog('{0}','{1}','success',null,0,0)"
                                                       , Resources.GeneralResource.Success
                                                       , Resources.GeneralResource.CorrectlyStored));
     Response.Redirect(String.Format("GlassesTestForm.aspx?GlassesTestId={0}", glassesTest.Id));
     return(true);
 }
Esempio n. 3
0
    protected void UnloadData(GlassesTest gt)
    {
        gt.FarAcuity               = txtFarAcuity.Text;
        gt.FarAxisLeftEye          = txtFarAxisLeftEye.Text;
        gt.FarAxisRightEye         = txtFarAxisRightEye.Text;
        gt.FarCenters              = txtFarCenter.Text;
        gt.FarCylinderLeftEye      = txtFarCylinderLeftEye.Text;
        gt.FarCylinderRightEye     = txtFarCylinderRightEye.Text;
        gt.FarPrismLeftEye         = txtFarPrismLeftEye.Text;
        gt.FarPrimsRightEye        = txtFarPrismRightEye.Text;
        gt.FarSphericityLeftEye    = txtFarSphericityLefttEye.Text;
        gt.FarSphericityRightEye   = txtFarSphericityRightEye.Text;
        gt.FarVisualAcuityLeftEye  = txtFarVisualAcuityLeftEye.Text;
        gt.FarVisualAcuityRightEye = txtFarVisualAcuityRightEye.Text;

        gt.CloseAcuity             = txtCloseAcuity.Text;
        gt.CloseAxisLeftEye        = txtCloseAxisLeftEye.Text;
        gt.CloseAxisRightEye       = txtCloseAxisRightEye.Text;
        gt.CloseCenters            = txtCloseCenter.Text;
        gt.CloseCylinderLeftEye    = txtCloseCylinderLeftEye.Text;
        gt.CloseCylinderRightEye   = txtCloseCylinderRightEye.Text;
        gt.ClosePrismLeftEye       = txtClosePrismLeftEye.Text;
        gt.ClosePrismRightEye      = txtClosePrismRightEye.Text;
        gt.CloseSphericityLeftEye  = txtCloseSphericityLefttEye.Text;
        gt.CloseSphericityRightEye = txtCloseSphericityRightEye.Text;
        gt.CloseAcuityLeftEye      = txtCloseVisualAcuityLeftEye.Text;
        gt.CloseAcuityRightEye     = txtCloseVisualAcuityRightEye.Text;

        gt.BothAcuity             = txtBothAcuity.Text;
        gt.BothAxisLeftEye        = txtBothAxisLeftEye.Text;
        gt.BothAxisRightEye       = txtBothAxisRightEye.Text;
        gt.BothCenters            = txtBothCenter.Text;
        gt.BothCylinderLeftEye    = txtBothCylinderLeftEye.Text;
        gt.BothCylinderRightEye   = txtBothCylinderRightEye.Text;
        gt.BothPrismLeftEye       = txtBothPrismLeftEye.Text;
        gt.BothPrismRightEye      = txtBothPrismRightEye.Text;
        gt.BothSphericityLeftEye  = txtBothSphericityLefttEye.Text;
        gt.BothSphericityRightEye = txtBothSphericityRightEye.Text;
        gt.BothAcuityLeftEye      = txtBothVisualAcuityLeftEye.Text;
        gt.BothAcuityRightEye     = txtBothVisualAcuityRightEye.Text;


        gt.Comments = txtComments.Text;
    }