Exemplo n.º 1
0
        public frmReservation(UserControl register, int?id = null)
        {
            InitializeComponent();
            modernFont = new PrivateFontCollection();
            ChangeFont(this, 10);

            ClincDbContext    = new ClinicDBContext();
            PatientRepository = new PatientRepository();

            cmbPatiendGender.DataSource    = ClincDbContext.Genders.ToList();
            cmbPatiendGender.ValueMember   = "Id";
            cmbPatiendGender.DisplayMember = "GenderType";
            ControlForAll = register;

            if (id.HasValue)
            {
                btnReservation.Text = "تعديل";
                PatientId           = id.Value;
                Patient patient = PatientRepository.Find(PatientId);

                txtPatientName.Text    = patient.FullName;
                txtPatientPhone.Text   = patient.Phone;
                txtPatientAge.Text     = patient.Age + "";
                txtPatientAddress.Text = patient.Address;
            }
        }
Exemplo n.º 2
0
 protected void btnClinicSave_Click(object sender, EventArgs e)
 {
     if (txtEntityName.Text == "")
     {
         ClinclblSaveStatus.Text = "Please Fill a Entity Name";
         lblNameReq.Visible      = true;
     }
     else if (ddlEntityTypeID.SelectedIndex == 0)
     {
         ClinclblSaveStatus.Text = "Please Select Entity Type";
         lbltypeReq.Visible      = true;
     }
     else if (ddlAreaID.SelectedIndex == 0)
     {
         ClinclblSaveStatus.Text = "Please Select Area";
         lblAreaReq.Visible      = true;
     }
     else
     {
         using (ClinicDBContext newEn = new ClinicDBContext())
         {
             Entity en = new Entity();
             en.EntityName = txtEntityName.Text;
             //en.EntityCode = int.Parse(txtEntityCode.Text);
             en.EntityAddress      = txtEntityAddress.Text;
             en.EntityTypeID       = int.Parse(ddlEntityTypeID.SelectedValue);
             en.Tel1               = txtTel1.Text;
             en.Tel2               = txtTel2.Text;
             en.Tel3               = txtTel3.Text;
             en.Fax                = txtFax.Text;
             en.EntityEmailAddress = txtEntityEmailAddress.Text;
             en.EntityWebSite      = txtEntityWebSite.Text;
             en.BrickID            = int.Parse(ddlAreaID.SelectedValue);
             en.Deleted            = false;
             en.EntryDate          = DateTime.Now;
             en.EntryEmployeeID    = int.Parse(Session["EmployeeHRCodeFromAdmin"].ToString());
             newEn.Entities.Add(en);
             int roweffected = newEn.SaveChanges();
             if (roweffected > 0)
             {
                 ClinclblSaveStatus.Text = "Saved";
                 lblNameReq.Visible      = false;
                 lbltypeReq.Visible      = false;
                 lblAreaReq.Visible      = false;
                 clearFields();
             }
             else
             {
                 ClinclblSaveStatus.Text = "Error";
             }
         }
     }
     using (EntitiesViewDBContext db = new EntitiesViewDBContext())
     {
         int maxent     = db.View_Entities.Max(en => en.EntityID);
         var clinicdata = from clinic_tbl in db.View_Entities where (clinic_tbl.Deleted == null || clinic_tbl.Deleted == false) && clinic_tbl.EntityID == maxent select clinic_tbl;
         GridViewClinic.DataSource = clinicdata.ToList();
         GridViewClinic.DataBind();
     }
 }
 protected void Button2_Click(object sender, EventArgs e)
 {
     {
         using (ClinicDBContext Entdb = new ClinicDBContext())
         {
             if (txtEntityNameSe.Text != "" & rbEntityName.Checked == true)
             {
                 var clinicdata = (from clinic_tbl in Entdb.Entities where clinic_tbl.EntityName.Contains(txtEntityNameSe.Text) select clinic_tbl).ToList();
                 ddlEntityIDSe.DataValueField = "EntityID";
                 ddlEntityIDSe.DataTextField  = "EntityName";
                 ddlEntityIDSe.DataSource     = clinicdata;
                 ddlEntityIDSe.DataBind();
             }
             else if (txtEntityNameSe.Text != "" & rbEntityCode.Checked == true)
             {
                 int EntityCode = int.Parse(txtEntityNameSe.Text);
                 var clinicdata = (from clinic_tbl in Entdb.Entities where clinic_tbl.EntityID == EntityCode select clinic_tbl).ToList();
                 ddlEntityIDSe.DataValueField = "EntityID";
                 ddlEntityIDSe.DataTextField  = "EntityName";
                 ddlEntityIDSe.DataSource     = clinicdata;
                 ddlEntityIDSe.DataBind();
             }
         }
     }
 }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            DashBoardInfoData infoData = new DashBoardInfoData();

            using (ClinicDBContext db = new ClinicDBContext())
            {
                DateTime date = DateTime.Today;
                infoData.TodayEarning   = db.Incomes.Where(c => DbFunctions.TruncateTime(c.IncomeDate) == DbFunctions.TruncateTime(date)).Sum(s => (decimal?)s.Amount) ?? 0;
                infoData.MonthlyEarning = db.Incomes.Where(c => DbFunctions.TruncateTime(c.IncomeDate).Value.Month == date.Month).Sum(s => (decimal?)s.Amount) ?? 0;
                infoData.YearlyEarning  = db.Incomes.Where(c => DbFunctions.TruncateTime(c.IncomeDate).Value.Year == date.Year).Sum(s => (decimal?)s.Amount) ?? 0;
                infoData.Appointments   = db.Appointments.Where(c => DbFunctions.TruncateTime(c.Date) >= date).Include(c => c.Person).ToList();
            }
            if (infoData.TodayEarning == null)
            {
                infoData.TodayEarning = 0;
            }
            if (infoData.YearlyEarning == null)
            {
                infoData.YearlyEarning = 0;
            }
            if (infoData.MonthlyEarning == null)
            {
                infoData.MonthlyEarning = 0;
            }
            return(View(infoData));
        }
Exemplo n.º 5
0
 private void LoadEntity()
 {
     using (ClinicDBContext db = new ClinicDBContext())
     {
         var clinicdata = from clinic_tbl in db.Entities where (clinic_tbl.Deleted == null || clinic_tbl.Deleted == false) select clinic_tbl;
         GridViewClinic.DataSource = clinicdata.ToList();
         GridViewClinic.DataBind();
     }
 }
Exemplo n.º 6
0
        public UC6_showProcess(ClinicDBContext dbContext, StaffLogin login)
        {
            InitializeComponent();

            this.db = new ClinicDB(dbContext);
            technician = login;
            uc6_showProcess = new UC6_ShowProcess(db);
            procesSpec = new List<ProcesSpec>();
        }
        public TechnicianMainWindow()
        {
            InitializeComponent();
            context = new ClinicDBContext();
            db      = new ClinicDB(context);
            //db = new ClinicNoDB();
            timeStamp = new TimeStamp();
            printer   = new NoPrinter(timeStamp);

            scanner = new NoScanner(timeStamp);

            technician = new StaffLogin();
        }
Exemplo n.º 8
0
 public ClinicianDBLogic(ClinicDBContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            ClinicDBContext  dbContext        = new ClinicDBContext();
            ClinicianDBLogic clinicianDbLogic = new ClinicianDBLogic(dbContext);

            ProgramHL7 program = new ProgramHL7();

            program.metode();


            #region Create (CRUD)

            #region Create patient
            Patient newPatient = new Patient()
            {
                CPR         = "123456-2332",
                Name        = "Accepttest",
                Lastname    = "Patient",
                Adress      = "Testvej 1",
                zipcode     = 4321,
                Age         = 20,
                City        = "TestBy",
                Email       = "*****@*****.**",
                MobilNummer = "30405060"
            };

            clinicianDbLogic.CreatePatient(newPatient);


            #endregion

            #region Create Staff

            StaffLogin newStaffLogin = new StaffLogin()
            {
                Name        = "Kliniker",
                Password    = "******",
                StaffStatus = Status.Clinician,
            };

            //clinicianDbLogic.CreateStaffLogin(newStaffLogin);

            StaffLogin nStaffLogin = new StaffLogin()
            {
                Name        = "Tekniker",
                Password    = "******",
                StaffStatus = Status.Technician
            };

            //clinicianDbLogic.CreateStaffLogin(nStaffLogin);

            #region Create EarCast 2

            EarCast newCast = new EarCast()
            {
                EarSide = Ear.Right,
            };

            //clinicianDbLogic.CreateEarCast(newCast);

            #endregion

            #endregion

            #region Create GeneralSpec

            GeneralSpec newGeneralSpecL = new GeneralSpec()
            {
                //CPR = "111111-1111",
                Type         = Material.AntiAllergi,
                Color        = PlugColor.Honey,
                EarSide      = Ear.Left,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
            };

            //clinicianDbLogic.CreateNewGeneralSpec(newGeneralSpecL);

            GeneralSpec newGeneralSpecR = new GeneralSpec()
            {
                //CPR = "111111-1111",
                Type         = Material.AntiAllergi,
                Color        = PlugColor.Honey,
                EarSide      = Ear.Right,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
            };

            //clinicianDbLogic.CreateNewGeneralSpec(newGeneralSpecR);

            #endregion

            #region Create TecnicalSpec

            TecnicalSpec newTecnicalSpecR = new TecnicalSpec()
            {
                EarSide      = Ear.Right,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
                //CPR = "111111-1111"
            };

            //clinicianDbLogic.CreateTechnicalSpec(newTecnicalSpecR);

            TecnicalSpec newTecnicalSpecL = new TecnicalSpec()
            {
                EarSide      = Ear.Left,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
                //CPR = "111111-1111",
            };

            //clinicianDbLogic.CreateTechnicalSpec(newTecnicalSpecL);

            #endregion

            #region Create rawEarPrint

            RawEarPrint print = new RawEarPrint()
            {
                EarSide      = Ear.Left,
                StaffLoginFK = 1,
                PrintDate    = DateTime.Now,
            };

            //clinicianDbLogic.SavePrint(print, "111111-1111");

            #endregion

            #endregion

            #region Delete (CRUD)

            #region Delete patient

            //Patient DeletePatient = new Patient()
            //{
            //   PCPR = "110396-0000",
            //};

            //clinicianDbLogic.DeletePatient(DeletePatient);

            #endregion

            #region Delete EarCast

            //EarCast DeleteEarCast = new EarCast()
            //{
            //   EarCastID = 2,
            //};

            // clinicianDbLogic.DeleteEarCast(DeleteEarCast);

            #endregion

            #endregion

            #region Update (CRUD)

            #region Update patient

            //Patient UpdatePatient = new Patient()
            //{
            //   PCPR = "110396-0000",
            //   Lastname = "Nedergaard Enevoldsen",
            //   Adress = "Trøjbordvej 72",

            //};

            //clinicianDbLogic.UpdatePatient(UpdatePatient);

            #endregion

            #endregion

            #region Retrive (CRUD)

            #region Retrieve Alle patienter

            //List<Patient> Patients = clinicianDbLogic.GetAllPatients();

            //foreach (Patient patient in Patients)
            //{
            //   Console.WriteLine(patient.Name);
            //}

            #endregion

            #region Retrieve Patient tilhørende øre afstøbning

            //Patient Patient = clinicianDbLogic.GetPatientFromEarCast(2);

            //Console.WriteLine(Patient.Name);

            #endregion

            #region Create afstøbning

            //EarCast earCast = clinicianDbLogic.Get
            //Patient Patient = clinicianDbLogic.GetPatient("250997-0000");

            // Console.WriteLine(Patient.Name);

            #endregion

            #region Retrieve Patient tilhørende øre afstøbning

            //Patient earPatient = clinicianDbLogic.GetPatientWithEarCast("250997-0000");

            //foreach (EarCast earPatientEarCast in earPatient.EarCasts)
            //{
            //    Console.WriteLine($"PCPR: {earPatientEarCast.PCPR} Øre side: {earPatientEarCast.EarSide.ToString()} ID: {earPatientEarCast.EarCastID}");
            //}

            #endregion

            #region Hent en patient med alle parametre udfyldt

            //Patient patient = clinicianDbLogic.GetPatientWithGeneralSpecAndTechnicalSpec("111111-1111");

            #endregion


            #endregion
        }
Exemplo n.º 10
0
 public ClinicDatabase()
 {
     _dbContext = new ClinicDBContext();
 }
Exemplo n.º 11
0
 public DB_Login()
 {
     context = new ClinicDBContext();
 }
Exemplo n.º 12
0
 public ClinicDB(ClinicDBContext dbContext)
 {
     _dbContext = new ClinicDBContext();
     //= dbContext;
 }
Exemplo n.º 13
0
 public DLLShowProcess(ClinicDBContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 14
0
 public ClinicController(ClinicDBContext context)
 {
     _context = context;
 }