コード例 #1
0
 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
 {
     RadGrid1.Rebind();
     if (e.Argument == "new")
     {
         RadGrid1.Rebind();
         RadGrid1.CurrentPageIndex = RadGrid1.PageCount - 1;
     }
     if (e.Argument == "yes")
     {
         if (Session["DeleteId"] != null)
         {
             try
             {
                 anestheticServiceNoteId = (int)Session["DeleteId"];
                 AnestheticServiceNote asn = CntAriCli.GetAnestheticServiceNote(anestheticServiceNoteId, ctx);
                 CntAriCli.DeleteAnestheticServiceNote(asn, ctx);
                 RadGrid1.Rebind();
                 Session["DeleteId"] = null;
             }
             catch (Exception ex)
             {
                 Session["Exception"] = ex;
                 string command = String.Format("showDialog('Error','{0}','error',null, 0, 0)"
                                                , Resources.GeneralResource.DeleteRecordFail);
                 RadAjaxManager1.ResponseScripts.Add(command);
             }
         }
     }
 }
コード例 #2
0
    protected bool CreateChange()
    {
        if (asn == null)
        {
            firstTime = true;
            asn       = new AnestheticServiceNote();
            UnloadData(asn);
            ctx.Add(asn);
            lschk = CntAriCli.SaveTckChecks(asn);
        }
        else
        {
            asn = CntAriCli.GetAnestheticServiceNote(anestheticServiceNoteId, ctx);
            //lschk = CntAriCli.SaveChecks(asn);
            lschk = CntAriCli.SaveTckChecks(asn);
            bool procedurechanged = false;
            if (Session["procedurechanged"] != null)
            {
                procedurechanged = (bool)Session["procedurechanged"];
            }
            if (procedurechanged)
            {
                firstTime = true;
                Session["procedurechanged"] = null;

                IList <AnestheticTicket> tickets = asn.AnestheticTickets;

                foreach (AnestheticTicket item in tickets)
                {
                    ctx.Delete(CntAriCli.GetTicket(item.TicketId, ctx));
                }
                ctx.SaveChanges();

                asn.AnestheticTickets.Clear();
                asn.Procedures.Clear();
            }
            UnloadData(asn);
        }
        //bool res = UpdateRelatedTickets(asn, lschk);
        // ---
        bool res = CntAriCli.UpdateRelatedTckV2(asn, lschk, ctx);

        // Update anesthetic service note total
        asn.Total = asn.AnestheticTickets.Sum(x => x.Amount);
        ctx.SaveChanges();
        if (firstTime)
        {
            firstTime = false;
            Response.Redirect(String.Format("AnestheticServiceNoteForm.aspx?AnestheticServiceNoteId={0}", asn.AnestheticServiceNoteId));
        }
        return(res);
    }
コード例 #3
0
ファイル: RptAnesNote.cs プロジェクト: avontd2868/AriClinic
        public RptAnesNote(int idanesnote, AriClinicContext ctx1)
            : this()
        {
            ctx1        = new AriClinicContext("AriClinicContext");
            companyname = CntAriCli.GetHealthCompany(ctx1).Name;
            AnestheticServiceNote aneNote = CntAriCli.GetAnestheticServiceNote(idanesnote, ctx1);

            if (aneNote != null)
            {
                this.DataSource = aneNote;
                //this.subReport1.ReportSource.DataSource = aneNote.AnestheticTickets;
                this.subReport1.Report.DataSource = aneNote.AnestheticTickets;
            }
        }
コード例 #4
0
    protected void UnloadData(AnestheticTicket tck)
    {
        tck.TicketDate       = (DateTime)rddpTicketDate.SelectedDate;
        policyId             = Int32.Parse(rdcbPolicy.SelectedValue);
        tck.Policy           = CntAriCli.GetPolicy(policyId, ctx);
        insuranceServiceId   = Int32.Parse(txtInsuranceServiceId.Text);
        tck.InsuranceService = CntAriCli.GetInsuranceService(insuranceServiceId, ctx);
        clinicId             = Int32.Parse(rdcbClinic.SelectedValue);
        tck.Clinic           = CntAriCli.GetClinic(clinicId, ctx);
        tck.User             = CntAriCli.GetUser(user.UserId, ctx);
        tck.Description      = txtDescription.Text;
        tck.Amount           = Decimal.Parse(txtAmount.Text);
        tck.Checked          = chkChecked.Checked;
        if (txtProfessionalId.Text != "")
        {
            professionalId   = Int32.Parse(txtProfessionalId.Text);
            tck.Professional = CntAriCli.GetProfessional(professionalId, ctx);
        }
        else
        {
            tck.Professional = null;
        }
        if (txtSurgeonId.Text != "")
        {
            surgeonId   = Int32.Parse(txtSurgeonId.Text);
            tck.Surgeon = CntAriCli.GetProfessional(surgeonId, ctx);
        }
        else
        {
            tck.Surgeon = null;
        }
        if (txtProcedureId.Text != "")
        {
            procedureId   = Int32.Parse(txtProcedureId.Text);
            tck.Procedure = CntAriCli.GetProcedure(procedureId, ctx);
        }
        else
        {
            tck.Procedure = null;
        }
        tck.Comments = txtComments.Text;

        // assign anesthetic note if any.
        if (asn != null)
        {
            asn = CntAriCli.GetAnestheticServiceNote(asn.AnestheticServiceNoteId, ctx);
            tck.AnestheticServiceNote = asn;
        }
    }
コード例 #5
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 == "policy"
                         select p).FirstOrDefault <Process>();
         per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
     }
     // cheks if is call from another form
     if (Request.QueryString["Type"] != null)
     {
         type = Request.QueryString["Type"];
     }
     // read the realated patient
     if (Request.QueryString["PatientId"] != null)
     {
         patientId = Int32.Parse(Request.QueryString["PatientId"]);
         pat       = CntAriCli.GetPatient(patientId, ctx);
         cus       = pat.Customer;
     }
     // read passed customer if any
     if (Request.QueryString["CustomerId"] != null)
     {
         customerId = Int32.Parse(Request.QueryString["CustomerId"]);
         cus        = CntAriCli.GetCustomer(customerId, ctx);
     }
     //
     if (Request.QueryString["NotPaid"] != null)
     {
         notPaid = true;
     }
     //
     if (type == "InTab")
     {
         HtmlControl tt = (HtmlControl)this.FindControl("TitleArea");
         tt.Attributes["class"] = "ghost";
         // hide patient column
         RadGrid1.Columns.FindByDataField("Policy.Customer.FullName").Visible = false;
         //
         RadGrid1.PageSize = 6;
     }
     else
     {
     }
     if (Request.QueryString["AnestheticServiceNoteId"] != null)
     {
         anestheticServiceNoteId = Int32.Parse(Request.QueryString["AnestheticServiceNoteId"]);
         asn = CntAriCli.GetAnestheticServiceNote(anestheticServiceNoteId, ctx);
         HtmlControl tt = (HtmlControl)this.FindControl("TitleArea");
         tt.Attributes["class"] = "ghost";
         // here the fields that must be hidden
         RadGrid1.Columns.FindByDataField("TicketDate").Visible = false;
         RadGrid1.Columns.FindByDataField("Policy.Customer.FullName").Visible = false;
         RadGrid1.Columns.FindByDataField("Checked").Visible     = false;
         RadGrid1.Columns.FindByDataField("Clinic.Name").Visible = false;
     }
     if (Request.QueryString["ServiceNoteId"] != null)
     {
         serviceNoteId = int.Parse(Request.QueryString["ServiceNoteId"]);
         sn            = CntAriCli.GetServiceNote(serviceNoteId, ctx);
         HtmlControl tt = (HtmlControl)this.FindControl("TitleArea");
         tt.Attributes["class"] = "ghost";
         // here the fields that must be hidden
         RadGrid1.Columns.FindByDataField("TicketDate").Visible = false;
         RadGrid1.Columns.FindByDataField("Policy.Customer.FullName").Visible = false;
         RadGrid1.Columns.FindByDataField("Checked").Visible     = false;
         RadGrid1.Columns.FindByDataField("Clinic.Name").Visible = false;
         RadGrid1.Columns.FindByDataField("Paid").Visible        = false;
     }
     // translate filters
     CntWeb.TranslateRadGridFilters(RadGrid1);
     //
 }
コード例 #6
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 == "ticket"
                            select p).FirstOrDefault <Process>();
            per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
            btnAccept.Visible = per.Modify;
        }


        if (Request.QueryString["CustomerId"] != null)
        {
            customerId = Int32.Parse(Request.QueryString["CustomerId"]);
            cus        = CntAriCli.GetCustomer(customerId, ctx);
            //txtCustomerId.Text = cus.PersonId.ToString();

            rdcComercialName.Items.Clear();
            rdcComercialName.Items.Add(new RadComboBoxItem(cus.FullName, cus.PersonId.ToString()));
            rdcComercialName.SelectedValue = cus.PersonId.ToString();
            rdcComercialName.Enabled       = false;

            btnCustomerId.Visible = false;
        }
        else
        {
            LoadClinicCombo(null);
        }
        if (Session["Clinic"] != null)
        {
            cl = (Clinic)Session["Clinic"];
        }
        //
        if (Request.QueryString["AnestheticServiceNoteId"] != null)
        {
            anestheticServiceNoteId = Int32.Parse(Request.QueryString["AnestheticServiceNoteId"]);
            asn        = CntAriCli.GetAnestheticServiceNote(anestheticServiceNoteId, ctx);
            cus        = asn.Customer;
            customerId = cus.PersonId;
            if (!IsPostBack)
            {
                LoadData(asn);
            }
            // Load internal frame
            HtmlControl frm = (HtmlControl)this.FindControl("ifTickets");
            frm.Attributes["src"] = String.Format("TicketGrid.aspx?AnestheticServiceNoteId={0}", anestheticServiceNoteId);
        }
        else
        {
            // If there isn't a ticket the default date must be today
            rddpServiceNoteDate.SelectedDate = DateTime.Now;
            LoadClinicCombo(null);
        }
    }