public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as FamilyMemberHistory;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Identifier != null)
            {
                dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
            }
            if (Patient != null)
            {
                dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
            }
            if (DateElement != null)
            {
                dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.FamilyMemberHistory.FamilyHistoryStatus>)StatusElement.DeepCopy();
            }
            if (NameElement != null)
            {
                dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
            }
            if (Relationship != null)
            {
                dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy();
            }
            if (GenderElement != null)
            {
                dest.GenderElement = (Code <Hl7.Fhir.Model.AdministrativeGender>)GenderElement.DeepCopy();
            }
            if (Born != null)
            {
                dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopy();
            }
            if (Age != null)
            {
                dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy();
            }
            if (Deceased != null)
            {
                dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy();
            }
            if (Note != null)
            {
                dest.Note = (Hl7.Fhir.Model.Annotation)Note.DeepCopy();
            }
            if (Condition != null)
            {
                dest.Condition = new List <Hl7.Fhir.Model.FamilyMemberHistory.ConditionComponent>(Condition.DeepCopy());
            }
            return(dest);
        }
    public override IDeepCopyable CopyTo(IDeepCopyable other)
    {
      var dest = other as FamilyMemberHistory;

      if (dest == null)
      {
        throw new ArgumentException("Can only copy to an object of the same type", "other");
      }

      base.CopyTo(dest);
      if(Identifier != null) dest.Identifier = new List<Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
      if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = new List<Hl7.Fhir.Model.Canonical>(InstantiatesCanonicalElement.DeepCopy());
      if(InstantiatesUriElement != null) dest.InstantiatesUriElement = new List<Hl7.Fhir.Model.FhirUri>(InstantiatesUriElement.DeepCopy());
      if(StatusElement != null) dest.StatusElement = (Code<Hl7.Fhir.Model.FamilyMemberHistory.FamilyHistoryStatus>)StatusElement.DeepCopy();
      if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy();
      if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
      if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
      if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
      if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy();
      if(Sex != null) dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopy();
      if(Born != null) dest.Born = (Hl7.Fhir.Model.Element)Born.DeepCopy();
      if(Age != null) dest.Age = (Hl7.Fhir.Model.Element)Age.DeepCopy();
      if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopy();
      if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.Element)Deceased.DeepCopy();
      if(ReasonCode != null) dest.ReasonCode = new List<Hl7.Fhir.Model.CodeableConcept>(ReasonCode.DeepCopy());
      if(ReasonReference != null) dest.ReasonReference = new List<Hl7.Fhir.Model.ResourceReference>(ReasonReference.DeepCopy());
      if(Note != null) dest.Note = new List<Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
      if(Condition != null) dest.Condition = new List<Hl7.Fhir.Model.FamilyMemberHistory.ConditionComponent>(Condition.DeepCopy());
      return dest;
    }
Exemple #3
0
 public IActionResult PublishMessage([FromBody] Born born)
 {
     try
     {
         _service.SendMessage(born);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
 public override int GetHashCode()
 {
     // overflow is fine
     unchecked
     {
         int hash = 17;
         // test data should never be null
         hash = hash * 23 + FirstName.GetHashCode();
         hash = hash * 23 + LastName.GetHashCode();
         hash = hash * 23 + Born.GetHashCode();
         return(hash);
     }
 }
Exemple #5
0
 private void Recover()
 {
     if (lifeValue <= 0)
     {
         //Game over
         isDefeated = true;
     }
     else
     {
         lifeValue--;
         Born _bornClone = Instantiate(born, new Vector3(-2, -8, 0), Quaternion.identity);
         _bornClone.createPlayer = true;
         isDead = false;
     }
 }
Exemple #6
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as FamilyHistoryRelationComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (NameElement != null)
                    {
                        dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
                    }
                    if (Relationship != null)
                    {
                        dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy();
                    }
                    if (Born != null)
                    {
                        dest.Born = (Hl7.Fhir.Model.Element)Born.DeepCopy();
                    }
                    if (Deceased != null)
                    {
                        dest.Deceased = (Hl7.Fhir.Model.Element)Deceased.DeepCopy();
                    }
                    if (NoteElement != null)
                    {
                        dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy();
                    }
                    if (Condition != null)
                    {
                        dest.Condition = new List <Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationConditionComponent>(Condition.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + Culture.GetHashCode();
            hash = hash * 23 + Titles.GetHashCode();
            hash = hash * 23 + OtherTitles.GetHashCode();
            hash = hash * 23 + Aliases.GetHashCode();
            hash = hash * 23 + Born.GetHashCode();
            hash = hash * 23 + Died.GetHashCode();
            hash = hash * 23 + Father.GetHashCode();
            hash = hash * 23 + Mother.GetHashCode();
            hash = hash * 23 + Spouse.GetHashCode();
            hash = hash * 23 + Children.GetHashCode();
            hash = hash * 23 + Allegiances.GetHashCode();
            hash = hash * 23 + Books.GetHashCode();
            hash = hash * 23 + PovBooks.GetHashCode();
            hash = hash * 23 + PlayedBy.GetHashCode();
            hash = hash * 23 + TvSeries.GetHashCode();

            return(hash);
        }
    private void Filter()
    {
        Born objBorn = new Born();
        int regnoValue;
        if (txtRegNo.Text == "")
            regnoValue = 0;
        else
            regnoValue = int.Parse(txtRegNo.Text);

        DataTable res =
        objBorn.FilterBorns(MHOCommon.ConnString, MHOCommon.CurrentOrgID.Value, txtFatherNID.Text, ""
                            , txtInformerNID.Text,
                            new Guid(drpRegestierNoList.SelectedValue), regnoValue,txtDateFrom.Text,txtDateTo.Text);

            grdBorns.DataSource = res.DefaultView;
            grdBorns.DataBind();
    }
 private void LoadGridData()
 {
     Born objBorn = new Born();
     grdListBornCityVillage.DataSource = objBorn.ListBornCityVillage(StarDate, EndDate);
     grdListBornCityVillage.DataBind();
 }
            public override bool Equals(Object obj)
            {
                Person person = obj as Person;

                if (person == null)
                {
                    return(false);
                }

                return(FirstName.Equals(person.FirstName) && LastName.Equals(person.LastName) && Born.Equals(person.Born));
            }
    /// <summary>
    /// Handles the Click event of the control btnSaveBornInfo
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSaveMedicalInfo_Click(object sender, EventArgs e)
    {
        if (ViewState["MedicalInfoUpdate"] != null && ViewState["MedicalInfoUpdate"].ToString() == "1")
        {
            UpdateBornMedicalInfo();
        }
        else
        {
            InsertBornMedicalInfo();

        }
        Born objBorn = new Born();
        objBorn.UpdateBornWriter(MHOCommon.CurrentLoggedUserID, BornEventIdParameter.Value);
        Response.Redirect("BornResult.aspx?Birth=1&BornEventIdParameter=" + BornEventIdParameter.ToString());
    }
 protected void btnApprove_Click(object sender, EventArgs e)
 {
     Born born = new Born();
     if (born.ApproveBornInfo(BornEventIdParameter.Value))
     {
         Response.Redirect("BornResult.aspx?ApproveBirth=1");
     }
     else
     {
         MHOCommon.ShowMessage("عفوا هناك خطا فى البيانات", this.Page);
     }
 }
Exemple #13
0
    public static void WriteQrsBorn(Guid BornEventID)
    {
        Born bornCase = new Born();
        bornCase.LoadByPrimaryKey(BornEventID);
        MHO.BLL.AREA area = new AREA();
        area.LoadByPrimaryKey(bornCase.BornArea);
        MHO.BLL.POLICE_STATION ps = new POLICE_STATION();
        ps.LoadByPrimaryKey(bornCase.BornSection);
        MHO.BLL.health_office ho = new health_office();
        ho.LoadByPrimaryKey(bornCase.OrgID);
        NATIONALITY FatherNath = new NATIONALITY();
        FatherNath.LoadByPrimaryKey(bornCase.FatherNationality);
        NATIONALITY MotherNath = new NATIONALITY();
        MotherNath.LoadByPrimaryKey(bornCase.MotherNationality);
        string gender = (bornCase.BornGender == 1) ? "ذكر " : "أنثى";
        string fatherReligion = "مسلم", motherReligion = "مسلم", InformRelation = "الأب";
        switch (bornCase.FatherReligion)
        {
            case 1:
                fatherReligion = "مسلم";
                break;
            case 2:
                fatherReligion = "مسيحى";
                break;
            case 3:
                fatherReligion = "يهودى";
                break;

        }

        switch (bornCase.MotherReligion)
        {
            case 1:
                motherReligion = "مسلم";
                break;
            case 2:
                motherReligion = "مسيحى";
                break;
            case 3:
                motherReligion = "يهودى";
                break;
        }

        switch (bornCase.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 (bornCase.RowCount > 0)
        {
            QrEncoder encoder = new QrEncoder(ErrorCorrectionLevel.M);
            QrCode qrCode;
            StringBuilder builder = new StringBuilder();

            builder.AppendLine(bornCase.BornName + " " + bornCase.FirstFatherName + " " + bornCase.SecondFatherName + " " + bornCase.FatherSureName);
            builder.AppendLine("," + ps.DESCR);
            builder.AppendLine("," + area.DESCR);
            builder.AppendLine("," + gender);
            builder.AppendLine("," + bornCase.BirthDate.ToShortDateString() + " " + bornCase.BirthDate.Minute.ToString() + ":" + bornCase.BirthDate.Hour.ToString());
            builder.AppendLine("," + bornCase.FirstFatherName + " " + bornCase.SecondFatherName + " " + bornCase.FamilyFatherName + " " + bornCase.FatherSureName);
            builder.AppendLine("," + FatherNath.DESCR);
            builder.AppendLine("," + fatherReligion);
            builder.AppendLine(",");
            builder.AppendLine("," + bornCase.FatherJob);
            builder.AppendLine("," + bornCase.FatherNID);
            builder.AppendLine("," + bornCase.FirstMotherName + " " + bornCase.SecondMotherName + " " + bornCase.FamilyMotherName + " " + bornCase.MotherSureName);
            builder.AppendLine("," + MotherNath.DESCR);
            builder.AppendLine("," + motherReligion);
            builder.AppendLine(",");
            builder.AppendLine("," + bornCase.MotherJob);
            builder.AppendLine("," + bornCase.MotherNID);
            builder.AppendLine("," + bornCase.InformerFirstName + " " + bornCase.InformerSecondName);
            builder.AppendLine("," + InformRelation);
            builder.AppendLine("," + bornCase.InformerNID);
            builder.AppendLine("," + bornCase.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 QRSBorn (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 = BornEventID;
                cmd.Parameters["@Picture"].Value = ms.ToArray();

                conn.Open();
                cmd.ExecuteNonQuery();
                conn.Close();
            }
            catch (Exception ex)
            {

            }

        }
    }
 private void LoadGridData()
 {
     Born objborn = new Born();
         grdListBornMailFemaleLostCount.DataSource = objborn.ListBornMailFemaleLostCount(StarDate, EndDate);
         grdListBornMailFemaleLostCount.DataBind();
 }
    private bool logicValidation()
    {
        if (UcFatherInfo2.ParentNID == "0")
        {
            MHOCommon.ShowMessage("الرقم القومى للأب غير صحيح", this.Page);
            return false;
        }

        if (UcNotifierInfo1.NotifierNID == "0")
        {
            MHOCommon.ShowMessage("الرقم القومى للمبلغ غير صحيح", this.Page);
            return false;
        }
           if (!MHOCommon.ValidateNationalIDInput(UcFatherInfo2.ParentNID, false))
        {
            MHOCommon.ShowMessage(MHOCommon.NIDValidationMessage + "\\nبيانات الأب", this.Page);
            return false;
        }

        if (!MHOCommon.ValidateNationalIDInput(UcMotherInfo2.ParentNID, true))
        {
            MHOCommon.ShowMessage(MHOCommon.NIDValidationMessage + "\\nبيانات الأم", this.Page);
            return false;
        }

        if (UcMotherInfo2.ParentNID == "0")
        {
            MHOCommon.ShowMessage("الرقم القومى للأم غير صحيح", this.Page);
            return false;
        }

        if (UcBornInfo1.EventBirthDate == null)
        {
            MHOCommon.ShowMessage("خطأ فى تاريخ او وقت الميلاد", this.Page);
            return false;
        }

        if ((UcFatherInfo2.ParentNID == UcNotifierInfo1.NotifierNID) && UcNotifierInfo1.NotifierRelation != 1)
        {
            MHOCommon.ShowMessage("لقد ادخلت الرقم القومى للاب فى بيانات المبلغ فى حين ان المبلغ ليس الاب", this.Page);
            return false;
        }

        if ((UcMotherInfo2.ParentNID == UcNotifierInfo1.NotifierNID) && UcNotifierInfo1.NotifierRelation != 2)
        {
            MHOCommon.ShowMessage("لقد ادخلت الرقم القومى للأم فى بيانات المبلغ فى حين ان المبلغ ليس الأم", this.Page);
            return false;
        }

        if (UcMotherInfo2.ParentNID == UcFatherInfo2.ParentNID)
        {
            MHOCommon.ShowMessage("خطأ . الرقم القومى للأب والأم متطابقين", this.Page);
            return false;
        }

        #region Check For Repeated Birth cases.

        Born objBorn = new Born();

        if (BornEventIdParameter != null)
        {
            // Update case.
            if (UcBornInfo1.EventBirthDate.ToString() != currentBornData.BirthDateTime ||
                UcBornInfo1.EventChildName != currentBornData.BornName ||
                UcFatherInfo2.ParentNID != currentBornData.FatherNationalID ||
                UcMotherInfo2.ParentNID != currentBornData.MotherNationalID)
            {
                if (objBorn.IsBornCaseExist(UcFatherInfo2.ParentNID, UcMotherInfo2.ParentNID, UcBornInfo1.EventChildName, UcBornInfo1.EventBirthDate.Value.ToString("yyyy-MM-dd HH:mm"), Convert.ToDateTime(currentBornData.BornRegDate).ToString("yyyy-MM-dd")))
                {
                    MHOCommon.ShowMessage("بيانات المولود موجودة من قبل برجاء مراجعة البيانات و اعادة المحاولة", this.Page);
                    return false;
                }
            }

        }
        else
        {
            // Add Case
            if (objBorn.IsBornCaseExist(UcFatherInfo2.ParentNID, UcMotherInfo2.ParentNID, UcBornInfo1.EventChildName, UcBornInfo1.EventBirthDate.Value.ToString("yyyy-MM-dd HH:mm"), ""))
            {
                MHOCommon.ShowMessage("بيانات المولود موجودة من قبل برجاء مراجعة البيانات و اعادة المحاولة", this.Page);
                return false;
            }
        }

        #endregion

        if (!IsLostCase)
        {
            if (UcBornInfo1.EventBirthDate.Value.Date > DateTime.Today.Date)
            {
                MHOCommon.ShowMessage("تاريخ الميلاد يجب ان يكون اقل من او يساوى تاريخ اليوم", this.Page);
                return false;
            }

            if (DateTime.Today.AddDays(-15) >= UcBornInfo1.EventBirthDate)
            {
                MHOCommon.ShowMessage("تاريخ تسجيل الميلاد يجب ان لا يزيد عن 15 يوم من تاريخ الميلاد", this.Page);
                return false;
            }
        }
        if (IsLostCase)
        {
            if (DecisionControl1.DecisionDate == null)
            {
                MHOCommon.ShowMessage("تاريخ القرار غير صحيح", this.Page);
                return false;
            }

            health_office objHealthOffice = new health_office();

                if (BornEventIdParameter != null)
                {
                    // update case
                    if (currentDescisionNo != DecisionControl1.DecisionNumber)
                    {
                        if (objHealthOffice.IsDecisionNumberExisit(DecisionControl1.DecisionNumber,MHOCommon.CurrentOrgID.Value, true))
                        {
                            MHOCommon.ShowMessage("عفوا رقم القرار موجود من قبل", this.Page);
                            return false;
                        }
                    }
                }
                else
                {
                    if (objHealthOffice.IsDecisionNumberExisit(DecisionControl1.DecisionNumber, MHOCommon.CurrentOrgID.Value, true))
                   {
                    MHOCommon.ShowMessage("عفوا رقم القرار موجود من قبل", this.Page);
                    return false;
                    }
                }

            if (rdTypeList.SelectedValue != "1")
            {
                if (UcBornInfo1.EventBirthDate.Value.Date > DateTime.Today.Date)
                {
                    MHOCommon.ShowMessage("تاريخ الميلاد يجب ان يكون اقل من او يساوى تاريخ اليوم", this.Page);
                    return false;
                }
                if (DateTime.Today.AddYears(-1).Date > UcBornInfo1.EventBirthDate.Value.Date)
                {
                    MHOCommon.ShowMessage("تاريخ تسجيل الميلاد غير صحيح", this.Page);
                    return false;
                }

                if (DateTime.Today.AddDays(-15).Date <= UcBornInfo1.EventBirthDate.Value.Date)
                {
                    MHOCommon.ShowMessage("تاريخ تسجيل الميلاد غير صحيح", this.Page);
                    return false;
                }
                if (DecisionControl1.DecisionDate.Value.Date > DateTime.Today.Date)
                {
                    MHOCommon.ShowMessage("تاريخ القرار غير صحيح", this.Page);
                    return false;
                }
                //TimeSpan dateDiff = UcBornInfo1.EventBirthDate.Subtract(DecisionControl1.DecisionDate);
                //if (dateDiff.Days < 15)
                if (DecisionControl1.DecisionDate.Value.AddDays(-15).Date < UcBornInfo1.EventBirthDate.Value.Date)
                {
                    MHOCommon.ShowMessage("تاريخ القرار غير صحيح", this.Page);
                    return false;
                }

            }
            else
            {
                if (DecisionControl1.DecisionDate == null)
                {
                    MHOCommon.ShowMessage("تاريخ القرار غير صحيح", this.Page);
                    return false;
                }
                if (UcBornInfo1.EventBirthDate.Value.Date > DateTime.Today.Date)
                {
                    MHOCommon.ShowMessage("تاريخ الميلاد يجب ان يكون اقل من او يساوى تاريخ اليوم", this.Page);
                    return false;
                }
                TimeSpan dateDiff = UcBornInfo1.EventBirthDate.Value.Subtract(DecisionControl1.DecisionDate.Value);
                if (dateDiff.Days > 0)
                {
                    MHOCommon.ShowMessage("تاريخ القرار غير صحيح", this.Page);
                    return false;
                }
                if (DecisionControl1.DecisionDate.Value.Date > DateTime.Today.Date)
                {
                    MHOCommon.ShowMessage("تاريخ القرار غير صحيح", this.Page);
                    return false;
                }
            }
        }
        return true;
    }
 private void InsertEventData()
 {
     Born objBorn = new Born();
     if (IsLostCase)
     {
         BornEventIdParameter = objBorn.AddNewEventBorn(MHOCommon.CurrentOrgID.Value, UcBornInfo1.EventChildName, UcBornInfo1.EventChildGender, UcBornInfo1.EventBirthDate.Value,
                                                       UcBornInfo1.EventChildGovernate, UcBornInfo1.EventChildPoliceStation, UcBornInfo1.EventChildArea,
                                                       UcFatherInfo2.ParentNID, UcFatherInfo2.ParentFirstName, UcFatherInfo2.ParentFatherName,
                                                       UcFatherInfo2.ParentFamilyName, UcFatherInfo2.ParentJob, UcFatherInfo2.ParentRelegion, UcFatherInfo2.ParentNationality,
                                                       UcMotherInfo2.ParentNID, UcMotherInfo2.ParentFirstName, UcMotherInfo2.ParentFatherName, UcMotherInfo2.ParentFamilyName,
                                                       UcMotherInfo2.ParentJob, UcMotherInfo2.ParentRelegion, UcMotherInfo2.ParentNationality,
                                                       UcNotifierInfo1.NotifierRelation, UcNotifierInfo1.NotifierFName, UcNotifierInfo1.NotifierFatherName, UcNotifierInfo1.NotifierphoneNo,
                                                       UcNotifierInfo1.NotifierNID,
                                                       new Guid(drpRegestierNoList.Value),
                                                       int.Parse(txtRecordNumber.Text),
                                                       UcFatherInfo2.ProveNo, UcFatherInfo2.ProveType,
                                                       UcMotherInfo2.ProveNo, UcMotherInfo2.ProveType,
                                                       UcMotherInfo2.ParentSureName, UcFatherInfo2.ParentSureName, DecisionControl1.DecisionNumber
                                                       , DecisionControl1.DecisionDirectionValue, DecisionControl1.DecisionDate.Value.ToShortDateString(), DecisionControl1.NotesValue,
         rdTypeList.SelectedValue=="1"?true:false,UcNotifierInfo1.NotifierAddress);
     }
     else
     {
         BornEventIdParameter = objBorn.AddNewEventBorn(MHOCommon.CurrentOrgID.Value, UcBornInfo1.EventChildName, UcBornInfo1.EventChildGender, UcBornInfo1.EventBirthDate.Value,
                                                       UcBornInfo1.EventChildGovernate, UcBornInfo1.EventChildPoliceStation, UcBornInfo1.EventChildArea,
                                                       UcFatherInfo2.ParentNID, UcFatherInfo2.ParentFirstName, UcFatherInfo2.ParentFatherName,
                                                       UcFatherInfo2.ParentFamilyName, UcFatherInfo2.ParentJob, UcFatherInfo2.ParentRelegion, UcFatherInfo2.ParentNationality,
                                                       UcMotherInfo2.ParentNID, UcMotherInfo2.ParentFirstName, UcMotherInfo2.ParentFatherName, UcMotherInfo2.ParentFamilyName,
                                                       UcMotherInfo2.ParentJob, UcMotherInfo2.ParentRelegion, UcMotherInfo2.ParentNationality,
                                                       UcNotifierInfo1.NotifierRelation, UcNotifierInfo1.NotifierFName, UcNotifierInfo1.NotifierFatherName, UcNotifierInfo1.NotifierphoneNo,
                                                       UcNotifierInfo1.NotifierNID,
                                                       new Guid(drpRegestierNoList.Value),
                                                       int.Parse(txtRecordNumber.Text),
                                                       UcFatherInfo2.ProveNo, UcFatherInfo2.ProveType,
                                                       UcMotherInfo2.ProveNo, UcMotherInfo2.ProveType,
                                                       UcMotherInfo2.ParentSureName, UcFatherInfo2.ParentSureName, string.Empty
                                                       , string.Empty, string.Empty, string.Empty, false, UcNotifierInfo1.NotifierAddress);
     }
     btnSaveBornInfo.Text = "تعديل بيانات الميلاد";
     TabPanelHealthData.Enabled = true;
     UcNotifierInfo1.NotifierFName = UcNotifierInfo1.NotifierFName;
     UcNotifierInfo1.NotifierFatherName = UcNotifierInfo1.NotifierFatherName;
 }
    /// <summary>
    /// Loads Data For Edit Mode
    /// </summary>
    private void LoadData()
    {
        // set default values
        lblRecordDateValue.Text = DateTime.Now.Date.ToShortDateString();
        lblHealthOfficeValue.Text = MHOCommon.CurrentOrgName;
        DecisionControl1.HealthOffice = "المعادي";
        if (BornEventIdParameter != null)
        {

            Born born = new Born();
            if (born.LoadByPrimaryKey(BornEventIdParameter.Value))
            {
                // load Born Basic Data
                UcBornInfo1.EventChildName = born.BornName;
                UcBornInfo1.EventChildGender = born.BornGender;
                UcBornInfo1.Month = born.BirthDate.Month.ToString();
                UcBornInfo1.Year = born.BirthDate.Year.ToString();
                UcBornInfo1.Day = born.BirthDate.Day.ToString();
                UcBornInfo1.Minute = born.BirthDate.Minute.ToString();
                UcBornInfo1.Hour = born.BirthDate.Hour.ToString();
                UcBornInfo1.EventChildGovernate = born.BornGovernorate;
                UcBornInfo1.LoadPoliceStation();
                UcBornInfo1.EventChildPoliceStation = born.BornSection;
                UcBornInfo1.LoadArea();
                UcBornInfo1.EventChildArea = born.BornArea;
                UcFatherInfo2.ParentNID = born.FatherNID;
                UcFatherInfo2.ParentFirstName = born.FirstFatherName;
                UcFatherInfo2.ParentFatherName = born.SecondFatherName;
                UcFatherInfo2.ParentFamilyName = born.FamilyFatherName;
                UcFatherInfo2.ParentJob = born.FatherJob;
                UcFatherInfo2.ParentRelegion = born.FatherReligion;
                UcFatherInfo2.LoadLookups();
                UcFatherInfo2.ParentNationality = born.FatherNationality;
                UcFatherInfo2.ProveNo = born.FatherProveNo;
                UcFatherInfo2.ProveType = born.FatherProveType;
                UcFatherInfo2.ParentSureName = born.FatherSureName;
                // If the parent was egyptian
                UcFatherInfo2.ShowHideNID(born.FatherNationality == 13818);

                UcMotherInfo2.ParentNID = born.MotherNID;
                UcMotherInfo2.ParentFirstName = born.FirstMotherName;
                UcMotherInfo2.ParentFatherName = born.SecondMotherName;
                UcMotherInfo2.ParentFamilyName = born.FamilyMotherName;
                UcMotherInfo2.ParentJob = born.MotherJob;
                UcMotherInfo2.ParentRelegion = born.MotherReligion;
                UcMotherInfo2.LoadLookups();
                UcMotherInfo2.ParentNationality = born.MotherNationality;
                UcMotherInfo2.ProveNo = born.MotherProveNo;
                UcMotherInfo2.ProveType = born.MotherProveType;
                UcMotherInfo2.ParentSureName = born.MotherSureName;

                // If the parent was egyptian
                UcMotherInfo2.ShowHideNID(born.MotherNationality == 13818);

                UcNotifierInfo1.NotifierRelation = born.InformerRelation;
                UcNotifierInfo1.NotifierFName = born.InformerFirstName;
                UcNotifierInfo1.NotifierFatherName = born.InformerSecondName;
                UcNotifierInfo1.NotifierphoneNo = born.InformerPhone;
                UcNotifierInfo1.NotifierNID = born.InformerNID;
                UcNotifierInfo1.NotifierAddress = born.InformerAddress;
                txtRecordNumber.Text = born.RegisterNo.ToString();
                drpRegestierNoList.Value = born.RegisterID.ToString();
                // Load Register Name
                ManualRegister obj = new ManualRegister();
                obj.LoadByPrimaryKey(new Guid(born.RegisterID.ToString()));
                txtRegestierNoList.Text = obj.RegisterCode;

                if (IsLostCase)
                {
                    if (born.IsFound)
                    {
                        rdTypeList.ClearSelection();
                        rdTypeList.Items.FindByValue("1").Selected = true;
                    }
                    DecisionControl1.NotesValue = born.BornDecisionNotes;
                    DecisionControl1.DecisionDate = born.BornDecisionDate;
                    DecisionControl1.DecisionDirectionValue = born.BornDecisionDirection;
                    DecisionControl1.DecisionNumber = born.BornDecisionNo;
                    if (rdTypeList.SelectedValue == "1")
                    {
                        DecisionControl1.lblDecisionDirector = "نيابة";
                    }
                }
            }

            // Load Medical Data
            BornMedicalInfo objBornMedicalInfo = new BornMedicalInfo();
            objBornMedicalInfo.Where.BornEventID.Value = BornEventIdParameter.Value;
            objBornMedicalInfo.Where.BornEventID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;

            if (objBornMedicalInfo.Query.Load())
            {
                //txtWeight1.Text = objBornMedicalInfo.BornWeightGram.ToString();
                //txtWeight2.Text = objBornMedicalInfo.BornWeightKG.ToString();
                int _bornwieght = 1;
                if (objBornMedicalInfo.BornWeightKG < 1 || objBornMedicalInfo.BornWeightKG > 3)
                {
                    _bornwieght = 1;
                }
                else
                {
                    _bornwieght = objBornMedicalInfo.BornWeightKG;
                }
                drpBornWieght.SelectedIndex = drpBornWieght.Items.IndexOf(drpBornWieght.Items.FindByValue(_bornwieght.ToString()));

                txtBirthLocation.Text = objBornMedicalInfo.BirthPlace;
                txtCurrentInterval2.Text = objBornMedicalInfo.MarriageDurationYears.ToString();
                txtCurrentInterval1.Text = objBornMedicalInfo.MarriageDurationMonth.ToString();
                txtPastInterval2.Text = objBornMedicalInfo.XMarriageDurationYears.ToString();
                txtPastInterval1.Text = objBornMedicalInfo.XMarriageDurationMonth.ToString();
                txtTwinsNo.Text = objBornMedicalInfo.TwinsNo.ToString();
                txtOldBornNo.Text = objBornMedicalInfo.OlderBornNo.ToString();
                txtXOldBornNo.Text = objBornMedicalInfo.XOlderBornNo.ToString();
                txtPastDeadNoOfChildrent.Text = objBornMedicalInfo.DeadBornNo.ToString();
                txtNationalNumber.Text = objBornMedicalInfo.ObstetricsNID;
                txtFirstName.Text = objBornMedicalInfo.ObstetricsFName;
                txtRemainName.Text = objBornMedicalInfo.ObstetricsLName;
                drpRelation.SelectedValue = objBornMedicalInfo.ObstetricsRelation.ToString();
            }
            // default totals
            txtTotal1.Text = (int.Parse(txtTwinsNo.Text) + 1).ToString();
            txtTotal2.Text = (int.Parse(txtOldBornNo.Text) + 1).ToString();
            txtTotal3.Text = (int.Parse(txtXOldBornNo.Text) + 1).ToString();
        }
    }
 private void loadBirthData()
 {
     Born objBorn = new Born();
     grdBorns.DataSource = objBorn.LoadNonApprovedBorns(MHOCommon.CurrentOrgID.Value);
     grdBorns.DataBind();
 }
    private void UpdateEventData()
    {
        if (BornEventIdParameter != null)
        {
            Born objBorn = new Born();
            if (IsLostCase)
            {
                objBorn.UpdateNewEventBorn(BornEventIdParameter.Value, UcBornInfo1.EventChildName, UcBornInfo1.EventChildGender, UcBornInfo1.EventBirthDate.Value,
                      UcBornInfo1.EventChildGovernate, UcBornInfo1.EventChildPoliceStation, UcBornInfo1.EventChildArea,
                      UcFatherInfo2.ParentNID, UcFatherInfo2.ParentFirstName, UcFatherInfo2.ParentFatherName,
                      UcFatherInfo2.ParentFamilyName, UcFatherInfo2.ParentJob, UcFatherInfo2.ParentRelegion, UcFatherInfo2.ParentNationality,
                      UcMotherInfo2.ParentNID, UcMotherInfo2.ParentFirstName, UcMotherInfo2.ParentFatherName, UcMotherInfo2.ParentFamilyName,
                      UcMotherInfo2.ParentJob, UcMotherInfo2.ParentRelegion, UcMotherInfo2.ParentNationality,
                      UcNotifierInfo1.NotifierRelation, UcNotifierInfo1.NotifierFName,
                      UcNotifierInfo1.NotifierFatherName, UcNotifierInfo1.NotifierphoneNo,
                      UcNotifierInfo1.NotifierNID, new Guid(drpRegestierNoList.Value),
                      int.Parse(txtRecordNumber.Text), UcFatherInfo2.ProveNo,
                      UcFatherInfo2.ProveType, UcMotherInfo2.ProveNo, UcMotherInfo2.ProveType,
                      UcMotherInfo2.ParentSureName, UcFatherInfo2.ParentSureName,
                      DecisionControl1.DecisionNumber, DecisionControl1.DecisionDirectionValue, DecisionControl1.DecisionDate.Value.ToShortDateString(), DecisionControl1.NotesValue
                      , rdTypeList.SelectedValue == "1" ? true : false, UcNotifierInfo1.NotifierAddress);
            }
            else
            {
                objBorn.UpdateNewEventBorn(BornEventIdParameter.Value, UcBornInfo1.EventChildName, UcBornInfo1.EventChildGender, UcBornInfo1.EventBirthDate.Value,
                      UcBornInfo1.EventChildGovernate, UcBornInfo1.EventChildPoliceStation, UcBornInfo1.EventChildArea,
                      UcFatherInfo2.ParentNID, UcFatherInfo2.ParentFirstName, UcFatherInfo2.ParentFatherName,
                      UcFatherInfo2.ParentFamilyName, UcFatherInfo2.ParentJob, UcFatherInfo2.ParentRelegion, UcFatherInfo2.ParentNationality,
                      UcMotherInfo2.ParentNID, UcMotherInfo2.ParentFirstName, UcMotherInfo2.ParentFatherName, UcMotherInfo2.ParentFamilyName,
                      UcMotherInfo2.ParentJob, UcMotherInfo2.ParentRelegion, UcMotherInfo2.ParentNationality,
                      UcNotifierInfo1.NotifierRelation, UcNotifierInfo1.NotifierFName,
                      UcNotifierInfo1.NotifierFatherName, UcNotifierInfo1.NotifierphoneNo,
                      UcNotifierInfo1.NotifierNID, new Guid(drpRegestierNoList.Value),
                      int.Parse(txtRecordNumber.Text), UcFatherInfo2.ProveNo,
                      UcFatherInfo2.ProveType, UcMotherInfo2.ProveNo, UcMotherInfo2.ProveType,
                      UcMotherInfo2.ParentSureName, UcFatherInfo2.ParentSureName,
                     string.Empty, string.Empty, string.Empty, string.Empty, false, UcNotifierInfo1.NotifierAddress);
            }

        }
    }
 private void LoadGridData()
 {
     Born objBorn = new Born();
     grdListBornDead.DataSource = objBorn.ListBornDead(StarDate, EndDate);
     grdListBornDead.DataBind();
 }
 private void LoadGridData()
 {
     Born objBorn = new Born();
     grdListBornAprrovedCount.DataSource = objBorn.ListBornAprrovedCount(StarDate, EndDate);
     grdListBornAprrovedCount.DataBind();
 }
 protected void btnApprove_Click(object sender, EventArgs e)
 {
     Born born = new Born();
     if (born.ApproveBornInfo(BornEventIdParameter.Value))
     {
         Born objBorn = new Born();
         objBorn.UpdateBornDoctor(MHOCommon.CurrentLoggedUserID, BornEventIdParameter.Value);
         Response.Redirect("BornResult.aspx?Birth=1&BornEventIdParameter=" + BornEventIdParameter.Value);
     }
     else
     {
         MHOCommon.ShowMessage("عفوا هناك خطا فى البيانات", this.Page);
     }
 }