Exemplo n.º 1
0
 public TestDeathInfo(DeathInfo d)
 {
     if (d != null)
     {
         document = d;
     }
 }
Exemplo n.º 2
0
    public void Suicide()
    {
        Grid      location = GetMyGrid();
        DeathInfo di       = new DeathInfo(location, this, this);

        Die(di);
    }
Exemplo n.º 3
0
    public virtual void GetPickedUp(Player player)
    {
        Grid      location = GetMyGrid();
        DeathInfo di       = new DeathInfo(location, this, this);

        Die(di);
    }
Exemplo n.º 4
0
 public override void OnDeath(DeathInfo deathInfo)
 {
     DropLoot();
     print(deathInfo.killer + " get " + expReward);
     deathInfo.killer.GainExp(expReward);
     GameManager.Instance.OnTurnEndSubscribers -= OnEndTurn;
 }
Exemplo n.º 5
0
        public int DeleteDeathInfo(DeathInfo aDeathInfo)
        {
            Query   = "DELETE DeathInfo WHERE OPID='" + aDeathInfo.Opid + "'";
            Command = new SqlCommand(Query, Connection);
            int rowAffect = Command.ExecuteNonQuery();

            return(rowAffect);
        }
Exemplo n.º 6
0
        /// <summary>
        /// JSONをオーバーレイに追加する
        /// </summary>
        /// <param name="info"></param>
        private void AddDeathReport(DeathInfo info)
        {
            var json = JsonUtil.CreateJsonData(info);

            if (this.Overlay != null && this.Overlay.Renderer != null && this.Overlay.Renderer.Browser != null)
            {
                ExecuteScript($"update({json});");
            }
        }
 public void ExportDeathsPDF()
 {
     if (Deaths != null && Deaths.Count() != 0)
     {
         DocumentManager.ExportDataPDF(DeathInfo.ConvertToList(Deaths), "Export zvířata");
     }
     else
     {
         MessageBox.Show("Žádná data pro export.");
     }
 }
Exemplo n.º 8
0
 public void TakeDamage(GridObject src, int amount)
 {
     anim.Play("GetHit");
     health -= amount;
     if (health <= 0)
     {
         Grid      location  = GameManager.Instance.GetGrid(gridX, gridY);
         DeathInfo deathInfo = new DeathInfo(location, src, this);
         Die(deathInfo);
     }
 }
Exemplo n.º 9
0
    void UpdateDeath(Message m)
    {
        DeathInfo info = m.deathInfo;

        if (info.id != player.Id)
        {
            NPCPlayer p = playersList[info.id].transform.gameObject.GetComponent <NPCPlayer>();
            p.Die();
            ScoreUpdate(info);
        }
    }
Exemplo n.º 10
0
    public void ScoreUpdate(DeathInfo info)
    {
        if (gameManager.gameStarted)
        {
            GameObject o = playersList[info.killer];
            Entity     k = o.GetComponent <Entity>();
            k.score++;

            scoreBoard.UpdateScore();
        }
    }
Exemplo n.º 11
0
        public MessageModel DeleteDeathInfo(DeathInfo aDeathInfo)
        {
            MessageModel aMessageModel = new MessageModel();

            aDeathInfoGatway = new DeathInfoGatway();
            if (aDeathInfoGatway.DeleteDeathInfo(aDeathInfo) > 0)
            {
                aMessageModel.MessageTitle = "Successfull";
                aMessageModel.MessageBody  = "Death info deleted successfully.";
            }
            return(aMessageModel);
        }
        public void Add(DeathInfo deathInfo)
        {
            DeathInfos.Insert(0, deathInfo);
            int max = SpeedrunToolModule.Settings.MaxNumberOfDeathData * 10;

            if (max <= 0)
            {
                max = 90;
            }

            if (DeathInfos.Count > max)
            {
                DeathInfos.RemoveRange(max, DeathInfos.Count - max);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// ログ読み込み時イベント
        /// </summary>
        /// <param name="isImport"></param>
        /// <param name="logInfo"></param>
        public void OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            // 戦闘中のみ処理
            if (!logInfo.inCombat)
            {
                return;
            }

            DeathInfo info = parser.Parse(logInfo);

            if (info != null)
            {
                AddDeathReport(info);
            }
        }
Exemplo n.º 14
0
    private void SendDeathInformation(Entity shooter)
    {
        Message m = new Message();

        m.MessageType = MessageType.Died;
        DeathInfo info = new DeathInfo();

        info.x      = transform.position.x;
        info.y      = transform.position.y;
        info.z      = transform.position.z;
        info.id     = id;
        info.name   = nickName;
        info.killer = shooter.id;
        m.deathInfo = info;
        tcpClient.ScoreUpdate(info);
        tcpClient.player.SendMessage(m);
    }
Exemplo n.º 15
0
        /// <summary>
        /// ダミーデータをオーバーレイに追加する
        /// </summary>
        public void AddDummyDeathReport()
        {
            // 時刻を作成
            var time = DateTime.Now;

            // ダミーデータ作成
            var d = new DeathInfo()
            {
                Actions          = new List <ActionInfo>(),
                DeathTime        = time,
                EncountStartTime = time,
                Performer        = "エネミー",
                Victim           = "Player One",
            };

            // ダミーデータ明細を作成
            d.Actions.Add(new ActionInfo()
            {
                Performer  = "エネミー",
                ActionName = "攻撃",
                Before     = 3.0,
                Point      = -10000
            });

            d.Actions.Add(new ActionInfo()
            {
                Performer  = "Player Two",
                ActionName = "回復",
                Before     = 2.0,
                Point      = 5000
            });

            d.Actions.Add(new ActionInfo()
            {
                Performer  = "エネミー",
                ActionName = "攻撃",
                Before     = 1.0,
                Point      = -30000
            });

            // 同じデータを3回送信
            AddDeathReport(d);
            AddDeathReport(d);
            AddDeathReport(d);
        }
Exemplo n.º 16
0
 static public TestDeathInfo BuildDeathInfoFromDataBaseDate(string IdStep)
 {
     using (SqlConnection connection = Global.GetSqlConnection())
     {
         string     findDI    = "SELECT TOP(1) * FROM DeathInfo WHERE IdDeathInfo = (SELECT MAX(IdDeathInfo) FROM DeathInfo WHERE IdStep = '" + IdStep + "')";
         SqlCommand DIcommand = new SqlCommand(findDI, connection);
         using (SqlDataReader DIReader = DIcommand.ExecuteReader())
         {
             while (DIReader.Read())
             {
                 DeathInfo d = new DeathInfo();
                 if (DIReader["DeathMKBCode"].ToString() != "")
                 {
                     d.MkbCode = Convert.ToString(DIReader["DeathMKBCode"]);
                 }
                 return(new TestDeathInfo(d));
             }
         }
     }
     return(null);
 }
Exemplo n.º 17
0
        public int SaveDeathInfo(DeathInfo aDeathInfo)
        {
            Query = "INSERT INTO DeathInfo (DeathRegNo,Name,IssueDate,FathersName,MothersName,DateOfDeath,DeathTime,Age," +
                    "Gender,MaritalStatus,SpouseName,PresentAddress,PermanentAddress,Nationality,CreateDate,UserId,OPID,Floor,Cabin,Bed,Religion,DateOfAdmission,IntervalBetween) " +
                    "VALUES (@DeathRegNo,@Name,@IssueDate,@FathersName,@MothersName,@DateOfDeath,@DeathTime,@Age,@Gender," +
                    "@MaritalStatus,@SpouseName,@PresentAddress,@PermanentAddress,@Nationality,@CreateDate,@UserId,@OPID,@Floor,@Cabin,@Bed,@Religion,@DateOfAdmission,@IntervalBetween)";
            Command = new SqlCommand(Query, Connection);
            Command.Parameters.AddWithValue("@DeathRegNo", aDeathInfo.DeathRegNo ?? "");
            Command.Parameters.AddWithValue("@Name", aDeathInfo.Name ?? "");
            Command.Parameters.AddWithValue("@IssueDate", aDeathInfo.IssueDate);
            Command.Parameters.AddWithValue("@FathersName", aDeathInfo.FathersName ?? "");
            Command.Parameters.AddWithValue("@MothersName", aDeathInfo.MothersName ?? "");
            Command.Parameters.AddWithValue("@DateOfDeath", aDeathInfo.DateOfDeath);
            Command.Parameters.AddWithValue("@DeathTime", aDeathInfo.DeathTime);
            Command.Parameters.AddWithValue("@Age", aDeathInfo.Age ?? "");
            Command.Parameters.AddWithValue("@Gender", aDeathInfo.Gender ?? "");
            Command.Parameters.AddWithValue("@MaritalStatus", aDeathInfo.MaritalStatus ?? "");
            Command.Parameters.AddWithValue("@SpouseName", aDeathInfo.SpouseName ?? "");
            Command.Parameters.AddWithValue("@PresentAddress", aDeathInfo.PresentAddress ?? "");
            Command.Parameters.AddWithValue("@PermanentAddress", aDeathInfo.PermanentAddress ?? "");
            Command.Parameters.AddWithValue("@Nationality", aDeathInfo.Nationality ?? "");
            Command.Parameters.AddWithValue("@CreateDate", aDeathInfo.CreateDate);
            Command.Parameters.AddWithValue("@UserId", aDeathInfo.UserId ?? "");
            Command.Parameters.AddWithValue("@OPID", aDeathInfo.Opid ?? "");

            Command.Parameters.AddWithValue("@Floor", aDeathInfo.Floor ?? "");
            Command.Parameters.AddWithValue("@Cabin", aDeathInfo.Cabin ?? "");
            Command.Parameters.AddWithValue("@Bed", aDeathInfo.Bed ?? "");
            Command.Parameters.AddWithValue("@Religion", aDeathInfo.Religion ?? "");
            Command.Parameters.AddWithValue("@DateOfAdmission", aDeathInfo.DateOfAdmission);
            Command.Parameters.AddWithValue("@IntervalBetween", aDeathInfo.IntervalBetween ?? "");



            int rowAffect = Command.ExecuteNonQuery();

            return(rowAffect);
        }
Exemplo n.º 18
0
        public int UpdateDeathInfo(DeathInfo aDeathInfo)
        {
            Query = "UPDATE DeathInfo SET DeathRegNo=@DeathRegNo,Name=@Name,IssueDate=@IssueDate,FathersName=@FathersName," +
                    "MothersName=@MothersName,DateOfDeath=@DateOfDeath,DeathTime=@DeathTime,Age=@Age,Gender=@Gender,MaritalStatus=@MaritalStatus," +
                    "SpouseName=@SpouseName,PresentAddress=@PresentAddress,PermanentAddress=@PermanentAddress,Nationality=@Nationality," +
                    "UpdateDate=@UpdateDate,UserId=@UserId,Floor=@Floor,Cabin=@Cabin,Bed=@Bed,Religion=@Religion,DateOfAdmission=@DateOfAdmission,IntervalBetween=@IntervalBetween WHERE OPID=@OPID";
            Command = new SqlCommand(Query, Connection);
            Command.Parameters.AddWithValue("@DeathRegNo", aDeathInfo.DeathRegNo ?? "");
            Command.Parameters.AddWithValue("@Name", aDeathInfo.Name ?? "");
            Command.Parameters.AddWithValue("@IssueDate", aDeathInfo.IssueDate);
            Command.Parameters.AddWithValue("@FathersName", aDeathInfo.FathersName);
            Command.Parameters.AddWithValue("@MothersName", aDeathInfo.MothersName);
            Command.Parameters.AddWithValue("@DateOfDeath", aDeathInfo.DateOfDeath);
            Command.Parameters.AddWithValue("@DeathTime", aDeathInfo.DeathTime);
            Command.Parameters.AddWithValue("@Age", aDeathInfo.Age);
            Command.Parameters.AddWithValue("@Gender", aDeathInfo.Gender);
            Command.Parameters.AddWithValue("@MaritalStatus", aDeathInfo.MaritalStatus);
            Command.Parameters.AddWithValue("@SpouseName", aDeathInfo.SpouseName);
            Command.Parameters.AddWithValue("@PresentAddress", aDeathInfo.PresentAddress);
            Command.Parameters.AddWithValue("@PermanentAddress", aDeathInfo.PermanentAddress);
            Command.Parameters.AddWithValue("@Nationality", aDeathInfo.Nationality);
            Command.Parameters.AddWithValue("@UpdateDate", aDeathInfo.UpdateDate);
            Command.Parameters.AddWithValue("@UserId", aDeathInfo.UserId);
            Command.Parameters.AddWithValue("@OPID", aDeathInfo.Opid);


            Command.Parameters.AddWithValue("@Floor", aDeathInfo.Floor ?? "");
            Command.Parameters.AddWithValue("@Cabin", aDeathInfo.Cabin ?? "");
            Command.Parameters.AddWithValue("@Bed", aDeathInfo.Bed ?? "");
            Command.Parameters.AddWithValue("@Religion", aDeathInfo.Religion ?? "");
            Command.Parameters.AddWithValue("@DateOfAdmission", aDeathInfo.DateOfAdmission);
            Command.Parameters.AddWithValue("@IntervalBetween", aDeathInfo.IntervalBetween ?? "");


            int rowAffect = Command.ExecuteNonQuery();

            return(rowAffect);
        }
Exemplo n.º 19
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (xtraTabControl1.SelectedTabPage == TabBirthInfo)
     {
         DialogResult dr = MessageBox.Show("Are you sure to delete row?", "Confirmation Message",
                                           MessageBoxButtons.YesNo);
         if (dr == DialogResult.Yes)
         {
             BirthInfo aBirthInfo = new BirthInfo();
             aBirthInfo.Id = Convert.ToInt32(lblId.Text);
             MessageModel aMessageModel = new MessageModel();
             aMessageModel = aBirthInfoManager.DeleteBirthInfo(aBirthInfo);
             if (aMessageModel.MessageTitle == "Successfull")
             {
                 MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 RefreshBirthInfo();
             }
         }
     }
     else
     {
         DialogResult dr = MessageBox.Show("Are you sure to delete row?", "Confirmation Message",
                                           MessageBoxButtons.YesNo);
         if (dr == DialogResult.Yes)
         {
             DeathInfo aDeathInfo = new DeathInfo();
             aDeathInfo.Opid = txtDeathPatientID.Text;
             MessageModel aMessageModel = new MessageModel();
             aMessageModel = aDeathInfoManager.DeleteDeathInfo(aDeathInfo);
             if (aMessageModel.MessageTitle == "Successfull")
             {
                 MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 RefreshDeathInfo();
             }
         }
     }
 }
Exemplo n.º 20
0
 /// <summary>
 /// Sends a message to indicate that a game object is dead
 /// </summary>
 /// <param name="id">Game object id</param>
 private void SendDeathMessage(int id)
 {
     DeathInfo info = new DeathInfo(id);
     Message msg = new Message(EventTypeConstant.DeathEvent, info);
     _mediator.Queue(msg);
 }
Exemplo n.º 21
0
        public bool CheckDocumentInCase(MedRecord i, string idLpu)
        {
            TestMedRecord doc = null;

            Service serv = i as Service;

            if (serv != null)
            {
                doc = new TestService(serv);
            }

            TfomsInfo tfi = i as TfomsInfo;

            if (tfi != null)
            {
                doc = new TestTfomsInfo(tfi);
            }

            DeathInfo di = i as DeathInfo;

            if (di != null)
            {
                doc = new TestDeathInfo(di);
            }

            Diagnosis diag = i as Diagnosis;

            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
            {
                doc = new TestDiagnosis(diag, idLpu);
            }

            ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;

            if ((cmd != null) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
            {
                doc = new TestClinicMainDiagnosis(cmd, idLpu);
            }

            AnatomopathologicalClinicMainDiagnosis acmd = i as AnatomopathologicalClinicMainDiagnosis;

            if ((acmd != null) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
            {
                doc = new TestClinicMainDiagnosis(acmd, idLpu);
            }

            Referral r = i as Referral;

            if (r != null)
            {
                doc = new TestReferral(r, idLpu);
            }

            SickList sl = i as SickList;

            if (sl != null)
            {
                doc = new TestSickList(sl, idLpu);
            }

            DischargeSummary ds = i as DischargeSummary;

            if (ds != null)
            {
                doc = new TestDischargeSummary(ds, idLpu);
            }

            LaboratoryReport lr = i as LaboratoryReport;

            if (lr != null)
            {
                doc = new TestLaboratoryReport(lr, idLpu);
            }

            ConsultNote cn = i as ConsultNote;

            if (cn != null)
            {
                doc = new TestConsultNote(cn, idLpu);
            }

            DispensaryOne d1 = i as DispensaryOne;

            if ((d1 != null) && (caseBase.idCaseType == dispensaryId))
            {
                doc = new TestDispensaryOne(d1, idLpu);
            }

            AppointedMedication ap = i as AppointedMedication;

            if (ap != null)
            {
                doc = new TestAppointedMedication(ap, idLpu);
            }

            Form027U form = i as Form027U;

            if (form != null)
            {
                doc = new TestForm027U(form, idLpu);
            }

            if (Global.IsEqual(doc, null))
            {
                Global.errors1.Add("Документ не найден");
                return(true);
            }

            foreach (TestMedRecord document in this.medRecords)
            {
                if (Global.IsEqual(doc, document))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 22
0
        public TestStatCase(string guid, CaseStat cs)
        {
            GUID = guid.ToLower();
            if (cs != null)
            {
                caseStat = cs;
                caseBase = new TestCaseBase(guid, cs);
                if (cs.Steps != null)
                {
                    statSteps = new List <TestStatStep>();
                    foreach (StepStat i in cs.Steps)
                    {
                        statSteps.Add(new TestStatStep(i, cs.IdLpu));
                    }
                }
                if (cs.MedRecords != null)
                {
                    records = new List <TestMedRecord>();
                    foreach (object i in cs.MedRecords)
                    {
                        Service ser = i as Service;
                        if (ser != null)
                        {
                            records.Add(new TestService(ser, cs.IdLpu));
                        }

                        TfomsInfo tfi = i as TfomsInfo;
                        if (tfi != null)
                        {
                            records.Add(new TestTfomsInfo(tfi));
                        }

                        DeathInfo di = i as DeathInfo;
                        if (di != null)
                        {
                            records.Add(new TestDeathInfo(di));
                        }

                        ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;
                        if ((cmd != null) && (cs.HospResult != IdDeath) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                        {
                            records.Add(new TestClinicMainDiagnosis(cmd, cs.IdLpu));
                        }

                        AnatomopathologicalClinicMainDiagnosis acmd = i as AnatomopathologicalClinicMainDiagnosis;
                        if ((acmd != null) && (cs.HospResult == IdDeath) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                        {
                            records.Add(new TestClinicMainDiagnosis(acmd, cs.IdLpu));
                        }
                        if ((cmd == null) && (acmd == null))
                        {
                            Diagnosis diag = i as Diagnosis;
                            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                            {
                                records.Add(new TestDiagnosis(diag, cs.IdLpu));
                            }
                            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                            {
                                records.Add(new TestClinicMainDiagnosis(diag, cs.IdLpu));
                            }
                        }

                        Referral r = i as Referral;
                        if (r != null)
                        {
                            records.Add(new TestReferral(r, cs.IdLpu));
                        }

                        SickList sl = i as SickList;
                        if (sl != null)
                        {
                            records.Add(new TestSickList(sl, cs.IdLpu));
                        }

                        DischargeSummary ds = i as DischargeSummary;
                        if (ds != null)
                        {
                            records.Add(new TestDischargeSummary(ds, cs.IdLpu));
                        }

                        LaboratoryReport lr = i as LaboratoryReport;
                        if (lr != null)
                        {
                            records.Add(new TestLaboratoryReport(lr, cs.IdLpu));
                        }

                        ConsultNote cn = i as ConsultNote;
                        if (cn != null)
                        {
                            records.Add(new TestConsultNote(cn, cs.IdLpu));
                        }

                        AppointedMedication ap = i as AppointedMedication;
                        if (ap != null)
                        {
                            records.Add(new TestAppointedMedication(ap, cs.IdLpu));
                        }

                        Form027U form = i as Form027U;
                        if (form != null)
                        {
                            records.Add(new TestForm027U(form, cs.IdLpu));
                        }
                    }
                }
                if ((cs.IdLpu != null) && (cs.IdPatientMis != null))
                {
                    List <TestStepBase> st = TestStepBase.BuildTestStepsFromDataBase(TestCaseBase.GetCaseId(guid, cs.IdLpu, cs.IdCaseMis, TestPerson.GetPersonId(guid, cs.IdLpu, cs.IdPatientMis)), cs.IdLpu);
                    if (st != null)
                    {
                        foreach (TestStepBase i in st)
                        {
                            if (Global.IsEqual(i.doctor, null))
                            {
                                defaultStep = i;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 23
0
 public override void Die(DeathInfo di)
 {
     anim.Play("Die");
 }
Exemplo n.º 24
0
        public DeathInfo Parse(LogLineEventArgs logInfo)
        {
            var match = re.Match(logInfo.logLine);

            if (match.Success)
            {
                // アクションのターゲットと実行者を取得
                var victim          = match.Groups["victim"].Value;
                var performer       = match.Groups["performer"].Value;
                var deathTimeString = match.Groups["time"].Value;

                // 現在の戦闘を取得
                var encounter = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter;

                // 犠牲者の戦闘データを取得
                var combatantData = encounter.GetCombatant(victim);

                // 犠牲者が敵でなかった場合のみ処理
                if (combatantData != null && combatantData.GetCombatantType() != 0)
                {
                    // 実行時間をパース
                    var deathTime = logInfo.detectedTime;

                    // 基本的な情報をセット
                    var d = new DeathInfo()
                    {
                        EncountStartTime = encounter.StartTime,
                        Victim           = victim,
                        Performer        = performer,
                        DeathTime        = deathTime
                    };

                    // ログ集計
                    var sec    = this.config.AddonConfig.SecBeforeDeath;
                    var swings = combatantData.AllInc["All"].Items.Where((e) =>
                    {
                        // Killingは除外
                        if (e.AttackType == "Killing")
                        {
                            return(false);
                        }

                        // 時間でフィルタ
                        TimeSpan ts = deathTime.Subtract(e.Time);
                        if (ts.TotalSeconds > sec)
                        {
                            return(false);
                        }

                        // Victimがやられた人じゃない場合は除外
                        if (e.Victim != combatantData.Name)
                        {
                            return(false);
                        }

                        // 割り込みは除外
                        if (e.Special == "Interrupted")
                        {
                            return(false);
                        }

                        // 対象のSwingTypeのみ集計
                        return(this.targetSwingType.Contains(e.SwingType));
                    }).ToList();

                    d.Actions = swings.Select((e) =>
                    {
                        var actionInfo = new ActionInfo()
                        {
                            ActionName = e.AttackType,
                            Before     = (d.DeathTime - e.Time).TotalSeconds,
                            Performer  = e.Attacker,
                            Point      = CombatantData.DamageSwingTypes.Contains(e.SwingType) ? -e.Damage.Number : e.Damage.Number
                        };
                        return(actionInfo);
                    }).ToList();

                    return(d);
                }
            }
            return(null);
        }
Exemplo n.º 25
0
        public void SaveAndUpdateBirthInfo()
        {
            if (xtraTabControl1.SelectedTabPage == TabBirthInfo)
            {
                MessageModel aMessageModel = new MessageModel();
                BirthInfo    aBirthInfo    = new BirthInfo();
                if (!string.IsNullOrEmpty(lblId.Text))
                {
                    aBirthInfo.Id = Convert.ToInt32(lblId.Text);
                }
                aBirthInfo.OPID               = txtOpId.Text;
                aBirthInfo.Name               = txtName.Text;
                aBirthInfo.DateOfBirth        = dateTimeDateOfBirth.Value;
                aBirthInfo.BirthTime          = dateTimeBirthTime.Text;
                aBirthInfo.Weight             = txtWeight.Text;
                aBirthInfo.Height             = txtHeight.Text;
                aBirthInfo.IssueDate          = dateTimeIssueDate.Value;
                aBirthInfo.BirthRegNo         = txtBirthRegNo.Text;
                aBirthInfo.Gender             = cmbGender.SelectedText;
                aBirthInfo.Nationality        = txtNationality.Text;
                aBirthInfo.FathersName        = txtFathersName.Text;
                aBirthInfo.MothersName        = txtMothersName.Text;
                aBirthInfo.FathersNationality = txtFathersNationality.Text;
                aBirthInfo.MothersNationality = txtMothersNationality.Text;
                aBirthInfo.PresentAddress     = txtPresentAddress.Text;
                aBirthInfo.PermanentAddress   = txtPermanentAddress.Text;
                aBirthInfo.UserId             = lblUserId.Text;
                aBirthInfo.CabinBed           = txtCabinBed.Text;
                aBirthInfo.TypeOfDelivery     = txtTypeOfDelivery.Text;

                if (btnBirthInfoSave.Text == "Save")
                {
                    aBirthInfo.CreateDate = DateTime.Now;
                    aMessageModel         = aBirthInfoManager.SaveBirthInfo(aBirthInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                        RefreshBirthInfo();
                    }
                    MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    aBirthInfo.UpdateDate = DateTime.Now;
                    aMessageModel         = aBirthInfoManager.UpdateBirthInfo(aBirthInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        RefreshBirthInfo();
                    }
                }
            }

            else if (xtraTabControl1.SelectedTabPage == TabDeathInfo)
            {
                DeathInfo aDeathInfo = new DeathInfo();
                aDeathInfo.DeathRegNo       = txtDeathRegNo.Text;
                aDeathInfo.Name             = txtDeathName.Text;
                aDeathInfo.IssueDate        = dateTimeDeathIssueDate.Value;
                aDeathInfo.FathersName      = txtDeathFathersName.Text;
                aDeathInfo.MothersName      = txtDeathMothersName.Text;
                aDeathInfo.DateOfDeath      = dateTimeDateOfDeath.Value;
                aDeathInfo.DeathTime        = dateTimeDeathTime.Text;
                aDeathInfo.Gender           = cmbGender.Text; aDeathInfo.MaritalStatus = cmbDeathMaritalStatus.Text;
                aDeathInfo.SpouseName       = txtDeathSpouseName.Text;
                aDeathInfo.PresentAddress   = txtDeathPresentAddress.Text;
                aDeathInfo.PermanentAddress = txtDeathPermanentAddress.Text;
                aDeathInfo.Nationality      = txtNationality.Text;
                aDeathInfo.UserId           = lblUserId.Text;
                aDeathInfo.Opid             = txtDeathPatientID.Text;
                aDeathInfo.Age = txtDeathAge.Text;


                aDeathInfo.Floor           = txtFloor.Text;
                aDeathInfo.Cabin           = txtCabinBed.Text;
                aDeathInfo.Bed             = txtBed.Text;
                aDeathInfo.Religion        = txtReligion.Text;
                aDeathInfo.DateOfAdmission = dateOfAdmission.Value;
                aDeathInfo.IntervalBetween = txtIntervalBetween.Text;


                aDeathInfoManager = new DeathInfoManager();
                MessageModel aMessageModel = new MessageModel();
                if (btnBirthInfoSave.Text == "Save")
                {
                    aDeathInfo.CreateDate = DateTime.Now;
                    aMessageModel         = aDeathInfoManager.SaveDeathInfo(aDeathInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        RefreshDeathInfo();
                    }
                }
                else
                {
                    aDeathInfo.UpdateDate = DateTime.Now;
                    aMessageModel         = aDeathInfoManager.UpdateDeathInfo(aDeathInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        RefreshDeathInfo();
                    }
                }
            }
        }
Exemplo n.º 26
0
 private List <EMKServise.MedRecord> ConvertMedRecords(MedRecord[] c)
 {
     if (((object)c != null) && (c.Length != 0))
     {
         List <EMKServise.MedRecord> lmr = new List <EMKServise.MedRecord>();
         foreach (object i in c)
         {
             Service ser = i as Service;
             if (ser != null)
             {
                 EMKServise.Service eser = new EMKServise.Service();
                 if (ser.DateEnd != DateTime.MinValue)
                 {
                     eser.DateEnd = ser.DateEnd;
                 }
                 if (ser.DateStart != DateTime.MinValue)
                 {
                     eser.DateStart = ser.DateStart;
                 }
                 if (ser.IdServiceType != "")
                 {
                     eser.IdServiceType = ser.IdServiceType;
                 }
                 eser.PaymentInfo = ConvertPaymentInfo(ser.PaymentInfo);
                 eser.Performer   = ConvertParticipant(ser.Performer);
                 if (ser.ServiceName != "")
                 {
                     eser.ServiceName = ser.ServiceName;
                 }
                 lmr.Add(eser);
             }
             TfomsInfo tfi = i as TfomsInfo;
             if (tfi != null)
             {
                 EMKServise.TfomsInfo etfi = new EMKServise.TfomsInfo();
                 etfi.Count       = tfi.Count;
                 etfi.IdTfomsType = tfi.IdTfomsType;
                 etfi.Tariff      = tfi.Tariff;
                 lmr.Add(etfi);
             }
             AppointedMedication ap = i as AppointedMedication;
             if (ap != null)
             {
                 EMKServise.AppointedMedication eap = new EMKServise.AppointedMedication();
                 if (ap.AnatomicTherapeuticChemicalClassification != "")
                 {
                     eap.AnatomicTherapeuticChemicalClassification = ap.AnatomicTherapeuticChemicalClassification;
                 }
                 eap.CourseDose = ConvertQuantity(ap.CourseDose);
                 eap.DayDose    = ConvertQuantity(ap.DayDose);
                 eap.DaysCount  = ap.DaysCount;
                 eap.Doctor     = ConvertMedicalStaff(ap.Doctor);
                 if (ap.IssuedDate != DateTime.MinValue)
                 {
                     eap.IssuedDate = ap.IssuedDate;
                 }
                 if (ap.MedicineIssueType != "")
                 {
                     eap.MedicineIssueType = ap.MedicineIssueType;
                 }
                 if (ap.MedicineName != "")
                 {
                     eap.MedicineName = ap.MedicineName;
                 }
                 eap.MedicineType   = ap.MedicineType;
                 eap.MedicineUseWay = ap.MedicineUseWay;
                 if (ap.Number != "")
                 {
                     eap.Number = ap.Number;
                 }
                 eap.OneTimeDose = ConvertQuantity(ap.OneTimeDose);
                 if (ap.Seria != "")
                 {
                     eap.Seria = ap.Seria;
                 }
                 lmr.Add(eap);
             }
             DeathInfo di = i as DeathInfo;
             if (di != null)
             {
                 EMKServise.DeathInfo edi = new EMKServise.DeathInfo();
                 if (di.MkbCode != "")
                 {
                     edi.MkbCode = di.MkbCode;
                 }
                 lmr.Add(edi);
             }
             ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;
             if ((cmd != null) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
             {
                 EMKServise.ClinicMainDiagnosis ecmd = new EMKServise.ClinicMainDiagnosis();
                 ecmd.Complications = ConvertDiagnosis(cmd.Complications);
                 ecmd.DiagnosisInfo = ConvertDiagnosisInfo(cmd.DiagnosisInfo);
                 ecmd.Doctor        = ConvertMedicalStaff(cmd.Doctor);
                 lmr.Add(ecmd);
             }
             if (cmd == null)
             {
                 Diagnosis diag = i as Diagnosis;
                 if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                 {
                     EMKServise.ClinicMainDiagnosis ecmd = new EMKServise.ClinicMainDiagnosis();
                     ecmd.DiagnosisInfo = ConvertDiagnosisInfo(diag.DiagnosisInfo);
                     ecmd.Doctor        = ConvertMedicalStaff(diag.Doctor);
                     lmr.Add(ecmd);
                 }
                 if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                 {
                     EMKServise.Diagnosis ecmd = new EMKServise.Diagnosis();
                     ecmd.DiagnosisInfo = ConvertDiagnosisInfo(diag.DiagnosisInfo);
                     ecmd.Doctor        = ConvertMedicalStaff(diag.Doctor);
                     lmr.Add(ecmd);
                 }
             }
             Referral r = i as Referral;
             if (r != null)
             {
                 EMKServise.Referral er = new EMKServise.Referral();
                 er.Attachment = ConvertAttachment(r.Attachment);
                 er.Author     = ConvertMedicalStaff(r.Author);
                 if (r.CreationDate != DateTime.MinValue)
                 {
                     er.CreationDate = r.CreationDate;
                 }
                 er.DepartmentHead = ConvertMedicalStaff(r.DepartmentHead);
                 if (r.Header != "")
                 {
                     er.Header = r.Header;
                 }
                 if (r.IdSourceLpu != "")
                 {
                     er.IdSourceLpu = r.IdSourceLpu;
                 }
                 if (r.IdTargetLpu != "")
                 {
                     er.IdTargetLpu = r.IdTargetLpu;
                 }
                 if (r.ReferralID != "")
                 {
                     er.ReferralID = r.ReferralID;
                 }
                 er.ReferralInfo = ConvertReferralInfo(r.ReferralInfo);
                 if (r.RelatedID != "")
                 {
                     er.RelatedID = r.RelatedID;
                 }
                 lmr.Add(er);
             }
             SickList sl = i as SickList;
             if (sl != null)
             {
                 EMKServise.SickList esl = new EMKServise.SickList();
                 esl.Attachment = ConvertAttachment(sl.Attachment);
                 esl.Author     = ConvertMedicalStaff(sl.Author);
                 if (sl.CreationDate != DateTime.MinValue)
                 {
                     esl.CreationDate = sl.CreationDate;
                 }
                 if (sl.Header != "")
                 {
                     esl.Header = sl.Header;
                 }
                 esl.SickListInfo = ConvertSickListInfo(sl.SickListInfo);
                 lmr.Add(esl);
             }
             DischargeSummary ds = i as DischargeSummary;
             if (ds != null)
             {
                 EMKServise.DischargeSummary eds = new EMKServise.DischargeSummary();
                 eds.Attachment = ConvertAttachment(ds.Attachment);
                 eds.Author     = ConvertMedicalStaff(ds.Author);
                 if (ds.CreationDate != DateTime.MinValue)
                 {
                     eds.CreationDate = ds.CreationDate;
                 }
                 if (ds.Header != "")
                 {
                     eds.Header = ds.Header;
                 }
                 lmr.Add(eds);
             }
             LaboratoryReport lr = i as LaboratoryReport;
             if (lr != null)
             {
                 EMKServise.LaboratoryReport elr = new EMKServise.LaboratoryReport();
                 elr.Attachment = ConvertAttachment(lr.Attachment);
                 elr.Author     = ConvertMedicalStaff(lr.Author);
                 if (lr.CreationDate != DateTime.MinValue)
                 {
                     elr.CreationDate = lr.CreationDate;
                 }
                 if (lr.Header != "")
                 {
                     elr.Header = lr.Header;
                 }
                 lmr.Add(elr);
             }
             ConsultNote cn = i as ConsultNote;
             if (cn != null)
             {
                 EMKServise.ConsultNote ecn = new EMKServise.ConsultNote();
                 ecn.Attachment = ConvertAttachment(cn.Attachment);
                 ecn.Author     = ConvertMedicalStaff(cn.Author);
                 if (cn.CreationDate != DateTime.MinValue)
                 {
                     ecn.CreationDate = cn.CreationDate;
                 }
                 if (cn.Header != "")
                 {
                     ecn.Header = cn.Header;
                 }
                 lmr.Add(ecn);
             }
             DispensaryOne d1 = i as DispensaryOne;
             if (d1 != null)
             {
                 EMKServise.DispensaryOne ed1 = new EMKServise.DispensaryOne();
                 ed1.Attachment = ConvertAttachment(d1.Attachment);
                 ed1.Author     = ConvertMedicalStaff(d1.Author);
                 if (d1.CreationDate != DateTime.MinValue)
                 {
                     ed1.CreationDate = d1.CreationDate;
                 }
                 if (d1.Header != "")
                 {
                     ed1.Header = d1.Header;
                 }
                 ed1.HasExpertCareRefferal    = d1.HasExpertCareRefferal;
                 ed1.HasExtraResearchRefferal = d1.HasExtraResearchRefferal;
                 ed1.HasHealthResortRefferal  = d1.HasHealthResortRefferal;
                 ed1.HasPrescribeCure         = d1.HasPrescribeCure;
                 ed1.HasSecondStageRefferal   = d1.HasSecondStageRefferal;
                 ed1.HealthGroup        = ConvertHealthGroup(d1.HealthGroup);
                 ed1.IsGuested          = d1.IsGuested;
                 ed1.IsUnderObservation = d1.IsUnderObservation;
                 ed1.Recommendations    = ConvertRecommendation(d1.Recommendations);
                 lmr.Add(ed1);
             }
         }
         return(lmr);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 27
0
        public void ChangeUpdateStatCase(string guid, CaseStat cs)
        {
            GUID = guid.ToLower();
            if (cs != null)
            {
                if (cs.DeliveryCode != null)
                {
                    this.caseStat.DeliveryCode = cs.DeliveryCode;
                }
                if (cs.IdIntoxicationType != 0)
                {
                    this.caseStat.IdIntoxicationType = cs.IdIntoxicationType;
                }
                if (cs.IdPatientConditionOnAdmission != 0)
                {
                    this.caseStat.IdPatientConditionOnAdmission = cs.IdPatientConditionOnAdmission;
                }
                if (cs.IdTypeFromDiseaseStart != 0)
                {
                    this.caseStat.IdTypeFromDiseaseStart = cs.IdTypeFromDiseaseStart;
                }
                if (cs.IdTransportIntern != 0)
                {
                    this.caseStat.IdTransportIntern = cs.IdTransportIntern;
                }
                if (cs.IdHospChannel != 0)
                {
                    this.caseStat.IdHospChannel = cs.IdHospChannel;
                }
                this.caseStat.RW1Mark  = cs.RW1Mark;
                this.caseStat.AIDSMark = cs.AIDSMark;
                caseBase.UpdateCaseBase(guid, cs);
                if (cs.MedRecords != null)
                {
                    List <TestMedRecord>    newMedRecords = new List <TestMedRecord>();
                    TestTfomsInfo           tfi           = null;
                    TestClinicMainDiagnosis cmd           = null;
                    TestDischargeSummary    ds            = null;
                    TestConsultNote         cn            = null;
                    TestDeathInfo           tdi           = null;

                    foreach (object i in cs.MedRecords)
                    {
                        Service ser = i as Service;
                        if (ser != null)
                        {
                            newMedRecords.Add(new TestService(ser, cs.IdLpu));
                        }

                        TfomsInfo tf = i as TfomsInfo;
                        if (tf != null)
                        {
                            tfi = new TestTfomsInfo(tf);
                        }

                        Diagnosis diag = i as Diagnosis;
                        if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                        {
                            newMedRecords.Add(new TestDiagnosis(diag, cs.IdLpu));
                        }

                        ClinicMainDiagnosis cd = i as ClinicMainDiagnosis;
                        if ((cd != null) && (cs.HospResult != IdDeath) && (cd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                        {
                            cmd = new TestClinicMainDiagnosis(cd, cs.IdLpu);
                        }

                        ClinicMainDiagnosis ca = i as ClinicMainDiagnosis;
                        if ((ca != null) && (cs.HospResult == IdDeath) && (ca.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                        {
                            cmd = new TestClinicMainDiagnosis(ca, cs.IdLpu);
                        }

                        Referral r = i as Referral;
                        if (r != null)
                        {
                            newMedRecords.Add(new TestReferral(r, cs.IdLpu));
                        }

                        SickList sl = i as SickList;
                        if (sl != null)
                        {
                            newMedRecords.Add(new TestSickList(sl, cs.IdLpu));
                        }

                        DischargeSummary pds = i as DischargeSummary;
                        if (pds != null)
                        {
                            ds = new TestDischargeSummary(pds, cs.IdLpu);
                        }

                        LaboratoryReport lr = i as LaboratoryReport;
                        if (lr != null)
                        {
                            newMedRecords.Add(new TestLaboratoryReport(lr, cs.IdLpu));
                        }

                        ConsultNote pcn = i as ConsultNote;
                        if (pcn != null)
                        {
                            cn = new TestConsultNote(pcn, cs.IdLpu);
                        }

                        AppointedMedication ap = i as AppointedMedication;
                        if (ap != null)
                        {
                            newMedRecords.Add(new TestAppointedMedication(ap, cs.IdLpu));
                        }

                        DeathInfo di = i as DeathInfo;
                        if (di != null)
                        {
                            tdi = new TestDeathInfo(di);
                        }

                        Form027U form = i as Form027U;
                        if (form != null)
                        {
                            newMedRecords.Add(new TestForm027U(form, cs.IdLpu));               //?
                        }
                    }
                    if (Global.GetLength(this.medRecords) != 0)
                    {
                        foreach (object i in this.medRecords)
                        {
                            TestService ser = i as TestService;
                            if (!Global.IsEqual(ser, null))
                            {
                                newMedRecords.Add(ser);
                            }

                            TestTfomsInfo tf = i as TestTfomsInfo;
                            if (!Global.IsEqual(tfi, null) && (!Global.IsEqual(tf, null)))
                            {
                                newMedRecords.Add(tf);
                            }
                            else
                            if (!Global.IsEqual(tfi, null))
                            {
                                newMedRecords.Add(tfi);
                            }

                            TestDiagnosis diag = i as TestDiagnosis;
                            if (!Global.IsEqual(diag, null))
                            {
                                newMedRecords.Add(diag);
                            }

                            TestClinicMainDiagnosis cm = i as TestClinicMainDiagnosis;
                            if (!Global.IsEqual(cmd, null))
                            {
                                newMedRecords.Add(cmd);
                            }
                            else
                            if (!Global.IsEqual(cm, null))
                            {
                                newMedRecords.Add(cm);
                            }

                            TestReferral r = i as TestReferral;
                            if (!Global.IsEqual(r, null))
                            {
                                newMedRecords.Add(r);
                            }

                            TestSickList sl = i as TestSickList;
                            if (!Global.IsEqual(sl, null))
                            {
                                newMedRecords.Add(sl);
                            }

                            TestDischargeSummary pds = i as TestDischargeSummary;
                            if (!Global.IsEqual(ds, null))
                            {
                                newMedRecords.Add(ds);
                            }
                            else
                            if (!Global.IsEqual(pds, null))
                            {
                                newMedRecords.Add(pds);
                            }

                            TestLaboratoryReport lr = i as TestLaboratoryReport;
                            if (!Global.IsEqual(lr, null))
                            {
                                newMedRecords.Add(lr);
                            }

                            TestConsultNote pcn = i as TestConsultNote;
                            if (!Global.IsEqual(cn, null))
                            {
                                newMedRecords.Add(cn);
                            }
                            else
                            if (!Global.IsEqual(pcn, null))
                            {
                                newMedRecords.Add(pcn);
                            }

                            TestAppointedMedication ap = i as TestAppointedMedication;
                            if (!Global.IsEqual(ap, null))
                            {
                                newMedRecords.Add(ap);
                            }

                            TestDeathInfo di = i as TestDeathInfo;
                            if (!Global.IsEqual(tdi, null) && (!Global.IsEqual(di, null)))
                            {
                                newMedRecords.Add(di);
                            }
                            else
                            if (!Global.IsEqual(tdi, null))
                            {
                                newMedRecords.Add(tdi);
                            }

                            TestForm027U form = i as TestForm027U;
                            if (!Global.IsEqual(form, null))
                            {
                                newMedRecords.Add(form);
                            }
                        }
                    }
                    else
                    {
                        if (!Global.IsEqual(tfi, null))
                        {
                            newMedRecords.Add(tfi);
                        }
                        if (!Global.IsEqual(cmd, null))
                        {
                            newMedRecords.Add(cmd);
                        }
                        if (!Global.IsEqual(ds, null))
                        {
                            newMedRecords.Add(ds);
                        }
                        if (!Global.IsEqual(cn, null))
                        {
                            newMedRecords.Add(cn);
                        }
                        if (!Global.IsEqual(tdi, null))
                        {
                            newMedRecords.Add(tdi);
                        }
                    }
                    this.records = newMedRecords;
                }
            }
        }
Exemplo n.º 28
0
 public virtual void OnDeath(DeathInfo deathInfo)
 {
 }
Exemplo n.º 29
0
 public virtual void Die(DeathInfo deathInfo)
 {
     OnDeath(deathInfo);
     deathInfo.location.RemoveOccupant(deathInfo.victim);
     Destroy(gameObject);
 }
Exemplo n.º 30
0
 public override void Death(DeathInfo deathInfo)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 31
0
Arquivo: Unit.cs Projeto: Kinderril/p3
 public void GetHit(float power,WeaponType type,DeathInfo info,float mdef = -1,float pdef = -1)
 {
     LastHitInfo = info;
     if (mdef < 0 || pdef < 0)
     {
         mdef = Parameters[ParamType.MDef];
         pdef = Parameters[ParamType.PDef];
     }
     switch (type)
     {
         case WeaponType.magic:
             power *= Formuls.calcResist(mdef);
             break;
         case WeaponType.physics:
             power *= Formuls.calcResist(pdef);
             break;
     }
     power = GreatRandom.RandomizeValue(power);
     if (_shield > 0)
     {
         if (_shield > power)
         {
             _shield -= power;
             return;
         }
         else
         {
             power -= _shield;
             _shield = 0;
             OnShieldOff.Do();
         }
     }
     SetHp(CurHp - power);
     if (this is Hero)
     {
         if (OnGetHit != null)
         {
             OnGetHit(CurHp, Parameters[ParamType.Heath], -power);
         }
     }
 }