Exemple #1
0
 protected bool CreateChange()
 {
     if (!DataOk())
     {
         return(false);
     }
     if (atsg == null)
     {
         atsg = new AntSegment();
         atsg.OphthalmologicVisit = oVisit;
         UnloadData(atsg);
         ctx.Add(atsg);
     }
     else
     {
         atsg = CntAriCli.GetAntSegment(atsg.Id, ctx);
         UnloadData(atsg);
     }
     ctx.SaveChanges();
     RadAjaxManager1.ResponseScripts.Add(String.Format("showDialog('{0}','{1}','success',null,0,0)"
                                                       , Resources.GeneralResource.Success
                                                       , Resources.GeneralResource.CorrectlyStored));
     Response.Redirect(String.Format("AntSegmentForm.aspx?AntSegmentId={0}", atsg.Id));
     return(true);
 }
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 = (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["AntSegmentId"] != null)
        {
            id     = Int32.Parse(Request.QueryString["AntSegmentId"]);
            atsg   = CntAriCli.GetAntSegment(id, ctx);
            oVisit = atsg.OphthalmologicVisit;
            LoadData(atsg);
        }
        if (Request.QueryString["OphVisitId"] != null)
        {
            id     = int.Parse(Request.QueryString["OphVisitId"]);
            oVisit = (OphthalmologicVisit)CntAriCli.GetVisit(id, ctx);
            if (oVisit.AntSegments.Count > 0)
            {
                atsg = oVisit.AntSegments[0];
                LoadData(atsg);
            }
        }
    }