public void AddNewHealthInfo() { DeadMedicalInfo deadMedical = new DeadMedicalInfo(); deadMedical.AddNew(); deadMedical.DeadEventID = ParmDeadEventID; deadMedical.CauseOfDeathA = ucItemControlDeathReasonA.SelectedICD; deadMedical.CauseOfDeathAPeriod = ucItemControlDeathReasonA.Days + ucItemControlDeathReasonA.Months + ucItemControlDeathReasonA.Years; deadMedical.CauseOfDeathD = ucItemControlDeathReasonD.SelectedICD; deadMedical.CauseOfDeathDPeriod = ucItemControlDeathReasonD.Days + ucItemControlDeathReasonD.Months + ucItemControlDeathReasonD.Years; deadMedical.CauseOfDeathNotRelatedA = ucItemCauseOfDeathNotRelatedA.SelectedICD; deadMedical.CauseOfDeathNotRelatedAPeriod = ucItemCauseOfDeathNotRelatedA.Days + ucItemCauseOfDeathNotRelatedA.Months + ucItemCauseOfDeathNotRelatedA.Years; deadMedical.CauseOfDeathNotRelatedB = ucItemCauseOfDeathNotRelatedB.SelectedICD; deadMedical.CauseOfDeathNotRelatedBPeriod = ucItemCauseOfDeathNotRelatedB.Days + ucItemCauseOfDeathNotRelatedB.Months + ucItemCauseOfDeathNotRelatedB.Years; deadMedical.IsSmoker = radioListISSmoker.SelectedValue == "1" ? true : false; deadMedical.SmokeType = radioListSmokingType.SelectedValue; deadMedical.SmokePeriod = (txtsmokingPeriod1.Text.Length == 1 ? "0" + txtsmokingPeriod1.Text : txtsmokingPeriod1.Text) + (txtsmokingPeriod2.Text.Length == 1 ? "0" + txtsmokingPeriod2.Text : txtsmokingPeriod2.Text); deadMedical.IsCausedByAccedent = rdCauseByAccedenc.SelectedValue == "1" ? true : false; deadMedical.AccedentCause = int.Parse(drpReason.SelectedValue); deadMedical.AccedentPlace = txtAccidentLocation.Text; deadMedical.AccedentAnotherCause = txtAnotherReason.Text; deadMedical.VehicleType = int.Parse(dropCarType.SelectedValue); deadMedical.VehicleTypeOther = txtCarType.Text; deadMedical.DeadStatus = int.Parse(RdDeadPersonType.SelectedValue); deadMedical.HasTumor = rdTumorFlag.SelectedValue == "1" ? true : false; deadMedical.PlaceOfTumor = txtTumorLocation.Text; deadMedical.TypeOfTumor = int.Parse(dropTumorType.SelectedValue); deadMedical.PhaseOfTumor = int.Parse(dropTumorPhases.SelectedValue); deadMedical.DeadThroghCarry = rdDeathThroughCarry.SelectedValue == "1" ? true : false; deadMedical.DeadThroghBirth = rdDeadThroughBirth.SelectedValue == "1" ? true : false; deadMedical.AbortionPast6Weeks = rdAbortionPast6Weeks.SelectedValue == "1" ? true : false; // deadMedical.DeadThroghBirth = rdDeadThroughBirth.SelectedValue == "1" ? true : false; deadMedical.BirthPast6Weeks = rdBirthPast6Weeks.SelectedValue == "1" ? true : false; DateTime testInputDate; if (DateTime.TryParse(txtDate.Text, out testInputDate)) { IFormatProvider culture = new CultureInfo("en-US", true); deadMedical.BirthDate = DateTime.ParseExact(txtDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); } deadMedical.BirthResult = int.Parse(dropBirthOuput.SelectedValue); deadMedical.BirthPlace = txtBirthLocation.Text; deadMedical.BirthOperator = txtBirthOperator.Text; deadMedical.Save(); // update Dead record to indecate about medical info completion. Dead dead = new Dead(); dead.LoadByPrimaryKey(ParmDeadEventID); dead.HasHealthData = true; dead.Save(); }
private void LoadData() { DecisionControl1.HealthOffice = "المعادي"; if (DeadEventIDParameter != null) { Dead objDead = new Dead(); objDead.LoadByPrimaryKey(DeadEventIDParameter.Value); UcDeathInfo2.ShowHideNID(objDead.DeadNationality == 13818); UcDeathInfo2.EventDeadNID = objDead.DeadNID; UcDeathInfo2.EventDeadGender = objDead.DeadGender; UcDeathInfo2.EventDeadFristName = objDead.DeadFirstName; UcDeathInfo2.EventDeadFatherName = objDead.DeadFatherName; UcDeathInfo2.EventDeadFamilyName = objDead.DeadGrandName; UcDeathInfo2.EventDeadTitle = objDead.DeadFamilyName; UcDeathInfo2.EventDeadNationality = objDead.DeadNationality; UcDeathInfo2.EventDeadReligion = objDead.DeadReligion; UcDeathInfo2.EventDeadMartialStatus = objDead.DeadMartialStatus; UcDeathInfo2.EventDeadCardNo = objDead.PaperID; UcDeathInfo2.EventDeadCardType = objDead.PaperIDType; UcDeathInfo2.EventCardLocation = objDead.PaperIssuePlace; UcDeathInfo2.ProveType = objDead.ProveText; UcDeathInfo2.ProveNo = objDead.ProveNumber; UcDeathInfo2.EventDeadBirthDate = objDead.DeadBirthDate.ToShortDateString(); UcAddressInfo1.EventDeadAddressNo = objDead.AddressNo; UcAddressInfo1.EventDeadAddressStreet = objDead.AddressStreet; UcAddressInfo1.EventDeadAddressSign = objDead.AddressFeatured; UcAddressInfo1.DeadAddressGovernate = objDead.DeadGovernorate; UcAddressInfo1.LoadPoliceStation(); UcAddressInfo1.DeadAddressPoliceStation = objDead.DeadSection; UcAddressInfo1.LoadArea(); UcAddressInfo1.DeadAddressArea = objDead.DeadArea; UcAddressInfo1.EventDeadAddressPhone = objDead.DeadPhone; UcAddressInfo1.EventDeadAddressJob = objDead.DeadJob; UcGeneralDeathInfo1.EventDeadDieDate = objDead.DeadDieDate.ToShortDateString(); UcGeneralDeathInfo1.EventDeadPlace = objDead.DiePlace; UcGeneralDeathInfo1.EventDeadPlaceDescription = objDead.DiePlaceDescription; UcGeneralDeathInfo1.EventDeadDieHour = objDead.DeadDieHour; UcGeneralDeathInfo1.EventDeadDieMin = objDead.DeadDieMin; //objDead.DieGovernorate = -- ToDO //objDead.DieSection = --ToDo //objDead.DieArea = --ToDo UcMotherInfo2.ParentNID = objDead.DeadMotherNID; UcMotherInfo2.ParentNationality = objDead.DeadMotherNationality; UcMotherInfo2.ParentFirstName = objDead.DeadMotherFirstName; UcMotherInfo2.ParentFatherName = objDead.DeadMotherSecondName; UcMotherInfo2.ParentFamilyName = objDead.DeadMotherFamilyName; //UcMotherInfo2.ParentSureName = objDead.deadmo UcMotherInfo2.ParentRelegion = objDead.DeadMotherReligion; UcMotherInfo2.ParentJob = objDead.DeadMotherJob; UcNotifierInfo2.NotifierRelation = objDead.InformerRelation; UcNotifierInfo2.NotifierphoneNo = objDead.InformerPhone; UcNotifierInfo2.NotifierNID = objDead.InformerNID; UcNotifierInfo2.NotifierFName = objDead.InformerFirstName; UcNotifierInfo2.NotifierFatherName = objDead.InformerSecondName; UcMotherInfo2.ParentSureName = objDead.DaadMotherSureName; //objDead.InformerAddress = UcNotifierInfo2. drpRegestierNoList.Value = objDead.RegisterID.ToString(); ManualRegister obj = new ManualRegister(); obj.LoadByPrimaryKey(new Guid(objDead.RegisterID.ToString())); txtRegestierNoList.Text = obj.RegisterCode; txtRecordNumber.Text = objDead.RegisterNo.ToString(); if (IsLostCase) { if (objDead.IsUnKown) { rdTypeList.ClearSelection(); rdTypeList.Items.FindByValue("1").Selected = true; } DecisionControl1.NotesValue = objDead.DeadDecisionNotes; DecisionControl1.DecisionDate = objDead.DeadDecisionDate; DecisionControl1.DecisionDirectionValue = objDead.DeadDecisionDirection; DecisionControl1.DecisionNumber = objDead.DeadDecisionNo; if (rdTypeList.SelectedValue == "1") { DecisionControl1.lblDecisionDirector = "نيابة"; } } } }
public void FemalDefaultCheck() { try { Dead objDead = new Dead(); objDead.LoadByPrimaryKey(ParmDeadEventID); TimeSpan span = objDead.DeadDieDate.Subtract(objDead.DeadBirthDate); //check if the dead age was between 15 and 45 years & the dead is femal. if ((span.Days >= 5475 && span.Days <= 17885) && objDead.DeadGender == 2) { TabPanelGirlsData.Enabled = true; } else { TabPanelGirlsData.Enabled = false; } } catch { TabPanelGirlsData.Enabled = false; } }
public static void WriteQrsDead(Guid DeadEventID) { Dead deadCase = new Dead(); deadCase.LoadByPrimaryKey(DeadEventID); MHO.BLL.AREA area = new AREA(); area.LoadByPrimaryKey(deadCase.DeadArea); MHO.BLL.POLICE_STATION ps = new POLICE_STATION(); ps.LoadByPrimaryKey(deadCase.DeadSection); MHO.BLL.health_office ho = new health_office(); ho.LoadByPrimaryKey(deadCase.OrgID); NATIONALITY MotherNath = new NATIONALITY(); MotherNath.LoadByPrimaryKey(deadCase.DeadMotherNationality); string gender = (deadCase.DeadGender == 1) ? "ذكر " : "أنثى"; string deadMartialStatus = "اعزب", deadReligion = "مسلم", motherReligion = "مسلم", InformRelation = "الأب"; switch (deadCase.DeadMartialStatus) { case 1: deadMartialStatus = "اعزب"; break; case 2: deadMartialStatus = "متزوج"; break; case 3: deadMartialStatus = "مطلق"; break; case 4: deadMartialStatus = "أرمل"; break; } switch (deadCase.DeadMotherReligion) { case 1: motherReligion = "مسلم"; break; case 2: motherReligion = "مسيحى"; break; case 3: motherReligion = "يهودى"; break; } switch (deadCase.DeadReligion) { case 1: deadReligion = "مسلم"; break; case 2: deadReligion = "مسيحى"; break; case 3: deadReligion = "يهودى"; break; } switch (deadCase.InformerRelation) { case 1: InformRelation = "الاب"; break; case 2: InformRelation = "الام"; break; case 3: InformRelation = "الاخ"; break; case 4: InformRelation = "الاخت"; break; case 5: InformRelation = "العم"; break; case 6: InformRelation = "الخال"; break; case 7: InformRelation = "الجد"; break; case 8: InformRelation = "اخري"; break; case 9: InformRelation = "الابن"; break; case 10: InformRelation = "الابنة"; break; } if (deadCase.RowCount > 0) { QrEncoder encoder = new QrEncoder(ErrorCorrectionLevel.M); QrCode qrCode; StringBuilder builder = new StringBuilder(); builder.AppendLine(deadCase.DeadNID); builder.AppendLine("," + deadCase.DeadFirstName + " " + deadCase.DeadFatherName + " " + deadCase.DeadGrandName + " " + deadCase.DeadFamilyName); builder.AppendLine("," + deadCase.DeadBirthDate.ToShortDateString()); builder.AppendLine("," + deadReligion); builder.AppendLine("," + deadMartialStatus); builder.AppendLine("," + gender); builder.AppendLine("," + deadCase.AddressNo + "," + deadCase.AddressStreet + "," + deadCase.AddressFeatured); builder.AppendLine("," + ps.DESCR); builder.AppendLine("," + area.DESCR); builder.AppendLine("," + deadCase.DeadDieDate.ToShortDateString() + " - " + deadCase.DeadDieHour + ":" + deadCase.DeadDieMin); builder.AppendLine("," + deadCase.DiePlace + "," + deadCase.DiePlaceDescription); builder.AppendLine("," + deadCase.DeadMotherFirstName + " " + deadCase.DeadMotherSecondName + " " + deadCase.DeadMotherFamilyName + " " + deadCase.DaadMotherSureName); builder.AppendLine("," + MotherNath.DESCR); builder.AppendLine("," + motherReligion); builder.AppendLine("," + deadCase.DeadMotherJob); builder.AppendLine("," + deadCase.DeadMotherNID); builder.AppendLine("," + deadCase.InformerFirstName + " " + deadCase.InformerSecondName); builder.AppendLine("," + InformRelation); builder.AppendLine("," + deadCase.InformerNID); builder.AppendLine("," + deadCase.InformerPhone); encoder.TryEncode(builder.ToString(), out qrCode); GraphicsRenderer gRenderer = new GraphicsRenderer( new FixedModuleSize(2, QuietZoneModules.Zero), Brushes.Black, Brushes.White); MemoryStream ms = new MemoryStream(); gRenderer.WriteToStream(qrCode.Matrix, ImageFormat.Bmp, ms); try { SqlCommand cmd = new SqlCommand(); SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["dbConnection"].ToString()); cmd.CommandText = "insert into QRSDead (ID,QrCode) values (@ID,@Picture)"; cmd.Parameters.Add("@ID", System.Data.SqlDbType.UniqueIdentifier); cmd.Parameters.Add("@Picture", System.Data.SqlDbType.VarBinary); cmd.Connection = conn; cmd.Parameters["@ID"].Value = DeadEventID; cmd.Parameters["@Picture"].Value = ms.ToArray(); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } catch (Exception ex) { } } }
protected void btnSearch_Click(object sender, EventArgs e) { lblSelectedICD.Text = ""; int gender = 0; Guid eventid = new Guid(Request.QueryString["DeadEventID"].ToString()); Dead dead = new Dead(); dead.LoadByPrimaryKey(eventid); if (dead.DeadGender == 1) gender = 2; else gender = 1; //ICDCODE9000 objICD = new ICDCODE9000(); ICD10_MainDeathReason objICD = new ICD10_MainDeathReason(); if (txtSearch.Text != "") { DataTable dt = objICD.FilterICDcodes(txtSearch.Text.Trim(), gender); if (dt.Rows.Count > 0) { dropItem.DataSource = dt.DefaultView; //dropItem.DataTextField = ICDCODE9000.ColumnNames.DESCRENG; //dropItem.DataValueField = ICDCODE9000.ColumnNames.CODE; dropItem.DataTextField = ICD10_MainDeathReason.ColumnNames.Causename; dropItem.DataValueField = ICD10_MainDeathReason.ColumnNames.Code; dropItem.DataBind(); ListItem item = new ListItem(" ", "0"); dropItem.Items.Insert(0, item); dropItem.SelectedIndex = 0; } else { dropItem.Items.Clear(); dropItem.DataSource = null; dropItem.DataBind(); } } else { dropItem.Items.Clear(); dropItem.DataSource = null; dropItem.DataBind(); } }