Ejemplo n.º 1
0
    private void InsertDeathCase()
    {
        Dead objDead = new Dead();
        objDead.AddNew();
        objDead.OrgID = MHOCommon.CurrentOrgID.Value;
        objDead.DeadNID = UcDeathInfo2.EventDeadNID;
        objDead.DeadAge = "2";
        objDead.DeadGender = UcDeathInfo2.EventDeadGender;
        objDead.DeadFirstName = UcDeathInfo2.EventDeadFristName;
        objDead.DeadFatherName = UcDeathInfo2.EventDeadFatherName;
        objDead.DeadGrandName = UcDeathInfo2.EventDeadFamilyName;
        objDead.DeadFamilyName = UcDeathInfo2.EventDeadTitle;
        objDead.DeadNationality = UcDeathInfo2.EventDeadNationality;
        objDead.DeadReligion = UcDeathInfo2.EventDeadReligion;
        objDead.DeadMartialStatus = UcDeathInfo2.EventDeadMartialStatus;
        objDead.ProveText = UcDeathInfo2.ProveType;
        objDead.ProveNumber = UcDeathInfo2.ProveNo;
        objDead.IsUnKown = false;
        if (IsLostCase)
        {
            if (DecisionControl1.DecisionNumber != string.Empty)
            {
                objDead.DeadDecisionNo = DecisionControl1.DecisionNumber;
            }
            if (DecisionControl1.DecisionDirectionValue != string.Empty)
            {
                objDead.DeadDecisionDirection = DecisionControl1.DecisionDirectionValue;
            }
            if (DecisionControl1.DecisionDate.Value.ToShortDateString() != string.Empty)
            {
                objDead.DeadDecisionDate = DateTime.Parse(DecisionControl1.DecisionDate.Value.ToShortDateString());
            }
            if (DecisionControl1.NotesValue == string.Empty)
            {
                objDead.DeadDecisionNotes = DecisionControl1.NotesValue;
            }
            objDead.IsUnKown = rdTypeList.SelectedValue == "1" ? true : false;
        }

        objDead.PaperID = UcDeathInfo2.EventDeadCardNo;
        objDead.PaperIDType = UcDeathInfo2.EventDeadCardType;
        objDead.PaperIssuePlace = UcDeathInfo2.EventCardLocation;
        objDead.AddressNo = UcAddressInfo1.EventDeadAddressNo;
        objDead.AddressStreet = UcAddressInfo1.EventDeadAddressStreet;
        objDead.AddressFeatured = UcAddressInfo1.EventDeadAddressSign;
        objDead.DeadGovernorate = UcAddressInfo1.DeadAddressGovernate;
        objDead.DeadSection = UcAddressInfo1.DeadAddressPoliceStation;
        objDead.DeadArea = UcAddressInfo1.DeadAddressArea;
        objDead.DeadPhone = UcAddressInfo1.EventDeadAddressPhone;
        objDead.DeadJob = UcAddressInfo1.EventDeadAddressJob;
        objDead.DeadBirthDate = DateTime.Parse(UcDeathInfo2.EventDeadBirthDate);
        objDead.DeadDieDate = DateTime.Parse(UcGeneralDeathInfo1.EventDeadDieDate);
        objDead.DiePlace = UcGeneralDeathInfo1.EventDeadPlace;
        objDead.DiePlaceDescription = UcGeneralDeathInfo1.EventDeadPlaceDescription;
        objDead.DeadDieHour = UcGeneralDeathInfo1.EventDeadDieHour;
        objDead.DeadDieMin = UcGeneralDeathInfo1.EventDeadDieMin;
        objDead.Approved = false;
        objDead.HasHealthData = false;
        //TODO: uncomment me
        if (MHOCommon.CurrentOrgGovID != 0 && MHOCommon.CurrentOrgAreaID != 0 && MHOCommon.CurrentOrgPoliceStationID != 0)
        {
            objDead.DieGovernorate = MHOCommon.CurrentOrgGovID;
            objDead.DieSection = MHOCommon.CurrentOrgPoliceStationID;
            objDead.DieArea = MHOCommon.CurrentOrgAreaID;
        }

        objDead.DeadMotherNID = UcMotherInfo2.ParentNID;
        objDead.DeadMotherNationality = UcMotherInfo2.ParentNationality;
        objDead.DeadMotherFirstName = UcMotherInfo2.ParentFirstName;
        objDead.DeadMotherSecondName = UcMotherInfo2.ParentFatherName;
        objDead.DeadMotherFamilyName = UcMotherInfo2.ParentFamilyName;
        objDead.DeadMotherReligion = UcMotherInfo2.ParentRelegion;
        objDead.DaadMotherSureName = UcMotherInfo2.ParentSureName;
        objDead.MotherProveNumber = UcMotherInfo2.ProveNo;
        objDead.MotherProveText = UcMotherInfo2.ProveType;
        objDead.DeadMotherJob = UcMotherInfo2.ParentJob;
        objDead.InformerRelation = UcNotifierInfo2.NotifierRelation;
        objDead.InformerPhone = UcNotifierInfo2.NotifierphoneNo;
        objDead.InformerNID = UcNotifierInfo2.NotifierNID;
        objDead.InformerFirstName = UcNotifierInfo2.NotifierFName;
        objDead.InformerSecondName = UcNotifierInfo2.NotifierFatherName;
        //objDead.InformerAddress = UcNotifierInfo2.
        objDead.RegisterID = new Guid(drpRegestierNoList.Value);
        objDead.RegisterNo = Convert.ToInt32(txtRecordNumber.Text);
        objDead.RegisterDate = DateTime.Now.Date;
        objDead.Save();
        Response.Redirect("ProcessResult.aspx");
    }