Example #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["ContactLensesTestId"] != null)
        {
            id = Int32.Parse(Request.QueryString["ContactLensesTestId"]);
            ContactLensesTest = CntAriCli.GetContactLensesTest(id, ctx);
            refractometry     = ContactLensesTest.Refractometry;
            LoadData(ContactLensesTest);
        }
        if (Request.QueryString["RefractometryId"] != null)
        {
            id            = int.Parse(Request.QueryString["RefractometryId"]);
            refractometry = (Refractometry)CntAriCli.GetExaminationAssigned(id, ctx);
        }
    }
Example #2
0
 protected bool CreateChange()
 {
     if (!DataOk())
     {
         return(false);
     }
     if (ContactLensesTest == null)
     {
         ContactLensesTest = new ContactLensesTest();
         ContactLensesTest.Refractometry = refractometry;
         UnloadData(ContactLensesTest);
         ctx.Add(ContactLensesTest);
     }
     else
     {
         ContactLensesTest = CntAriCli.GetContactLensesTest(ContactLensesTest.Id, ctx);
         UnloadData(ContactLensesTest);
     }
     ctx.SaveChanges();
     RadAjaxManager1.ResponseScripts.Add(String.Format("showDialog('{0}','{1}','success',null,0,0)"
                                                       , Resources.GeneralResource.Success
                                                       , Resources.GeneralResource.CorrectlyStored));
     Response.Redirect(String.Format("ContactLensesTestForm.aspx?ContactLensesTestId={0}", ContactLensesTest.Id));
     return(true);
 }