Пример #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 = CntAriCli.GetUser((Session["User"] as User).UserId, ctx);
            Process proc = (from p in ctx.Processes
                            where p.Code == "usergroup"
                            select p).FirstOrDefault <Process>();
            per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
            btnAccept.Visible = per.Modify;
        }

        //
        if (Request.QueryString["HcId"] != null)
        {
            hcID = Int32.Parse(Request.QueryString["HcId"]);
            HealthcareCompany hc = CntAriCli.GetHealthCompany(ctx);
            LoadData(hc);
        }
    }
Пример #2
0
 protected void UnloadData(HealthcareCompany hc)
 {
     hc.Name                   = txtName.Text;
     hc.VATIN                  = txtVATIN.Text;
     hc.InvoiceSerial          = txtSERIAL.Text;
     hc.AmendmentInvoiceSerial = txtSERIAL2.Text;
 }
Пример #3
0
 protected void LoadData(HealthcareCompany hc)
 {
     txtHcId.Text   = hc.HcId.ToString();
     txtName.Text   = hc.Name;
     txtVATIN.Text  = hc.VATIN;
     txtSERIAL.Text = hc.InvoiceSerial;
 }
Пример #4
0
    protected void SetSessionValues()
    {
        // First check if a user is logged
        if (Session["User"] == null)
        {
            Response.Redirect("Default.aspx");
        }
        user         = CntAriCli.GetUser((Session["User"] as User).UserId, ctx);
        lblUser.Text = user.Name;

        // Clinic
        if (Session["Clinic"] != null)
        {
            cl           = CntAriCli.GetClinic((Session["Clinic"] as Clinic).ClinicId, ctx);
            lblUser.Text = String.Format("{0} ({1})", user.Name, cl.Name);
        }

        // Assign general skin
        if (Session["Skin"] != null)
        {
            RadSkinManager1.Skin = (string)Session["Skin"];
        }

        // Show company and user values
        if (Session["Company"] != null)
        {
            hc = CntAriCli.GetHealthCompany(ctx);
            lblHealthcareCompany.Text = hc.Name;
        }
    }
        private void HealthcareCompanyData(AriClinicContext ctx1)
        {
            HealthcareCompany healthcare = CntAriCli.GetHealthCompany(ctx1);

            companyname = healthcare.Name;

            foreach (Address item in healthcare.Addresses)
            {
                if (item.Type == "Primary")
                {
                    companyaddress = item;
                }
            }

            foreach (Telephone item in healthcare.Telephones)
            {
                if (item.Type == "Primary")
                {
                    companytelf = item;
                }
            }

            foreach (Email item in healthcare.Emails)
            {
                if (item.Type == "Primary")
                {
                    companyemail = item;
                }
            }

            companynif = healthcare.VATIN;
        }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // First control the type of parent page
     if (Request.QueryString["HcId"] != null)
     {
         hcId   = Int32.Parse(Request.QueryString["HcId"]);
         hc     = CntAriCli.GetHealthCompany(ctx);
         caller = "hccom"; // Called by a Healthcare Company
     }
     if (Request.QueryString["ClinicId"] != null)
     {
         clinicId = Int32.Parse(Request.QueryString["ClinicId"]);
         cl       = CntAriCli.GetClinic(clinicId, ctx);
         caller   = "clinic"; // Called by a Healthcare Company
     }
     if (Request.QueryString["PatientId"] != null)
     {
         patientId = Int32.Parse(Request.QueryString["PatientId"]);
         pat       = CntAriCli.GetPatient(patientId, ctx);
         caller    = "patient";
     }
     if (Request.QueryString["CustomerId"] != null)
     {
         customerId = Int32.Parse(Request.QueryString["CustomerId"]);
         cus        = CntAriCli.GetCustomer(customerId, ctx);
         caller     = "customer";
     }
     if (Request.QueryString["ProfessionalId"] != null)
     {
         professionalId = Int32.Parse(Request.QueryString["ProfessionalId"]);
         prof           = CntAriCli.GetProfessional(professionalId, ctx);
         caller         = "professional";
     }
 }
Пример #7
0
        public RptInvoice(int idInvoice, AriClinicContext ctx1)
            : this()
        {
            ctx1 = new AriClinicContext("AriClinicContext");
            HealthcareCompany healthcare = CntAriCli.GetHealthCompany(ctx1);

            companyname = healthcare.Name;

            foreach (Address item in healthcare.Addresses)
            {
                if (item.Type == "Primary")
                {
                    companyaddress = item;
                }
            }

            foreach (Telephone item in healthcare.Telephones)
            {
                if (item.Type == "Primary")
                {
                    companytelf = item;
                }
            }

            foreach (Email item in healthcare.Emails)
            {
                if (item.Type == "Primary")
                {
                    companyemail = item;
                }
            }

            companynif = healthcare.VATIN;

            Invoice invoice = CntAriCli.GetInvoice(idInvoice, ctx1);

            if (invoice != null)
            {
                foreach (Address item in invoice.Customer.Addresses)
                {
                    if (item.Type == "Primary")
                    {
                        customeraddress = item;
                    }
                }

                this.DataSource = invoice;
                //this.subReport1.ReportSource.DataSource = invoice.InvoiceLines;
                //this.subReport2.ReportSource.DataSource = invoice.InvoiceLines;
                this.subReport1.Report.DataSource = invoice.InvoiceLines;
                this.subReport2.Report.DataSource = invoice.InvoiceLines;
            }
        }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // Set default values
     if (!IsPostBack)
     {
         //RadSkinManager1.Skin = "Office2007";
         //Session["Skin"] = "Office2007";
         HealthcareCompany hc = CntAriCli.GetHealthCompany(ctx);
         lblHealthcareCompany.Text = hc.Name;
         Session["Company"]        = hc;
         String strVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
         lblApplication.Text = String.Format("AriClinic VRS {0}", strVersion);
     }
 }
Пример #9
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 == "invoice"
                            select p).FirstOrDefault <Process>();
            per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
            btnAccept.Visible = per.Modify;
        }
        hc = CntAriCli.GetHealthCompany(ctx);
        //
        if (Request.QueryString["InvoiceId"] != null)
        {
            invoiceId = Int32.Parse(Request.QueryString["InvoiceId"]);
            inv       = CntAriCli.GetInvoice(invoiceId, ctx);
            LoadData(inv);
        }
        else
        {
            // deafault values
            rddpInvoiceDate.SelectedDate = DateTime.Now;
            txtYear.Text          = DateTime.Now.Year.ToString();
            txtInvoiceSerial.Text = hc.InvoiceSerial;
        }
        //
        if (Request.QueryString["Caller"] != null)
        {
            caller = Request.QueryString["Caller"];
        }

        if (Session["Clinic"] != null)
        {
            cl = (Clinic)Session["Clinic"];
        }
        // always read Healt care company
    }
Пример #10
0
 /// <summary>
 /// As its name suggest if there isn't an object
 /// it'll create it. It exists modify it.
 /// </summary>
 /// <returns></returns>
 protected bool CreateChange()
 {
     if (!DataOk())
     {
         return(false);
     }
     if (hcID == 0)
     {
         HealthcareCompany hc = new HealthcareCompany();
         UnloadData(hc);
         ctx.Add(hc);
     }
     else
     {
         HealthcareCompany hc = CntAriCli.GetHealthCompany(ctx);
         UnloadData(hc);
     }
     ctx.SaveChanges();
     return(true);
 }
Пример #11
0
        public static void LoadHealthCareCompany(Empresa_sanitarium empresa, RdcModel ctxRid, AriClinicContext ctxAri)
        {
            Console.WriteLine("Empresa - > {0}", empresa.Nom_empresa);
            HealthcareCompany hc = new HealthcareCompany()
            {
                Name = empresa.Nom_empresa,
            };

            ctxAri.Add(hc);
            // associated clinics
            var rs = from c in ctxRid.Clinicas
                     where c.Id_empresa == empresa.Id_empresa
                     select c;

            foreach (Clinica clinica in rs)
            {
                Clinic clinic = new Clinic()
                {
                    Name     = clinica.Nom_clinica,
                    ClinicId = clinica.Id_clinica
                };
                ctxAri.Add(clinic);
                Address address = new Address()
                {
                    Street   = clinica.Direccion,
                    City     = clinica.Poblacion,
                    PostCode = clinica.Cod_postal,
                    Clinic   = clinic
                };
                ctxAri.Add(address);
                Telephone telephone = new Telephone()
                {
                    Number = clinica.Telefono,
                    Clinic = clinic
                };
                ctxAri.Add(telephone);
            }
        }
Пример #12
0
    protected void Launcher(string process)
    {
        switch (process)
        {
        case "exit":
            Response.Redirect("Default.aspx");
            break;

        case "parameter":
            RadAjaxManager1.ResponseScripts.Add("LaunchParameter();");
            break;

        case "helcom":
            HealthcareCompany hc = CntAriCli.GetHealthCompany(ctx);
            RadAjaxManager1.ResponseScripts.Add(String.Format("LaunchHc({0});", hc.HcId));
            break;

        case "usergroup":
            RadAjaxManager1.ResponseScripts.Add("LaunchUserGroup();");
            break;

        case "user":
            RadAjaxManager1.ResponseScripts.Add("LaunchUser();");
            break;

        case "process":
            RadAjaxManager1.ResponseScripts.Add("LaunchProcess();");
            break;

        case "permission":
            RadAjaxManager1.ResponseScripts.Add("LaunchPermission();");
            break;

        case "clinic":
            RadAjaxManager1.ResponseScripts.Add("LaunchClinic();");
            break;

        case "scat":
            RadAjaxManager1.ResponseScripts.Add("LaunchServiceCategory();");
            break;

        case "taxt":
            RadAjaxManager1.ResponseScripts.Add("LaunchTaxType();");
            break;

        case "taxwt":
            RadAjaxManager1.ResponseScripts.Add("LaunchTaxWithholdingType();");
            break;

        case "ser":
            RadAjaxManager1.ResponseScripts.Add("LaunchService();");
            break;

        case "ins":
            RadAjaxManager1.ResponseScripts.Add("LaunchInsurance();");
            break;

        case "paymentmethod":
            RadAjaxManager1.ResponseScripts.Add("LaunchPaymentMethod();");
            break;

        case "patient":
            RadAjaxManager1.ResponseScripts.Add("LaunchPatient();");
            break;

        case "customer":
            RadAjaxManager1.ResponseScripts.Add("LaunchCustomer();");
            break;

        case "professional":
            RadAjaxManager1.ResponseScripts.Add("LaunchProfessional();");
            break;

        case "ticket":
            RadAjaxManager1.ResponseScripts.Add("LaunchTicket();");
            break;

        case "asn":
            RadAjaxManager1.ResponseScripts.Add("LaunchAnestheticServiceNote();");
            break;

        case "servicenote":
            RadAjaxManager1.ResponseScripts.Add("LaunchServiceNote();");
            break;

        case "invoice":
            RadAjaxManager1.ResponseScripts.Add("LaunchInvoice();");
            break;

        case "payment":
            RadAjaxManager1.ResponseScripts.Add("LaunchPayment();");
            break;

        case "procedure":
            RadAjaxManager1.ResponseScripts.Add("LaunchProcedure();");
            break;

        case "settlement":
            RadAjaxManager1.ResponseScripts.Add("LaunchSettlement();");
            break;

        case "checks":
            RadAjaxManager1.ResponseScripts.Add("LaunchChecks();");
            break;

        case "rtickets":
            RadAjaxManager1.ResponseScripts.Add("LaunchRTickets();");
            break;

        case "rpayments":
            RadAjaxManager1.ResponseScripts.Add("LaunchRPayments();");
            break;

        case "rprofessionalsrv":
            RadAjaxManager1.ResponseScripts.Add("LaunchRProfessionalSrv();");
            break;

        case "rsurgeonsrv":
            RadAjaxManager1.ResponseScripts.Add("LaunchRSurgeonSrv();");
            break;

        case "rcategorysrv":
            RadAjaxManager1.ResponseScripts.Add("LaunchRCategorySrv();");
            break;

        case "rsrvcomparer":
            RadAjaxManager1.ResponseScripts.Add("LaunchRComparerPrices();");
            break;

        case "rnomenclator":
            RadAjaxManager1.ResponseScripts.Add("Launchrnomenclator();");
            break;

        case "rinvoicesPeriod":
            RadAjaxManager1.ResponseScripts.Add("LaunchRInvoicesPeriod();");
            break;

        case "rpatientdebt":
            RadAjaxManager1.ResponseScripts.Add("LaunchRPatientDebt();");
            break;

        case "rinsurancedebt":
            RadAjaxManager1.ResponseScripts.Add("LaunchRInsuranceDebt();");
            break;

        case "agenda":
            RadAjaxManager1.ResponseScripts.Add("LaunchAgenda();");
            break;

        case "apptype":
            RadAjaxManager1.ResponseScripts.Add("LaunchAppointmentType();");
            break;

        case "appointment":
            RadAjaxManager1.ResponseScripts.Add("LaunchAppointment();");
            break;

        case "docs":
            RadAjaxManager1.ResponseScripts.Add("LaunchDocuments();");
            break;

        case "diagnostic":
            RadAjaxManager1.ResponseScripts.Add("LaunchDiagnostic();");
            break;

        case "diagnosticassigned":
            RadAjaxManager1.ResponseScripts.Add("LaunchDiagnosticAssigned();");
            break;

        case "drug":
            RadAjaxManager1.ResponseScripts.Add("LaunchDrug();");
            break;

        case "treatment":
            RadAjaxManager1.ResponseScripts.Add("LaunchTreatment();");
            break;

        case "examination":
            RadAjaxManager1.ResponseScripts.Add("LaunchExamination();");
            break;

        case "examinationassigned":
            RadAjaxManager1.ResponseScripts.Add("LaunchExaminationAssigned();");
            break;

        case "unittype":
            RadAjaxManager1.ResponseScripts.Add("LaunchUnitType();");
            break;

        case "profInvoice":
            RadAjaxManager1.ResponseScripts.Add("LaunchProfiIvoice();");
            break;

        case "profInvoices":
            RadAjaxManager1.ResponseScripts.Add("LaunchProfInvoices();");
            break;

        case "rbombasPCEA":
            RadAjaxManager1.ResponseScripts.Add("LaunchbombasPCEA();");
            break;

        case "labtest":
            RadAjaxManager1.ResponseScripts.Add("LaunchLabTest();");
            break;

        case "labtestassigned":
            RadAjaxManager1.ResponseScripts.Add("LaunchLabTestAssigned();");
            break;

        case "procedureassigned":
            RadAjaxManager1.ResponseScripts.Add("LaunchProcedureAssigned();");
            break;

        case "visitreason":
            RadAjaxManager1.ResponseScripts.Add("LaunchVisitReason();");
            break;

        case "visit":
            RadAjaxManager1.ResponseScripts.Add("LaunchVisit();");
            break;

        case "source":
            RadAjaxManager1.ResponseScripts.Add("LaunchSource();");
            break;

        case "rticketprofessional":
            RadAjaxManager1.ResponseScripts.Add("LaunchRTicketProfessional();");
            break;

        case "ranestckprof":
            RadAjaxManager1.ResponseScripts.Add("LaunchRAnesTckProf();");
            break;

        case "rpca":
            RadAjaxManager1.ResponseScripts.Add("LaunchRPCA();");
            break;

        case "rtcksrg":
            RadAjaxManager1.ResponseScripts.Add("LaunchRTckSrg();");
            break;

        case "rrisk":
            RadAjaxManager1.ResponseScripts.Add("LaunchRrisk();");
            break;

        case "rappointmentday":
            RadAjaxManager1.ResponseScripts.Add("LaunchRAppointmentDay();");
            break;

        case "rptgpbyclinic":
            RadAjaxManager1.ResponseScripts.Add("LaunchRptGPByClinic();");
            break;

        case "rptinvoicemain":
            RadAjaxManager1.ResponseScripts.Add("LaunchRptInvoiceMain();");
            break;

        case "rptvatresume":
            RadAjaxManager1.ResponseScripts.Add("LaunchRptVATResume();");
            break;

        case "rptpatientbysource":
            RadAjaxManager1.ResponseScripts.Add("LaunchRptPatientBySource();");
            break;

        default:
            break;
        }
    }
Пример #13
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);
     }
     //
     if (Request.QueryString["HcId"] != null)
     {
         hcId           = Int32.Parse(Request.QueryString["HcId"]);
         hc             = CntAriCli.GetHealthCompany(ctx);
         txtCaller.Text = hc.Name;
     }
     //
     if (Request.QueryString["ClinicId"] != null)
     {
         clinicId = Int32.Parse(Request.QueryString["ClinicId"]);
         cl       = (from c in ctx.Clinics
                     where c.ClinicId == clinicId
                     select c).FirstOrDefault <Clinic>();
         txtCaller.Text = cl.Name;
     }
     //
     if (Request.QueryString["PatientId"] != null)
     {
         patientId      = Int32.Parse(Request.QueryString["PatientId"]);
         pat            = CntAriCli.GetPatient(patientId, ctx);
         txtCaller.Text = pat.FullName;
     }
     //
     if (Request.QueryString["CustomerId"] != null)
     {
         customerId     = Int32.Parse(Request.QueryString["CustomerId"]);
         cus            = CntAriCli.GetCustomer(customerId, ctx);
         txtCaller.Text = cus.FullName;
     }
     //
     if (Request.QueryString["ProfessionalId"] != null)
     {
         professionalId = Int32.Parse(Request.QueryString["ProfessionalId"]);
         prof           = CntAriCli.GetProfessional(professionalId, ctx);
         txtCaller.Text = prof.FullName;
     }
     //
     if (Request.QueryString["EmailId"] != null)
     {
         emailId = Int32.Parse(Request.QueryString["EmailId"]);
         Email eml = (from t in ctx.Emails
                      where t.EmailId == emailId
                      select t).FirstOrDefault <Email>();
         LoadData(eml);
     }
     else
     {
         LoadTypeCombo(null);
     }
 }
Пример #14
0
        private static void CreateThings()
        {
            // Create a user
            using (AriClinicContext ctx = new AriClinicContext("AriClinicContext"))
            {
                Console.WriteLine("Deleting all records....");
                ctx.Delete(ctx.Logs);
                ctx.Delete(ctx.Users);
                ctx.Delete(ctx.UserGroups);
                ctx.Delete(ctx.HealthcareCompanies);
                ctx.SaveChanges();

                Console.WriteLine("Creating default group..");
                UserGroup ug = new UserGroup();
                ug.Name = "Reservado";
                ctx.Add(ug);

                Console.WriteLine("Creating administrator user..");
                User user = new User();
                user.Name      = "Superuser";
                user.Login     = "******";
                user.UserGroup = ug;
                user           = CntAriCli.EncryptPassword(user, "admin");
                ctx.Add(user);

                HealthcareCompany hc = new HealthcareCompany();
                hc.Name = "Ariadna Salud S.L.";
                ctx.Add(hc);

                Clinic clinic = new Clinic()
                {
                    Name = "Clinica 1"
                };
                ctx.Add(clinic);


                // parameters
                Console.WriteLine("Creating parameters...");
                AriCliModel.Parameter parameter = new Parameter()
                {
                    PainPump       = null,
                    UseNomenclator = false
                };
                ctx.Add(parameter);

                // processes
                Console.WriteLine("Creating process...");
                Process process = new Process()
                {
                    Name = "Administración",
                    Code = "admin",
                };
                Process admin = process;
                ctx.Add(admin);
                process = new Process()
                {
                    Name          = "Procesos",
                    Code          = "process",
                    ParentProcess = admin
                };
                ctx.Add(process);
                process = new Process()
                {
                    Name          = "Permisos",
                    Code          = "permision",
                    ParentProcess = admin
                };
                ctx.Add(process);

                // permissions
                Console.WriteLine("Creating permissions...");
                Permission permission = new Permission()
                {
                    Process   = admin,
                    UserGroup = ug,
                    View      = true,
                    Create    = true,
                    Modify    = true,
                    Execute   = true,
                };
                ctx.Add(permission);
                permission = new Permission()
                {
                    Process   = process, // must be permission process
                    UserGroup = ug,
                    View      = true,
                    Create    = true,
                    Modify    = true,
                    Execute   = true,
                };
                ctx.Add(permission);
                // import data

                ctx.SaveChanges();
                Console.WriteLine("All jobs done");
            }
        }
Пример #15
0
 protected void Page_Init(object sender, EventArgs e)
 {
     ctx = new AriClinicContext("AriClinicContext");
     // security control, it must be a user logged
     // 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 == "usergroup"
                         select p).FirstOrDefault <Process>();
         per = CntAriCli.GetPermission(user.UserGroup, proc, ctx);
         btnAccept.Visible = per.Modify;
     }
     //
     if (Request.QueryString["HcId"] != null)
     {
         hcId           = Int32.Parse(Request.QueryString["HcId"]);
         hc             = CntAriCli.GetHealthCompany(ctx);
         txtCaller.Text = hc.Name;
     }
     //
     if (Request.QueryString["ClinicId"] != null)
     {
         clinicId = Int32.Parse(Request.QueryString["ClinicId"]);
         cl       = (from c in ctx.Clinics
                     where c.ClinicId == clinicId
                     select c).FirstOrDefault <Clinic>();
         txtCaller.Text = cl.Name;
     }
     //
     if (Request.QueryString["PatientId"] != null)
     {
         patientId      = Int32.Parse(Request.QueryString["PatientId"]);
         pat            = CntAriCli.GetPatient(patientId, ctx);
         txtCaller.Text = pat.FullName;
     }
     //
     if (Request.QueryString["CustomerId"] != null)
     {
         customerId     = Int32.Parse(Request.QueryString["CustomerId"]);
         cus            = CntAriCli.GetCustomer(customerId, ctx);
         txtCaller.Text = cus.FullName;
     }
     //
     if (Request.QueryString["ProfessionalId"] != null)
     {
         professionalId = Int32.Parse(Request.QueryString["ProfessionalId"]);
         prof           = CntAriCli.GetProfessional(professionalId, ctx);
         txtCaller.Text = prof.FullName;
     }
     //
     if (Request.QueryString["AddressId"] != null)
     {
         addressId = Int32.Parse(Request.QueryString["AddressId"]);
         Address adr = (from a in ctx.Addresses
                        where a.AddressId == addressId
                        select a).FirstOrDefault <Address>();
         LoadData(adr);
     }
     else
     {
         LoadTypeCombo(null);
     }
 }