コード例 #1
0
        public void CreateListOfInferiors()
        {
            I_Manager manager = new Manager();

            Scientist scientist1 = new Scientist();
            scientist1.FirstName = "Bill";

            Specialist specilist1 = new Specialist();
            specilist1.FirstName = "Saimon";

            Specialist specilist2 = new Specialist();
            specilist2.FirstName = "Andrew";

            manager.ListOfInferiors.Add(scientist1);
            manager.ListOfInferiors.Add(specilist1);
            manager.ListOfInferiors.Add(specilist2);

            // теперь независимо от конкретного типа, реализующего интерфес,
            // можно работать с членами интерфейса,
            // реализация которых инкапсулирована конкретными типами
            foreach (I_Inferior employee in manager.ListOfInferiors)
                if (!employee.IsWorking) employee.Work();
        }
コード例 #2
0
    void Awake()
    {
        if (s_Instance == null)
            s_Instance = this;
        //DontDestroyOnLoad(this);

        #region Element
        foreach (Google2u.BOWRow row in Google2u.BOW.Instance.Rows)
        {
            Element m_Element = new Element();

            m_Element.m_Capacity = row._Capacity;
            m_Element.m_Damage = row._Damage;
            m_Element.m_HealthPoint = row._HealthPoint;
            m_Element.m_Regeneration = row._Regeneration;
            m_Element.m_Speed = row._Speed;
            m_Element.m_Vision = row._Vision;

            m_Element.m_CapacityUpgrade = row._CapacityUpgrade;
            m_Element.m_DamageUpgrade = row._DamageUpgrade;
            m_Element.m_HealthPointUpgrade = row._HealthPointUpgrade;
            m_Element.m_RegenerationUpgrade = row._RegenerationUpgrade;
            m_Element.m_SpeedUpgrade = row._SpeedUpgrade;
            m_Element.m_VisionUpgrade = row._VisionUpgrade;

            m_Element.m_Description = row._Description;

            m_Element.m_Cost = row._Cost;
            m_Element.m_Grade = row._Grade;
            m_Element.m_Rank = row._Rank;

            m_Element.m_Name = row._Name;

            m_Element.m_ShownName = row._ShownName;

            m_BowDico.Add(m_Element.m_Name, m_Element);
        }

        foreach (Google2u.KEELRow row in Google2u.KEEL.Instance.Rows)
        {
            Element m_Element = new Element();

            m_Element.m_Capacity = row._Capacity;
            m_Element.m_Damage = row._Damage;
            m_Element.m_HealthPoint = row._HealthPoint;
            m_Element.m_Regeneration = row._Regeneration;
            m_Element.m_Speed = row._Speed;
            m_Element.m_Vision = row._Vision;

            m_Element.m_CapacityUpgrade = row._CapacityUpgrade;
            m_Element.m_DamageUpgrade = row._DamageUpgrade;
            m_Element.m_HealthPointUpgrade = row._HealthPointUpgrade;
            m_Element.m_RegenerationUpgrade = row._RegenerationUpgrade;
            m_Element.m_SpeedUpgrade = row._SpeedUpgrade;
            m_Element.m_VisionUpgrade = row._VisionUpgrade;

            m_Element.m_Description = row._Description;

            m_Element.m_Cost = row._Cost;
            m_Element.m_Grade = row._Grade;
            m_Element.m_Rank = row._Rank;

            m_Element.m_Name = row._Name;

            m_Element.m_ShownName = row._ShownName;

            m_KeelDico.Add(m_Element.m_Name, m_Element);
        }

        foreach (Google2u.MASTRow row in Google2u.MAST.Instance.Rows)
        {
            Element m_Element = new Element();

            m_Element.m_Capacity = row._Capacity;
            m_Element.m_Damage = row._Damage;
            m_Element.m_HealthPoint = row._HealthPoint;
            m_Element.m_Regeneration = row._Regeneration;
            m_Element.m_Speed = row._Speed;
            m_Element.m_Vision = row._Vision;

            m_Element.m_CapacityUpgrade = row._CapacityUpgrade;
            m_Element.m_DamageUpgrade = row._DamageUpgrade;
            m_Element.m_HealthPointUpgrade = row._HealthPointUpgrade;
            m_Element.m_RegenerationUpgrade = row._RegenerationUpgrade;
            m_Element.m_SpeedUpgrade = row._SpeedUpgrade;
            m_Element.m_VisionUpgrade = row._VisionUpgrade;

            m_Element.m_Description = row._Description;

            m_Element.m_Cost = row._Cost;
            m_Element.m_Grade = row._Grade;
            m_Element.m_Rank = row._Rank;

            m_Element.m_Name = row._Name;

            m_Element.m_ShownName = row._ShownName;

            m_MastDico.Add(m_Element.m_Name, m_Element);
        }

        foreach (Google2u.STERNRow row in Google2u.STERN.Instance.Rows)
        {
            Element m_Element = new Element();

            m_Element.m_Capacity = row._Capacity;
            m_Element.m_Damage = row._Damage;
            m_Element.m_HealthPoint = row._HealthPoint;
            m_Element.m_Regeneration = row._Regeneration;
            m_Element.m_Speed = row._Speed;
            m_Element.m_Vision = row._Vision;

            m_Element.m_CapacityUpgrade = row._CapacityUpgrade;
            m_Element.m_DamageUpgrade = row._DamageUpgrade;
            m_Element.m_HealthPointUpgrade = row._HealthPointUpgrade;
            m_Element.m_RegenerationUpgrade = row._RegenerationUpgrade;
            m_Element.m_SpeedUpgrade = row._SpeedUpgrade;
            m_Element.m_VisionUpgrade = row._VisionUpgrade;

           m_Element.m_Description = row._Description;

            m_Element.m_Cost = row._Cost;
            m_Element.m_Grade = row._Grade;
            m_Element.m_Rank = row._Rank;

            m_Element.m_Name = row._Name;

            m_Element.m_ShownName = row._ShownName;

            m_SternDico.Add(m_Element.m_Name, m_Element);
        }
        #endregion

        #region Equipement
        foreach (Google2u.WEAPONRow row in Google2u.WEAPON.Instance.Rows)
        {
            Equipment m_Equipement = new Equipment();

            m_Equipement.m_Level = row._Level;
            m_Equipement.m_LevelUp = row._LevelUp;
            m_Equipement.m_Range = Mathf.CeilToInt(row._Range);
            m_Equipement.m_RangeUpgrade = Mathf.CeilToInt(row._RangeUpgrade);
            m_Equipement.m_Cooldown = row._Cooldown;
            m_Equipement.m_CooldownUpgrade = row._CooldownUpgrade;
            m_Equipement.m_ShootType = row._ShootType;
            m_Equipement.m_ShootTypeUpgrade = row._ShootTypeUpgrade;
            m_Equipement.m_Cost = row._Cost;
            m_Equipement.m_Grade = row._Grade;
            m_Equipement.m_Rank = row._Rank;
            m_Equipement.m_State1 = row._State1;
            m_Equipement.m_State2 = row._State2;
            m_Equipement.m_Damage = row._Damage;
            m_Equipement.m_DamageUpgrade = row._DamageUpgrade;
            m_Equipement.m_Description = row._Description;
            m_Equipement.m_Type = row._Type;

            m_Equipement.m_Name = row._Name;

            m_Equipement.m_ShownName = row._ShownName;

            m_WeaponDico.Add(m_Equipement.m_Name, m_Equipement);
        }

        foreach (Google2u.ULTIMATERow row in Google2u.ULTIMATE.Instance.Rows)
        {
            Equipment m_Equipement = new Equipment();

            m_Equipement.m_Level = row._Level;
            m_Equipement.m_LevelUp = row._LevelUp;
            m_Equipement.m_Range = Mathf.CeilToInt(row._Range);
            m_Equipement.m_RangeUpgrade = Mathf.CeilToInt(row._RangeUpgrade);
            m_Equipement.m_Cooldown = row._Cooldown;
            m_Equipement.m_CooldownUpgrade = row._CooldownUpgrade;
            m_Equipement.m_ShootType = row._ShootType;
            m_Equipement.m_ShootTypeUpgrade = row._ShootTypeUpgrade;
            m_Equipement.m_Cost = row._Cost;
            m_Equipement.m_Grade = row._Grade;
            m_Equipement.m_Rank = row._Rank;
            m_Equipement.m_State1 = row._State1;
            m_Equipement.m_State2 = row._State2;
            m_Equipement.m_Damage = row._Damage;
            m_Equipement.m_DamageUpgrade = row._DamageUpgrade;
            m_Equipement.m_Description = row._Description;
            m_Equipement.m_Type = row._Type;

            m_Equipement.m_Name = row._Name;

            m_Equipement.m_ShownName = row._ShownName;

            m_UltimateDico.Add(m_Equipement.m_Name, m_Equipement);
        }

        foreach (Google2u.GADGETRow row in Google2u.GADGET.Instance.Rows)
        {
            Equipment m_Equipement = new Equipment();

            m_Equipement.m_Level = row._Level;
            m_Equipement.m_LevelUp = row._LevelUp;
            m_Equipement.m_Range = Mathf.CeilToInt(row._Range);
            m_Equipement.m_RangeUpgrade = Mathf.CeilToInt(row._RangeUpgrade);
            m_Equipement.m_Cooldown = row._Cooldown;
            m_Equipement.m_CooldownUpgrade = row._CooldownUpgrade;
            m_Equipement.m_ShootType = row._ShootType;
            m_Equipement.m_ShootTypeUpgrade = row._ShootTypeUpgrade;
            m_Equipement.m_Cost = row._Cost;
            m_Equipement.m_Grade = row._Grade;
            m_Equipement.m_Rank = row._Rank;
            m_Equipement.m_State1 = row._State1;
            m_Equipement.m_State2 = row._State2;
            m_Equipement.m_Damage = row._Damage;
            m_Equipement.m_DamageUpgrade = row._DamageUpgrade;
            m_Equipement.m_Description = row._Description;
            m_Equipement.m_Type = row._Type;

            m_Equipement.m_Name = row._Name;

            m_Equipement.m_ShownName = row._ShownName;

            m_GadgetDico.Add(m_Equipement.m_Name, m_Equipement);
        }

        foreach (Google2u.SPECIALISTRow row in Google2u.SPECIALIST.Instance.Rows)
        {
            Specialist m_Specialist = new Specialist();

            m_Specialist.m_Speciality = row._Speciality;
            m_Specialist.m_Value = row._Value;
            m_Specialist.m_Description = row._Description;
            m_Specialist.m_Cost = row._Cost;
            m_Specialist.m_Type = row._Type;

            m_Specialist.m_Name = row._Name;

            m_Specialist.m_ShownName = row._ShownName;

            m_SpecialistDico.Add(m_Specialist.m_Name, m_Specialist);
        }
        #endregion

        #region CaptainWears

        foreach (Google2u.BOOTSRow row in Google2u.BOOTS.Instance.Rows)
        {
            ScriptCaptainWears m_CaptainWear = new ScriptCaptainWears();

            m_CaptainWear.m_WearName = row._Name;
            m_CaptainWear.m_WearCost = row._Cost;
            m_CaptainWear.m_WearShownName = row._ShownName;
            m_CaptainWear.m_WearAppearance = m_ScriptMeshLibrary.m_BootsList[row._Appearance];

            m_CaptainWear.m_WearShownName = row._ShownName;

            m_BootsDico.Add(m_CaptainWear.m_WearName, m_CaptainWear);

            m_ScriptShopPanel.m_BootsCatalog.Add(m_CaptainWear.m_WearName);
        }

        foreach (Google2u.JACKETRow row in Google2u.JACKET.Instance.Rows)
        {
            ScriptCaptainWears m_CaptainWear = new ScriptCaptainWears();

            m_CaptainWear.m_WearName = row._Name;
            m_CaptainWear.m_WearCost = row._Cost;
            m_CaptainWear.m_WearShownName = row._ShownName;
            m_CaptainWear.m_WearAppearance = m_ScriptMeshLibrary.m_JacketList[row._Appearance];

            m_CaptainWear.m_WearShownName = row._ShownName;

            m_JacketDico.Add(m_CaptainWear.m_WearName, m_CaptainWear);

            m_ScriptShopPanel.m_JacketCatalog.Add(m_CaptainWear.m_WearName);
        }

        foreach (Google2u.HATRow row in Google2u.HAT.Instance.Rows)
        {
            ScriptCaptainWears m_CaptainWear = new ScriptCaptainWears();

            m_CaptainWear.m_WearName = row._Name;
            m_CaptainWear.m_WearCost = row._Cost;
            m_CaptainWear.m_WearShownName = row._ShownName;
            m_CaptainWear.m_WearAppearance = m_ScriptMeshLibrary.m_HatList[row._Appearance];

            m_CaptainWear.m_WearShownName = row._ShownName;

            m_HatDico.Add(m_CaptainWear.m_WearName, m_CaptainWear);

            m_ScriptShopPanel.m_HatCatalog.Add(m_CaptainWear.m_WearName);
        }

        foreach (Google2u.PANTSRow row in Google2u.PANTS.Instance.Rows)
        {
            ScriptCaptainWears m_CaptainWear = new ScriptCaptainWears();

            m_CaptainWear.m_WearName = row._Name;
            m_CaptainWear.m_WearCost = row._Cost;
            m_CaptainWear.m_WearShownName = row._ShownName;
            m_CaptainWear.m_WearAppearance = m_ScriptMeshLibrary.m_PantsList[row._Appearance];

            m_CaptainWear.m_WearShownName = row._ShownName;

            m_PantsDico.Add(m_CaptainWear.m_WearName, m_CaptainWear);

            m_ScriptShopPanel.m_PantsCatalog.Add(m_CaptainWear.m_WearName);
        }
        #endregion

        foreach (Google2u.NOSERow row in Google2u.NOSE.Instance.Rows)
        {
            ScriptCaptainParts m_CaptainPart = new ScriptCaptainParts();

            m_CaptainPart.m_PartsName = row._Name;
            m_CaptainPart.m_PartsCost = row._Cost;
            m_CaptainPart.m_PartsShownName = row._ShownName;
            m_CaptainPart.m_PartsAppearance = m_ScriptMeshLibrary.m_NoseList[row._Appearance];

            m_NoseDico.Add(m_CaptainPart.m_PartsName, m_CaptainPart);

            m_ScriptShopPanel.m_NoseCatalog.Add(m_CaptainPart.m_PartsName);
        }

        foreach (Google2u.EARSRow row in Google2u.EARS.Instance.Rows)
        {
            ScriptCaptainParts m_CaptainPart = new ScriptCaptainParts();

            m_CaptainPart.m_PartsName = row._Name;
            m_CaptainPart.m_PartsCost = row._Cost;
            m_CaptainPart.m_PartsShownName = row._ShownName;
            m_CaptainPart.m_PartsAppearance = m_ScriptMeshLibrary.m_EarsList[row._Appearance];

            m_EarsDico.Add(m_CaptainPart.m_PartsName, m_CaptainPart);

            m_ScriptShopPanel.m_EarsCatalog.Add(m_CaptainPart.m_PartsName);
        }

        foreach (Google2u.EYESRow row in Google2u.EYES.Instance.Rows)
        {
            ScriptCaptainParts m_CaptainPart = new ScriptCaptainParts();

            m_CaptainPart.m_PartsName = row._Name;
            m_CaptainPart.m_PartsCost = row._Cost;
            m_CaptainPart.m_PartsShownName = row._ShownName;
            m_CaptainPart.m_PartsAppearance = m_ScriptMeshLibrary.m_EyesList[row._Appearance];

            m_EyesDico.Add(m_CaptainPart.m_PartsName, m_CaptainPart);

            m_ScriptShopPanel.m_EyesCatalog.Add(m_CaptainPart.m_PartsName);
        }

        foreach (Google2u.MOUTHRow row in Google2u.MOUTH.Instance.Rows)
        {
            ScriptCaptainParts m_CaptainPart = new ScriptCaptainParts();

            m_CaptainPart.m_PartsName = row._Name;
            m_CaptainPart.m_PartsCost = row._Cost;
            m_CaptainPart.m_PartsShownName = row._ShownName;
            m_CaptainPart.m_PartsAppearance = m_ScriptMeshLibrary.m_MouthList[row._Appearance];

            m_MouthDico.Add(m_CaptainPart.m_PartsName, m_CaptainPart);

            m_ScriptShopPanel.m_MouthCatalog.Add(m_CaptainPart.m_PartsName);
        }
    }
コード例 #3
0
ファイル: Main.cs プロジェクト: dimitrijevic12/health-clinic
        static void Main()
        { /*
           *             DiagnosisAndReview diagnosisAndReview = new DiagnosisAndReview("Nova dijagnoza", "Nova procedura");
           *             DiagnosisAndReview diagnosisAndReview2 = new DiagnosisAndReview("Nova dijagnoza2", "Nova procedura2");
           *             DiagnosisAndReviewRepository.Instance.Save(diagnosisAndReview);
           *             DiagnosisAndReviewRepository.Instance.Save(diagnosisAndReview2);
           *             //            DiagnosisAndReviewRepository.Instance.Delete(2);
           *             List<DiagnosisAndReview> diagnosisAndReviews =  DiagnosisAndReviewRepository.Instance.GetAll();
           *             Console.WriteLine("Lista dijagnoza:");
           *             foreach (DiagnosisAndReview dAndR in diagnosisAndReviews)
           *             {
           *                 Console.WriteLine(dAndR);
           *             }
           * //            Console.WriteLine("Dijagnoza id == 3:" + DiagnosisAndReviewRepository.Instance.GetDiagnosisAndReview(3).Id);
           *
           *             Drug drug1 = new Drug(null, "Panklav 200mg", "Opis Panklava", true, 20);
           *             Drug drug2 = new Drug(null, "Aerius 50mg", "Opis Aeriusa", false, 5);
           *             List<Drug> drugs = new List<Drug>();
           *             drugs.Add(drug1);
           *             drugs.Add(drug2);
           *
           *             Prescription prescription = new Prescription(drugs);
           *             PrescriptionRepository.Instance.Save(prescription);
           *             List<Prescription> prescriptions = PrescriptionRepository.Instance.GetAll();
           *             PrescriptionRepository.Instance.Delete(3);
           *             foreach (Prescription p in prescriptions)
           *             {
           *                 Console.WriteLine(p);
           *             }
           *         }
           *
           * DiagnosisAndReview diagnosisAndReview = new DiagnosisAndReview("Nova dijagnoza", "Nova procedura");
           * Drug drug1 = new Drug(null, "Panklav 200mg", "Opis Panklava", true, 20);
           * Drug drug2 = new Drug(null, "Aerius 50mg", "Opis Aeriusa", false, 5);
           * List<Drug> drugs = new List<Drug>();
           * drugs.Add(drug1);
           * drugs.Add(drug2);
           * Prescription prescription = new Prescription(drugs);
           * Treatment treatment = new Treatment(prescription, new ScheduledSurgery(DateTime.Today, DateTime.Now, "Razlog operacije", new Surgeon("Pera", "Peric", SurgicalSpecialty.CARDIOTHORACIC)), diagnosisAndReview, new ReferralToHospitalTreatment(DateTime.Today, DateTime.Now, "Razlog bolnickog lecenja"), DateTime.Today, DateTime.Now, new Doctor("Marko", "Markovic"));
           * TreatmentRepository.Instance.Save(treatment);
           */
            /*            Blog blog1 = new Blog("naslov 1", "blablbalblalba", DateTime.Now);
             *          Blog blog2 = new Blog("naslov 2", "blablbalblalba", DateTime.Now.AddHours(2));
             *          BlogController.Instance.Create(blog1);
             *          BlogController.Instance.Create(blog2);
             *          BlogController.Instance.GetBlogByTitle("naslov 1");
             *          BlogController.Instance.Delete(blog1);
             *          blog2.Text = "Promenjen text";
             *          BlogController.Instance.Edit(blog2);*/
            Drug        drug1 = new Drug(213, null, "Panklav 200mg", "Opis Panklava", true, 20);
            Drug        drug2 = new Drug(312, null, "Aerius 50mg", "Opis Aeriusa", false, 5);
            List <Drug> drugs = new List <Drug>();

            drugs.Add(drug1);
            drugs.Add(drug2);
            DrugRepository.Instance.Save(drug1);
            DrugRepository.Instance.Save(drug2);

            Doctor doctor = new Doctor(123, "Marko", "Markovic", Model.SystemUsers.Gender.MALE, DateTime.Now);

            DoctorController.Instance.Create(doctor);
//            DoctorRepository.Instance.Save(doctor);

            DateTime startDate = DateTime.Now;
            DateTime endDate   = DateTime.Now.AddDays(1);

            Prescription prescription = new Prescription(drugs);

            Surgeon surgeon = new Surgeon(222, "Pera", "Peric", Model.SystemUsers.Gender.FEMALE, DateTime.Now, SurgicalSpecialty.CARDIOTHORACIC);

            SurgeonController.Instance.Create(surgeon);
            //           SurgeonRepository.Instance.Save(surgeon);
            ScheduledSurgery scheduledSurgery = new ScheduledSurgery(startDate, endDate, "Razlog za operaciju", surgeon);

            Specialist specialist = new Specialist(333, "Ana", "Jovanovic", Model.SystemUsers.Gender.FEMALE, DateTime.Now, Specialization.ENDOCRINOLOGY);

            SpecialistController.Instance.Create(specialist);
//            SpecialistRepository.Instance.Save(specialist);
            SpecialistAppointment specialistAppointment = new SpecialistAppointment("Razlog za specijalistu", specialist);

            ReferralToHospitalTreatment referralToHospitalTreatment = new ReferralToHospitalTreatment("Razlog za bolnicko lecenje", drugs);

            DiagnosisAndReview diagnosisAndReview = new DiagnosisAndReview("Dijagnoza", "Procedura");

            Patient   patient   = new Patient("Sima", "Simic", 345);
            Treatment treatment = new Treatment(prescription, scheduledSurgery, diagnosisAndReview, referralToHospitalTreatment, startDate, endDate, 23, doctor, specialistAppointment);

//            TreatmentController.Instance.Create(patient, treatment);
            TreatmentRepository.Instance.Save(treatment);

            Treatment treatment2 = new Treatment(prescription, new ScheduledSurgery(), diagnosisAndReview, referralToHospitalTreatment, startDate, endDate, 23, doctor, specialistAppointment);

            //            TreatmentController.Instance.Create(patient, treatment);
            TreatmentRepository.Instance.Save(treatment2);
            Console.WriteLine(TreatmentController.Instance.GetTreatment(treatment2).Prescription.Drugs[0].Name);

            Treatment treatment1 = TreatmentRepository.Instance.GetTreatment(23);

            foreach (Drug oneDrug in treatment1.Prescription.Drugs)
            {
                Console.WriteLine(oneDrug.Name);
            }

            Console.WriteLine("\n\n");
            foreach (Drug oneDrug in treatment1.ReferralToHospitalTreatment.Drugs)
            {
                Console.WriteLine(oneDrug.Name);
            }

            Console.WriteLine("\n\n");
            Console.WriteLine(treatment1.Doctor.NameAndSurname);
            Console.WriteLine(treatment1.ScheduledSurgery.Surgeon.NameAndSurname);
            Console.WriteLine(treatment1.SpecialistAppointment.Doctor.NameAndSurname);
//            DoctorDrugService doctorDrugService = new DoctorDrugService(new DrugService());
//            doctorDrugService.LowerQuantity(drug1);

            DoctorDrugController doctorDrugController = new DoctorDrugController(new DrugController());

            doctorDrugController.LowerQuantity(drug1);

            //            ManagerDrugService managerDrugService = new ManagerDrugService(new DrugService());
            //            managerDrugService.AddDrug("Prozak", 15);

            ManagerDrugController managerDrugController = new ManagerDrugController(new DrugController());

            managerDrugController.AddDrug("Prozak", 22);
        }
コード例 #4
0
 public void Dispose()
 {
     Stylist.DeleteAll();
     Client.DeleteAll();
     Specialist.DeleteAll();
 }
コード例 #5
0
        /// <summary>
        /// Обновляет значения полей
        /// </summary>
        public override void FillControls()
        {
            BeginUpdate();

            lookupComboboxDeferred.SelectedIndexChanged -= LookupComboboxDeferredSelectedIndexChanged;

            UpdateControls();

            _specialists.Clear();
            try
            {
                _specialists.AddRange(GlobalObjects.CasEnvironment.Loader.GetObjectListAll <Specialist>(loadChild: true).Where(i => i.Specialization?.Department?.FullName == "Line Maintenance"));
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while load Specialist fo Discrepancy", ex);
            }


            if (ShowDeffects)
            {
                comboBoxPhase.Items.Clear();
                comboBoxPhase.Items.AddRange(DeffeсtPhase.Items.ToArray());
                comboBoxPhase.SelectedItem = Discrepancy.DeffeсtPhase;

                comboBoxDeffectCat.Items.Clear();
                comboBoxDeffectCat.Items.AddRange(DeffeсtCategory.Items.ToArray());
                comboBoxDeffectCat.SelectedItem = Discrepancy.DeffeсtCategory;

                comboBoxDeffectConfirm.Items.Clear();
                comboBoxDeffectConfirm.Items.AddRange(DeffectConfirm.Items.ToArray());
                comboBoxDeffectConfirm.SelectedItem = Discrepancy.DeffectConfirm;

                comboBoxActinType.Items.Clear();
                comboBoxActinType.Items.AddRange(ActionType.Items.ToArray());
                comboBoxActinType.SelectedItem = Discrepancy.ActionType;

                comboBoxInterruptionType.Items.Clear();
                comboBoxInterruptionType.Items.AddRange(InterruptionType.Items.ToArray());
                comboBoxInterruptionType.SelectedItem = Discrepancy.InterruptionType;


                checkBoxOccurrence.Checked   = Discrepancy.IsOccurrence;
                checkBoxSubstruction.Checked = Discrepancy.Substruction;

                comboBoxFaultConsequence.Items.Clear();
                comboBoxFaultConsequence.Items.AddRange(ConsequenceFaults.Items.ToArray());
                comboBoxFaultConsequence.SelectedItem = Discrepancy.ConsequenceFault;

                comboBoxOPSConsequence.Items.Clear();
                comboBoxOPSConsequence.Items.AddRange(ConsequenceOPS.Items.ToArray());
                comboBoxOPSConsequence.SelectedItem = Discrepancy.ConsequenceOps;


                comboBoxConsequenceType.Items.Clear();
                comboBoxConsequenceType.Items.AddRange(IncidentType.Items.ToArray());
                comboBoxConsequenceType.SelectedItem = Discrepancy.ConsequenceType;


                comboBoxOccurrence.Items.Clear();
                comboBoxOccurrence.Items.AddRange(OccurrenceType.Items.ToArray());
                comboBoxOccurrence.SelectedItem = Discrepancy.Occurrence;


                comboBoxAuth.Items.Clear();
                comboBoxAuth.Items.AddRange(_specialists.OrderBy(i => i.LastName).ToArray());
                comboBoxAuth.SelectedItem = Discrepancy.Auth;


                var aircraftBaseDetails = GlobalObjects.ComponentCore.GetAicraftBaseComponents(Discrepancy.ParentFlight.AircraftId, BaseComponentType.Engine.ItemId).ToList();
                if (aircraftBaseDetails.Count > 0)
                {
                    comboBoxEngine.Items.Clear();
                    comboBoxEngine.Items.AddRange(aircraftBaseDetails.ToArray());

                    var selected = aircraftBaseDetails.GetItemById(Discrepancy.BaseComponentId);
                    if (selected != null)
                    {
                        comboBoxEngine.SelectedItem = selected;
                    }
                    else
                    {
                        comboBoxEngine.SelectedIndex = 0;
                    }
                }

                numericUpDownDelay.Value = Discrepancy.TimeDelay;
                textBoxRemarks.Text      = Discrepancy.Remark;
                textBoxMessages.Text     = Discrepancy.Messages;
                textBoxFDR.Text          = Discrepancy.FDR;
                textBoxEngineRemark.Text = Discrepancy.EngineRemarks;
                checkBoxEngine.Checked   = Discrepancy.EngineShutUp;
            }

            ataChapterComboBox.UpdateInformation();

            TemplateComboBox.Items.Clear();
            TemplateComboBox.Items.AddRange(_discrepancies.ToArray());

            TemplateComboBox.SelectedItem = _discrepancies.FirstOrDefault(
                d => d.ATAChapter != null && d.ATAChapter.Equals(Discrepancy.ATAChapter) &&
                d.CertificateOfReleaseToService != null &&
                d.CertificateOfReleaseToService.AuthorizationB1.Equals(d.CertificateOfReleaseToService.AuthorizationB1) &&
                d.CertificateOfReleaseToService.AuthorizationB2.Equals(d.CertificateOfReleaseToService.AuthorizationB2) &&
                d.CertificateOfReleaseToService.Station.Equals(d.CertificateOfReleaseToService.Station) &&
                d.CorrectiveAction != null &&
                d.CorrectiveAction.Description.Equals(d.CorrectiveAction.Description) &&
                d.CorrectiveAction.PartNumberOff.Equals(d.CorrectiveAction.PartNumberOff) &&
                d.CorrectiveAction.PartNumberOn.Equals(d.CorrectiveAction.PartNumberOn) &&
                d.CorrectiveAction.SerialNumberOff.Equals(d.CorrectiveAction.SerialNumberOff) &&
                d.CorrectiveAction.SerialNumberOn.Equals(d.CorrectiveAction.SerialNumberOn));

            #region lookupComboboxDeferred

            if (Discrepancy != null)
            {
                var aircraft = GlobalObjects.AircraftsCore.GetAircraftById(Discrepancy.ParentFlight.AircraftId);

                string displayerText =
                    aircraft.RegistrationNumber + ". " +
                    DirectiveType.DeferredItems.CommonName;

                lookupComboboxDeferred.SetAddScreenControl <DeferredScreen>
                    (new object[] { aircraft, Discrepancy.ParentFlight },
                    displayerText + ". New Directive");

                lookupComboboxDeferred.SetEditScreenControl <DeferredScreen>(displayerText);
                lookupComboboxDeferred.SetItemsScreenControl <PrimeDirectiveListScreen>
                    (new object[] { aircraft, DirectiveType.DeferredItems, ADType.None },
                    displayerText);
                lookupComboboxDeferred.LoadObjectsFunc = GlobalObjects.DirectiveCore.GetDeferredItems;
                lookupComboboxDeferred.FilterParam1    = Discrepancy.ParentFlight;
                lookupComboboxDeferred.UpdateInformation();
            }

            #endregion

            #region lookupComboboxFlight

            if (Discrepancy != null && Discrepancy.ItemId > 0 && Discrepancy.DirectiveId > 0)
            {
                var aircraft = GlobalObjects.AircraftsCore.GetAircraftById(Discrepancy.ParentFlight.AircraftId);

                lookupComboboxFlight.SetEditScreenControl <FlightScreen>
                    (aircraft.RegistrationNumber + ". " + Discrepancy.ParentFlight.FlightNo);

                ATLB parentAtlb = null;
                try
                {
                    parentAtlb = GlobalObjects.CasEnvironment.NewLoader.GetObjectById <ATLBDTO, ATLB>(Discrepancy.ParentFlight.ATLBId);
                }
                catch (Exception ex)
                {
                    Program.Provider.Logger.Log("Error while load linked ATLB fo Discrepancy", ex);
                }
                if (parentAtlb != null)
                {
                    //Проверить на значение свойтсва ParentAircraft в parentAtlb
                    lookupComboboxFlight.SetItemsScreenControl <FlightsListScreen>
                        (new object[] { parentAtlb },
                        aircraft.RegistrationNumber + ". ATLB No " + parentAtlb.ATLBNo);

                    lookupComboboxFlight.LoadObjectsFunc = GlobalObjects.AircraftFlightsCore.GetFlightsByAtlb;
                    lookupComboboxFlight.FilterParam1    = Discrepancy.ParentFlight.AircraftId;
                    lookupComboboxFlight.FilterParam2    = parentAtlb.ItemId;
                    lookupComboboxFlight.UpdateInformation();
                }
            }

            #endregion



            if (Discrepancy != null)
            {
                comboSpecialist1.Items.AddRange(_specialists.OrderBy(i => i.LastName).ToArray());
                comboSpecialist2.Items.AddRange(_specialists.OrderBy(i => i.LastName).ToArray());
                radioCrew.Checked             = Discrepancy.FilledBy == false; // DiscrepancyFilledByEnum.Crew;
                radioMaintenanceStaff.Checked = Discrepancy.FilledBy;          //DiscrepancyFilledByEnum.MaintenanceStaff;
                ataChapterComboBox.ATAChapter = Discrepancy.ATAChapter;
                radioOpen.Checked             = Discrepancy.Status == CorrectiveActionStatus.Open;
                radioClose.Checked            = Discrepancy.Status == CorrectiveActionStatus.Close;
                radioButtonPublish.Checked    = Discrepancy.Status == CorrectiveActionStatus.Publish;
                textDescription.Text          = Discrepancy.Description ?? "No";
                checkBoxReliability.Checked   = Discrepancy.IsReliability;
                if (Discrepancy.Num > numericUpDownIndex.Maximum)
                {
                    numericUpDownIndex.Value = numericUpDownIndex.Maximum;
                }
                else if (Discrepancy.Num < numericUpDownIndex.Minimum)
                {
                    numericUpDownIndex.Value = numericUpDownIndex.Minimum;
                }
                else
                {
                    numericUpDownIndex.Value = Discrepancy.Num;
                }

                if (Discrepancy.DirectiveId > 0)
                {
                    lookupComboboxDeferred.SelectedItemId = Discrepancy.DirectiveId;
                    lookupComboboxFlight.SelectedItemId   = Discrepancy.FlightId;
                }
                if (Discrepancy.DeferredItem != null)
                {
                    ataChapterComboBox.Enabled    = false;
                    ataChapterComboBox.ATAChapter = Discrepancy.DeferredItem.ATAChapter;
                    radioOpen.Enabled             = false;
                    radioClose.Enabled            = false;

                    if (Discrepancy.DeferredItem.Status == DirectiveStatus.Closed)
                    {
                        radioClose.Checked = true;
                    }
                    else
                    {
                        radioOpen.Checked = true;
                    }

                    _showDeferredInfoPanel       = true;
                    textBoxMelCdl.Text           = Discrepancy.DeferredItem.DeferredMelCdlItem;
                    textBoxDeferredCategory.Text = Discrepancy.DeferredItem.DeferredCategory.ToString();

                    Directive directive = Discrepancy.DeferredItem;
                    dateTimePickerOpenDate.Visible = true;
                    dateTimePickerOpenDate.Value   = directive.Threshold.EffectiveDate;

                    if (directive.PerformanceRecords.Count > 0)
                    {
                        if (directive.IsClosed)
                        {
                            dateTimePickerClosingDate.Visible = true;
                            dateTimePickerExtension.Visible   = false;
                            numericUpDownExtTimes.Visible     = false;
                            dateTimePickerClosingDate.Value   = directive.PerformanceRecords.GetLast().RecordDate;
                        }
                        else
                        {
                            dateTimePickerClosingDate.Visible = false;
                            dateTimePickerExtension.Visible   = true;
                            numericUpDownExtTimes.Visible     = true;
                            dateTimePickerExtension.Value     = directive.PerformanceRecords.GetLast().RecordDate;

                            try
                            {
                                numericUpDownExtTimes.Value =
                                    GlobalObjects.CasEnvironment.Loader.GetCountPerformanceRecords <DirectiveRecord>(
                                        SmartCoreType.Directive, directive.ItemId);
                            }
                            catch (Exception ex)
                            {
                                Program.Provider.Logger.Log("Error while load count of records for directive id:" + directive.ItemId,
                                                            ex);
                            }

                            GlobalObjects.PerformanceCalculator.GetNextPerformance(directive);
                            lifelengthViewerRemains.Lifelength = directive.Remains;
                        }
                    }
                    else
                    {
                        dateTimePickerClosingDate.Visible = false;
                        dateTimePickerExtension.Visible   = false;
                        numericUpDownExtTimes.Visible     = false;

                        GlobalObjects.PerformanceCalculator.GetNextPerformance(directive);
                        lifelengthViewerRemains.Lifelength = directive.Remains;
                    }
                }
                else
                {
                    _showDeferredInfoPanel = false;
                }

                if (!panelExtendable.Visible)
                {
                    panelDeferredInfo.Visible = _showDeferredInfoPanel;
                }
                else
                {
                    panelDeferredInfo.Visible = _showDeferredInfoPanel && extendableRichContainer.Extended;
                }

                if (Discrepancy.CorrectiveAction != null)
                {
                    textCorrectiveAction.Text = Discrepancy.CorrectiveAction.Description ?? "No";
                    textPNOff.Text            = Discrepancy.CorrectiveAction.PartNumberOff;
                    textSNOff.Text            = Discrepancy.CorrectiveAction.SerialNumberOff;
                    textPNOn.Text             = Discrepancy.CorrectiveAction.PartNumberOn;
                    textSNOn.Text             = Discrepancy.CorrectiveAction.SerialNumberOn;
                    textADDNo.Text            = Discrepancy.CorrectiveAction.AddNo ?? "No";
                }
                else
                {
                    textCorrectiveAction.Text = "No";
                    textADDNo.Text            = "No";
                    textPNOff.Text            = textSNOff.Text = textPNOn.Text = textSNOn.Text = "";
                }

                if (Discrepancy.CertificateOfReleaseToService != null)
                {
                    textStation.Text            = Discrepancy.CertificateOfReleaseToService.Station;
                    dateTimePickerRTSDate.Value = Discrepancy.CertificateOfReleaseToService.RecordDate;
                    if (Discrepancy.CertificateOfReleaseToService.AuthorizationB1 != null)
                    {
                        Specialist selectedSpec = _specialists.GetItemById(Discrepancy.CertificateOfReleaseToService.AuthorizationB1.ItemId);
                        if (selectedSpec != null)
                        {
                            comboSpecialist1.SelectedItem = selectedSpec;
                        }
                        else
                        {
                            //Искомый специалист недействителен
                            comboSpecialist1.Items.Add(Discrepancy.CertificateOfReleaseToService.AuthorizationB1);
                            comboSpecialist1.SelectedItem = Discrepancy.CertificateOfReleaseToService.AuthorizationB1;
                        }
                        comboSpecialist1.BackColor =
                            ((Specialist)comboSpecialist1.SelectedItem).IsDeleted
                          ? Color.FromArgb(Highlight.Red.Color)
                          : Color.White;
                    }
                    if (Discrepancy.CertificateOfReleaseToService.AuthorizationB2 != null)
                    {
                        Specialist selectedSpec = _specialists.GetItemById(Discrepancy.CertificateOfReleaseToService.AuthorizationB2.ItemId);
                        if (selectedSpec != null)
                        {
                            comboSpecialist2.SelectedItem = selectedSpec;
                        }
                        else
                        {
                            //Искомый специалист недействителен
                            comboSpecialist2.Items.Add(Discrepancy.CertificateOfReleaseToService.AuthorizationB2);
                            comboSpecialist2.SelectedItem = Discrepancy.CertificateOfReleaseToService.AuthorizationB2;
                        }
                        comboSpecialist2.BackColor =
                            ((Specialist)comboSpecialist2.SelectedItem).IsDeleted
                                    ? Color.FromArgb(Highlight.Red.Color)
                                    : Color.White;
                    }
                }
                else
                {
                    textStation.Text = "";
                    comboSpecialist1.SelectedItem = null;
                    comboSpecialist2.SelectedItem = null;
                    dateTimePickerRTSDate.Value   = DateTime.Today;
                }
            }
            else
            {
                textADDNo.Text                = textDescription.Text = textCorrectiveAction.Text = textPNOff.Text =
                    textSNOff.Text            = textPNOn.Text = textSNOn.Text = textStation.Text = "";
                radioOpen.Checked             = radioClose.Checked = radioCrew.Checked = radioMaintenanceStaff.Checked = false;
                dateTimePickerRTSDate.Value   = DateTime.Today;
                comboSpecialist1.SelectedItem = null;
                comboSpecialist2.SelectedItem = null;
                textDescription.Text          = "What Where When Extent";
            }


            comboBoxWP.Items.Clear();
            comboBoxWP.Items.AddRange(_workPackages.ToArray());
            comboBoxWP.SelectedItem  = _workPackages.FirstOrDefault(i => i.ItemId == Discrepancy.WorkPackageId);
            comboBoxWP.DisplayMember = "ComboBoxMember";


            comboBoxComp.Items.Clear();
            comboBoxComp.Items.AddRange(_transferRecords.ToArray());
            comboBoxComp.SelectedItem = _transferRecords.FirstOrDefault(i => (bool)i.ParentComponent?.SerialNumber.Equals(textSNOn.Text) && (bool)i.ParentComponent?.PartNumber.Equals(textPNOn.Text) &&
                                                                        (bool)i.ReplaceComponent?.SerialNumber.Equals(textSNOff.Text) && (bool)i.ReplaceComponent?.PartNumber.Equals(textPNOff.Text));
            comboBoxComp.DisplayMember = "ComboBoxMember";

            SetExtendableControlCaption();

            lookupComboboxDeferred.SelectedIndexChanged += LookupComboboxDeferredSelectedIndexChanged;

            EndUpdate();

            comboBoxPhase.Select(comboBoxPhase.Text.Length, 0);
        }
コード例 #6
0
        private void btnSaveResult_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                MessageBoxEx.ShowWarning("请设置本次抽检名称");
                this.txtName.Focus();
                return;
            }
            if (this.numCount.Value == 0)
            {
                MessageBoxEx.ShowWarning("请输入每科室抽检的病案数");
                this.numCount.Focus();
                return;
            }
            if (this.dataGridView1.Rows.Count <= 0)
            {
                MessageBoxEx.ShowWarning("未抽检出病案信息");
                return;
            }
            if (this.dgvDetailList.Rows.Count <= 0)
            {
                MessageBoxEx.ShowWarning("请选择专家!");
                return;
            }
            if (this.m_QcSpecialCheck == null || this.m_QcSpecialCheck.ConfigID == string.Empty)
            {
                this.m_QcSpecialCheck            = new QcSpecialCheck();
                this.m_QcSpecialCheck.ConfigID   = this.m_QcSpecialCheck.MakeConfigID();
                this.m_QcSpecialCheck.Creater    = SystemParam.Instance.UserInfo.USER_NAME;
                this.m_QcSpecialCheck.CreateTime = DateTime.Now;
            }
            this.m_QcSpecialCheck.Name             = this.txtName.Text.Trim();
            this.m_QcSpecialCheck.DischargeMode    = this.cboDischargeMode.Text.Trim();
            this.m_QcSpecialCheck.PatientCondition = this.cboPatientCondition.Text.Trim();
            this.m_QcSpecialCheck.PatientCount     = this.dataGridView1.Rows.Count;
            this.m_QcSpecialCheck.PerCount         = int.Parse(this.numCount.Text);
            this.CheckdgvDetailInfos();//移除分配为0份病案的专家
            this.m_QcSpecialCheck.SpecialCount = this.dgvDetailList.Rows.Count;
            this.m_QcSpecialCheck.StartTime    = this.dtpBeginTime.Value;
            this.m_QcSpecialCheck.EndTime      = this.dtpEndTime.Value;
            short shRet = SystemData.ReturnValue.OK;

            if (this.IsNew)
            {
                shRet = SpecialAccess.Instance.SaveQCSpecialCheck(this.m_QcSpecialCheck);
                if (shRet != SystemData.ReturnValue.OK)
                {
                    MessageBoxEx.ShowError("保存失败");
                    this.m_QcSpecialCheck = null;
                    return;
                }
            }
            else
            {
                shRet = SpecialAccess.Instance.UpdateQCSpecialCheck(this.m_QcSpecialCheck);
                if (shRet != EMRDBLib.SystemData.ReturnValue.OK)
                {
                    MessageBoxEx.ShowError("保存失败");
                    return;
                }
            }
            //保存专家质控病案分配详情信息
            //先删除之前的配置信息
            if (!this.IsNew)
            {
                shRet = SpecialAccess.Instance.DeleteQCSpecialDetail(this.m_QcSpecialCheck.ConfigID);
            }
            //再保存分配信息
            for (int detailIndex = 0; detailIndex < this.dgvDetailList.Rows.Count; detailIndex++)
            {
                DataGridViewRow     detailRow      = this.dgvDetailList.Rows[detailIndex];
                List <PatVisitInfo> lstPatVisitLog = detailRow.Cells[this.colPatientCount.Index].Tag as List <PatVisitInfo>;
                Specialist          specialist     = detailRow.Tag as Specialist;
                if (specialist == null)
                {
                    continue;
                }
                if (lstPatVisitLog == null || lstPatVisitLog.Count <= 0)
                {
                    continue;
                }
                foreach (PatVisitInfo item in lstPatVisitLog)
                {
                    QcSpecialDetail qcSpecialDetail = new QcSpecialDetail();
                    qcSpecialDetail.ConfigID    = this.m_QcSpecialCheck.ConfigID;
                    qcSpecialDetail.PatientID   = item.PATIENT_ID;
                    qcSpecialDetail.VisitID     = item.VISIT_ID;
                    qcSpecialDetail.SpecialID   = specialist.UserID;
                    qcSpecialDetail.SpecialName = specialist.UserName;
                    shRet = SpecialAccess.Instance.SaveQCSpecialDetail(qcSpecialDetail);
                    if (shRet != EMRDBLib.SystemData.ReturnValue.OK)
                    {
                        MessageBoxEx.ShowError("病案分配详情保存失败!");
                        return;
                    }
                }
            }
            MessageBoxEx.ShowMessage("保存成功");
            this.IsNew = false;
        }
コード例 #7
0
        /// <summary>
        /// 初始化当前次病案抽检分配详情信息
        /// </summary>
        private void InitCurQCSpecialDeTail()
        {
            this.dataGridView1.Rows.Clear();
            this.dgvDetailList.Rows.Clear();
            if (this.m_QcSpecialCheck == null || string.IsNullOrEmpty(this.m_QcSpecialCheck.ConfigID))
            {
                return;
            }
            string szConfigID = this.m_QcSpecialCheck.ConfigID;
            List <QcSpecialDetail> lstQcSpecialDetail = null;
            short shRet = SpecialAccess.Instance.GetQCSpecialDetailList(szConfigID, ref lstQcSpecialDetail);

            if (shRet != SystemData.ReturnValue.OK)
            {
                return;
            }
            string szPreSpecialID = string.Empty;
            int    detailIndex    = 0;

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            /// 获三级医生信息
            List <EMRDBLib.PatDoctorInfo> lstPatDoctorInfos = new List <EMRDBLib.PatDoctorInfo>();

            foreach (QcSpecialDetail item in lstQcSpecialDetail)
            {
                if (szPreSpecialID != item.SpecialID)
                {
                    Specialist specialist = new Specialist();
                    specialist.UserID   = item.SpecialID;
                    specialist.UserName = item.SpecialName;
                    szPreSpecialID      = item.SpecialID;
                    detailIndex         = this.dgvDetailList.Rows.Add();
                    this.dgvDetailList.Rows[detailIndex].Cells[this.colUserName.Index].Value = item.SpecialName;
                    this.dgvDetailList.Rows[detailIndex].Tag = specialist;
                    List <PatVisitInfo> lstPatVisitLog = new List <PatVisitInfo>();
                    this.dgvDetailList.Rows[detailIndex].Cells[this.colPatientCount.Index].Tag   = lstPatVisitLog;
                    this.dgvDetailList.Rows[detailIndex].Cells[this.colPatientCount.Index].Value = lstPatVisitLog.Count.ToString();
                }

                PatVisitInfo patVisitLog = null;
                shRet = SpecialAccess.Instance.GetPatVisitInfo(item.PatientID, item.VisitID, ref patVisitLog);
                if (patVisitLog == null)
                {
                    continue;
                }
                //三级医生信息
                EMRDBLib.PatDoctorInfo patDoctorInfo = new EMRDBLib.PatDoctorInfo();
                patDoctorInfo.PatientID = patVisitLog.PATIENT_ID;
                patDoctorInfo.VisitID   = patVisitLog.VISIT_ID;
                lstPatDoctorInfos.Add(patDoctorInfo);

                if (shRet != SystemData.ReturnValue.OK)
                {
                    continue;
                }

                int             rowIndex = this.dataGridView1.Rows.Add();
                DataGridViewRow row      = this.dataGridView1.Rows[rowIndex];
                this.SetRowData(row, patVisitLog);
                Specialist detailSpecial = this.dgvDetailList.Rows[detailIndex].Tag as Specialist;
                row.Cells[this.colSpecialistName.Index].Tag   = detailSpecial;
                row.Cells[this.colSpecialistName.Index].Value = item.SpecialName;
                if (this.dataGridView1.Rows.Count <= 20)
                {
                    this.dataGridView1.Update();
                }
                List <PatVisitInfo> lstPatVisitLogDetail = this.dgvDetailList.Rows[detailIndex].Cells[this.colPatientCount.Index].Tag as List <PatVisitInfo>;
                if (lstPatVisitLogDetail == null)
                {
                    lstPatVisitLogDetail = new List <PatVisitInfo>();
                }
                lstPatVisitLogDetail.Add(patVisitLog);
                this.dgvDetailList.Rows[detailIndex].Cells[this.colPatientCount.Index].Value = lstPatVisitLogDetail.Count.ToString();
            }
            this.UpdateInchargeDoctor(lstPatDoctorInfos);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
コード例 #8
0
        public void UpdateControl(Specialist currentItem, List <AircraftModel> aircraftModels)
        {
            if (currentItem == null)
            {
                return;
            }

            _currentItem    = currentItem;
            _aircraftModels = aircraftModels;

            var ints = new object[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            comboBoxPersonnel.Items.Clear();
            foreach (var o in PersonnelCategory.Items)
            {
                comboBoxPersonnel.Items.Add(o);
            }

            comboBoxClass.Items.Clear();
            comboBoxClass.Items.AddRange(ints);
            comboBoxGrade.Items.Clear();
            comboBoxGrade.Items.AddRange(ints);

            comboBoxClass.SelectedItem     = _currentItem.ClassNumber;
            comboBoxGrade.SelectedItem     = _currentItem.GradeNumber;
            dateTimePickerClassIssue.Value = _currentItem.ClassIssueDate;
            dateTimePickerGradeIssue.Value = _currentItem.GradeIssueDate;
            comboBoxPersonnel.SelectedItem = _currentItem.PersonnelCategory;

            if (_currentItem.Licenses.Count > 0)
            {
                flowLayoutPanelGeneralControl.Controls.Clear();
                foreach (var license in _currentItem.Licenses)
                {
                    AddLicenseGeneralControl(license);
                }
            }
            else
            {
                var newLicense = new SpecialistLicense {
                    SpecialistId = _currentItem.ItemId
                };
                _currentItem.Licenses.Add(newLicense);
                employeeLicenceGeneralControl.UpdateControl(newLicense, _currentItem.PersonnelCategory, aircraftModels);
            }

            //Detail
            if (_currentItem.LicenseDetails.Count > 0)
            {
                flowLayoutPanelOtherDetail.Controls.Clear();
            }

            foreach (var licenseDetail in _currentItem.LicenseDetails)
            {
                AddDetailControl(licenseDetail);
            }

            //Remark
            if (_currentItem.LicenseRemark.Count > 0)
            {
                flowLayoutPanelRemark.Controls.Clear();
            }

            foreach (var instrumentRating in _currentItem.LicenseRemark)
            {
                AddRemarkControl(instrumentRating);
            }
        }
コード例 #9
0
        public void Save(Specialist specialist)
        {
            _casEnvironment.NewKeeper.Save(specialist);

            specialist.MedicalRecord.SpecialistId = specialist.ItemId;
            _casEnvironment.NewKeeper.Save(specialist.MedicalRecord);

            foreach (CategoryRecord categoryRecord in specialist.CategoriesRecords)
            {
                categoryRecord.Parent = specialist;
                _casEnvironment.NewKeeper.Save(categoryRecord);
            }

            foreach (var licenseDetail in specialist.LicenseDetails)
            {
                licenseDetail.SpecialistLicenseId = -1;
                licenseDetail.SpecialistId        = specialist.ItemId;
                _casEnvironment.NewKeeper.Save(licenseDetail);
            }

            foreach (var licenseRemark in specialist.LicenseRemark)
            {
                licenseRemark.SpecialistLicenseId = -1;
                licenseRemark.SpecialistId        = specialist.ItemId;
                _casEnvironment.NewKeeper.Save(licenseRemark);
            }

            foreach (var license in specialist.Licenses)
            {
                _casEnvironment.NewKeeper.Save(license);

                if (license.Document?.ParentId <= 0)
                {
                    license.Document.ParentId = license.ItemId;
                    _casEnvironment.NewKeeper.Save(license.Document);
                }

                foreach (var specialistCaa in license.CaaLicense)
                {
                    specialistCaa.SpecialistLicenseId = license.ItemId;
                    _casEnvironment.NewKeeper.Save(specialistCaa);

                    if (specialistCaa.Document?.ParentId <= 0)
                    {
                        specialistCaa.Document.ParentId = specialistCaa.ItemId;
                        _casEnvironment.NewKeeper.Save(specialistCaa.Document);
                    }
                }

                foreach (var licenseDetail in license.LicenseDetails)
                {
                    licenseDetail.SpecialistLicenseId = license.ItemId;
                    licenseDetail.SpecialistId        = -1;
                    _casEnvironment.NewKeeper.Save(licenseDetail);
                }

                foreach (var rating in license.LicenseRatings)
                {
                    rating.SpecialistLicenseId = license.ItemId;
                    _casEnvironment.NewKeeper.Save(rating);
                }

                foreach (var instrumentRating in license.SpecialistInstrumentRatings)
                {
                    instrumentRating.SpecialistLicenseId = license.ItemId;
                    _casEnvironment.NewKeeper.Save(instrumentRating);
                }

                foreach (var licenseRemark in license.LicenseRemark)
                {
                    licenseRemark.SpecialistLicenseId = license.ItemId;
                    licenseRemark.SpecialistId        = -1;
                    _casEnvironment.NewKeeper.Save(licenseRemark);
                }
            }

            foreach (var traning in specialist.SpecialistTrainings)
            {
                traning.SpecialistId = specialist.ItemId;
                _casEnvironment.NewKeeper.Save(traning);

                if (traning.Document?.ParentId <= 0)
                {
                    traning.Document.ParentId = traning.ItemId;
                    _casEnvironment.NewKeeper.Save(traning.Document);
                }
            }

            if (specialist.MedicalRecord?.Document?.ParentId <= 0)
            {
                specialist.MedicalRecord.Document.ParentId = specialist.ItemId;
                _casEnvironment.NewKeeper.Save(specialist.MedicalRecord.Document);
            }
        }
コード例 #10
0
    static void Main()
    {
        Employee e1  = new Employee(1, "John ", "Smith ", new DateTime(1992, 07, 12), 2500.20);
        Employee e2  = new Employee(2, "Anna ", "Bula ", new DateTime(1998, 04, 24), 3000);
        Employee e3  = new Employee(3, "Jennie ", "Kim ", new DateTime(1996, 01, 16), 7000.2);
        Employee e4  = new Employee(4, "Jessica ", "Blue ", new DateTime(1993, 02, 22), 9010.10);
        Employee e5  = new Employee(5, "Chen ", "Lee ", new DateTime(1992, 07, 12), 5620.70);
        Employee e6  = new Employee(6, "Charles ", "Hamilton ", new DateTime(1998, 04, 24), 3001.50);
        Employee e7  = new Employee(7, "Kemal ", "Atatürk ", new DateTime(1938, 11, 10), 9900);
        Employee e8  = new Employee(8, "Mehmet ", "Ersoy ", new DateTime(1940, 08, 01), 5001.60);
        Employee e9  = new Employee(9, "Elif ", "Uçar ", new DateTime(1997, 06, 30), 8000);
        Employee e10 = new Employee(10, "Gökçe ", "Karataban ", new DateTime(1997, 06, 29), 1000);


        e2.DateOfBirth = new DateTime(2002, 02, 14);



        Specialist e11 = new Specialist(11, "Edek ", "Beker ", new DateTime(1993, 04, 24), "Java Specialist", 2000);
        Specialist e12 = new Specialist(12, "Asli ", "Sulutas ", new DateTime(1996, 12, 19), "Web Development", 3000);
        Specialist e13 = new Specialist(13, "Hatice ", "Sulutas ", new DateTime(1961, 02, 15), "C# Programmer", 7000);
        Specialist e14 = new Specialist(14, "Ahmet ", "Sulutas ", new DateTime(1953, 05, 13), "Network Administrator", 4000);

        Employee[] listOfEmployees = { e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14 };

        PrintList(listOfEmployees);



        Console.WriteLine("We have " + Employee.CountEmployees() + " employees.");
        Console.WriteLine("The average salary is " + getAverageSalary(listOfEmployees));
        Console.WriteLine("Before promotion: " + e6.Salary);
        e6.promotion(20);     // salary increase
        Console.WriteLine("After promotion: " + e6.Salary);
        Console.WriteLine("---------------------------------------------- ");
        Console.WriteLine("---------------------------------------------- ");


        Console.WriteLine("\nSalary increase for all employees by %10. ");
        Console.WriteLine("---------------------------------------------- ");

        for (int i = 0; i < listOfEmployees.Length; i++)
        {
            listOfEmployees[i].promotion(10);
        }



        PrintList(listOfEmployees);

        Type   type       = e1.GetType();
        string stringType = type.ToString();

        Console.WriteLine(e1);

        type       = e11.GetType();
        stringType = type.ToString();
        Console.WriteLine(e11);

        Console.ReadLine();
    }
コード例 #11
0
 public List <Talon> GetSpecialistTalons(Specialist specialist)
 {
     return(Collection.Find(talon => talon.Specialist == specialist).ToList());
 }
コード例 #12
0
 private string[] CreateSpecialistDataArrayForCSV(Specialist doctor_specialist)
 {
     string[] result = CreateStaffDataArrayForCSV((Staff)doctor_specialist);
     result[PeopleConstants.SPECIALIZATION_COLUMN] = doctor_specialist.Specialization;
     return(result);
 }
コード例 #13
0
        public IActionResult Details(int id)
        {
            Specialist c = _db.Specialists.FirstOrDefault(sp => sp.Id == id);

            return(PartialView(c));
        }
コード例 #14
0
        public async Task <SpecialistDto> HandleAsync(GetSpecialist query)
        {
            Specialist specialist = await _specialistRepo.GetAsync(query.Id);

            return(_mapper.Map <SpecialistDto>(specialist));
        }
コード例 #15
0
        public async Task <IActionResult> Specialist(Specialist specialist)
        {
            await _specialistRepository.InsertSpecialist(specialist);

            return(Ok(specialist));
        }
コード例 #16
0
        public Treatment ConvertCSVFormatToEntity(string entityCSVFormat)
        {
            string[] tokens = entityCSVFormat.Split(Delimiter.ToCharArray());
            long     id     = long.Parse(tokens[0]);

            string doctorId = tokens[1];
            Doctor doctor   = DoctorRepository.Instance.GetDoctorById(long.Parse(doctorId));

            DateTime startDate = DateTime.ParseExact(tokens[2], "dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture);
            DateTime endDate   = DateTime.ParseExact(tokens[3], "dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture);

            List <Drug> prescriptionDrugs      = new List <Drug>();
            string      prescriptionDrugString = tokens[4];

            string[] prescriptionDrugParts = prescriptionDrugString.Split('|');
            if (!prescriptionDrugString.Equals(""))
            {
                foreach (string drugID in prescriptionDrugParts)
                {
                    Drug drug = DrugRepository.Instance.GetDrugById(long.Parse(drugID));
                    prescriptionDrugs.Add(drug);
                }
            }
            Prescription prescription = new Prescription(prescriptionDrugs);

            ScheduledSurgery scheduledSurgery = new ScheduledSurgery();

            if (!tokens[5].Equals(""))
            {
                DateTime surgeryStartDate = DateTime.ParseExact(tokens[5], "dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture);
                DateTime surgeryEndDate   = DateTime.ParseExact(tokens[6], "dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture);
                string   causeForSurgery  = tokens[7];
                Surgeon  surgeon          = SurgeonRepository.Instance.GetSurgeonById(long.Parse(tokens[8]));
                scheduledSurgery = new ScheduledSurgery(surgeryStartDate, surgeryEndDate, causeForSurgery, surgeon);
            }

            Specialist            specialist = SpecialistRepository.Instance.GetSpecialistById(long.Parse(tokens[9]));
            string                causeForSpecialistAppointment = tokens[10];
            SpecialistAppointment specialistAppointment         = new SpecialistAppointment(causeForSpecialistAppointment, specialist);

            string      causeForHospitalTreatment    = tokens[11];
            List <Drug> hospitalTreatmentDrugs       = new List <Drug>();
            string      hospitalTreatmentDrugsString = tokens[12];

            string[] hospitalTreatmentDrugsParts = hospitalTreatmentDrugsString.Split('|');
            if (!hospitalTreatmentDrugsString.Equals(""))
            {
                foreach (string drugID in hospitalTreatmentDrugsParts)
                {
                    Drug drug = DrugRepository.Instance.GetDrugById(long.Parse(drugID));
                    hospitalTreatmentDrugs.Add(drug);
                }
            }
            ReferralToHospitalTreatment referralToHospitalTreatment = new ReferralToHospitalTreatment(causeForHospitalTreatment, hospitalTreatmentDrugs);

            string             diagnosis          = tokens[13];
            string             review             = tokens[14];
            DiagnosisAndReview diagnosisAndReview = new DiagnosisAndReview(diagnosis, review);

            return(new Treatment(prescription, scheduledSurgery, diagnosisAndReview, referralToHospitalTreatment, startDate, endDate, id, doctor, specialistAppointment));
        }