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 == "Estimate" select p).FirstOrDefault <Process>(); per = CntAriCli.GetPermission(user.UserGroup, proc, ctx); btnAccept.Visible = per.Modify; } // LoadComboInsurance(); // if (Request.QueryString["EstimateId"] != null) { estId = Int32.Parse(Request.QueryString["EstimateId"]); est = CntAriCli.GetEstimate(estId, ctx); } // if (Request.QueryString["EstimateLineId"] != null) { estlId = Int32.Parse(Request.QueryString["EstimateLineId"]); estl = CntAriCli.GetEstimateLine(estlId, ctx); LoadData(estl); } }
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); } }
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 == "estimate" select p).FirstOrDefault <Process>(); per = CntAriCli.GetPermission(user.UserGroup, proc, ctx); btnAccept.Visible = per.Modify; } // if (Request.QueryString["RequestId"] != null) { reqId = Int32.Parse(Request.QueryString["RequestId"]); req = CntAriCli.GetRequest(reqId, ctx); txtRequestRequestId.Text = req.RequestId.ToString(); if (req.Patient != null) { txtFullName.Text = req.Patient.FullName; } else { txtFullName.Text = req.FullName; } } // if (Request.QueryString["EstimateId"] != null) { estimateId = Int32.Parse(Request.QueryString["EstimateId"]); estimate = CntAriCli.GetEstimate(estimateId, ctx); req = estimate.Request; LoadData(estimate); } else { // default values for a new Estimate rdtEstimateDate.SelectedDate = DateTime.Now; } if (Request.QueryString["Caller"] != null) { caller = Request.QueryString["Caller"]; } }
protected bool CreateChange() { if (!DataOk()) { return(false); } if (estimate == null) { estimate = new Estimate(); UnloadData(estimate); ctx.Add(estimate); } else { estimate = CntAriCli.GetEstimate(estimateId, ctx); UnloadData(estimate); } ctx.SaveChanges(); return(true); }