示例#1
0
        /// <summary>
        /// To Get Land Info Priv Spose
        /// </summary>
        /// <param name="PRIVATELANDID"></param>
        /// <returns></returns>
        public PAPRelationList GetLandInfoPrivSpose(int PRIVATELANDID)
        {
            PAP_RelationBO  objRelation = null;
            PAPRelationList Relations   = new PAPRelationList();

            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_TRN_GET_PAP_LND_SPOSE";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("PRIVATELANDIDIN", PRIVATELANDID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            while (dr.Read())
            {
                objRelation = new PAP_RelationBO();

                if (!dr.IsDBNull(dr.GetOrdinal("pap_hh_relationid")))
                {
                    objRelation.RelationID = dr.GetInt32(dr.GetOrdinal("pap_hh_relationid"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("privatelandid")))
                {
                    objRelation.HolderTypeID = dr.GetInt32(dr.GetOrdinal("privatelandid"));
                }

                Relations.Add(objRelation);
            }
            dr.Close();
            return(Relations);
        }
示例#2
0
        /// <summary>
        /// Bind Child Data to Chkchildrenlist
        /// </summary>
        /// <param name="HHHH_ID"></param>
        protected void BindChild(int HHHH_ID)
        {
            PAP_RelationBLL objPAPRBLL          = new PAP_RelationBLL();
            PAPRelationList objPAPRelationList  = new PAPRelationList();
            PAPRelationList objPAPRelationList2 = new PAPRelationList();

            objPAPRelationList  = objPAPRBLL.GetRelations(HHHH_ID, 2);
            objPAPRelationList2 = objPAPRBLL.GetRelations(HHHH_ID, 3);
            PAP_RelationBO objRelation = null;

            for (int i = 0; i < objPAPRelationList2.Count; i++)
            {
                objRelation = new PAP_RelationBO();

                objRelation.RelationID           = objPAPRelationList2[i].RelationID;
                objRelation.HouseholdID          = objPAPRelationList2[i].HouseholdID;
                objRelation.HolderName           = objPAPRelationList2[i].HolderName;
                objRelation.ResideOnAffectedLand = objPAPRelationList2[i].ResideOnAffectedLand;
                objRelation.DateOfBirth          = objPAPRelationList2[i].DateOfBirth;
                objRelation.LiteracyStatus       = objPAPRelationList2[i].LiteracyStatus;
                objRelation.IsDeleted            = objPAPRelationList2[i].IsDeleted;

                objPAPRelationList.Add(objRelation);
            }
            if (objPAPRelationList.Count > 0)
            {
                Chkchildrenlist.DataSource     = objPAPRelationList;
                Chkchildrenlist.DataTextField  = "HOLDERNAME";
                Chkchildrenlist.DataValueField = "RelationID";
                Chkchildrenlist.DataBind();
            }
            else
            {
                chkmsg.Text = "Children Not Available";
            }
        }
示例#3
0
        /// <summary>
        /// To Sava and Update Private land Data info in to data base
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            PrivateLandInfoBO objPrivateLF = new PrivateLandInfoBO();

            objPrivateLF.HIDPriv           = Convert.ToInt32(Session["HH_ID"]);
            objPrivateLF.Lnd_TENUREIDPriv  = Convert.ToInt32(ddlLandTenure.SelectedItem.Value);
            objPrivateLF.LANDLORDNAME      = txtlandlord.Text;
            objPrivateLF.CLAIMANTNAME      = txtwhoclaims.Text.Trim();
            objPrivateLF.WHENFARMINGBEGAN  = txtwhenbeginfarm.Text.Trim();
            objPrivateLF.WHEREFARMEDBEFORE = txtwheredidfarm.Text.Trim();
            //objPrivateLF.DOSPOUSESFARM = Chkspouse.Text;

            if (Chkspouse.Checked == true)
            {
                objPrivateLF.DOSPOUSESFARM = "Yes";

                //BO.PAP_Relation objPAPR = new BO.PAP_Relation();
                //BO.PAP_RelationBLL objPAPRBLL = new BO.PAP_RelationBLL();
                //Chkspouselist.DataSource = objPAPRBLL.GetRelations(2,3);
            }
            else if (Chkspouse.Checked == false)
            {
                objPrivateLF.DOSPOUSESFARM = "No";
            }

            if (ChkChildren.Checked == true)
            {
                objPrivateLF.DOCHILDRENFARM = "Yes";
            }
            else if (ChkChildren.Checked == false)
            {
                objPrivateLF.DOCHILDRENFARM = "No";
            }
            string sagr = txtagrrement.Text.Trim();
            string sPro = txtprodutive.Text.Trim();

            if (sagr.Length > 999)
            {
                sagr = sagr.Substring(0, 999);
            }
            if (sPro.Length > 999)
            {
                sPro = sPro.Substring(0, 999);
            }
            objPrivateLF.AGREEMENTTYPE          = sagr;
            objPrivateLF.PRODASSETOPPORTUNITIES = sPro;
            objPrivateLF.Useridpriv             = Convert.ToInt32(Session["USER_ID"]);
            LandInfoPrivateBLL objLFPrivateBLL = new LandInfoPrivateBLL();

            //if (objPrivateLF.HIDPriv != 0)
            //{
            //    objLFPrivateBLL.AddLandInfoPrivate(objPrivateLF);
            //    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('Private Land Info added successfully');", true);
            //}
            //else
            //{
            objLFPrivateBLL.UpdateLandInfoPrivate(objPrivateLF);

            PAPRelationList RelationsSpose = new PAPRelationList();

            if (Chkspouse.Checked == true)
            {
                PAP_RelationBO objRelation = null;
                for (int i = 0; i < Chkspouselist.Items.Count; i++)
                {
                    if (Chkspouselist.Items[i].Selected)
                    {
                        objRelation             = new PAP_RelationBO();
                        objRelation.RelationID  = Convert.ToInt32(Chkspouselist.Items[i].Value);
                        objRelation.HouseholdID = Convert.ToInt32(Session["HH_ID"]);
                        objRelation.CreatedBy   = Convert.ToInt32(Session["USER_ID"]);
                        RelationsSpose.Add(objRelation);
                    }
                }
            }
            objLFPrivateBLL.InsertUpdateRelationsSpose(RelationsSpose);
            PAPRelationList RelationsChild = new PAPRelationList();

            if (ChkChildren.Checked == true)
            {
                PAP_RelationBO objRelation = null;
                for (int i = 0; i < Chkchildrenlist.Items.Count; i++)
                {
                    if (Chkchildrenlist.Items[i].Selected)
                    {
                        objRelation             = new PAP_RelationBO();
                        objRelation.RelationID  = Convert.ToInt32(Chkchildrenlist.Items[i].Value);
                        objRelation.HouseholdID = Convert.ToInt32(Session["HH_ID"]);
                        objRelation.CreatedBy   = Convert.ToInt32(Session["USER_ID"]);
                        RelationsChild.Add(objRelation);
                    }
                }
            }
            objLFPrivateBLL.InsertUpdateRelationsChild(RelationsChild);
            ChangeRequestStatusITML();
            projectFrozen();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Updated", "alert('Data updated successfully');", true);
            btn_SavePrivate.Text = "Save";
            //ClearDetailspriv();

            //}
        }
示例#4
0
        /// <summary>
        /// To Get Relations
        /// </summary>
        /// <param name="householdID"></param>
        /// <param name="holderTypeID"></param>
        /// <returns></returns>
        public PAPRelationList GetRelations(int householdID, int holderTypeID)
        {
            proc = "USP_TRN_GET_PAPRELATIONS";
            cnn  = new OracleConnection(con);

            PAP_RelationBO  objRelation = null;
            PAPRelationList Relations   = new PAPRelationList();

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("HOUSEHOLDID_", householdID);
            cmd.Parameters.Add("HOLDERTYPEID_", holderTypeID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            try
            {
                cmd.Connection.Open();
                OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                while (dr.Read())
                {
                    objRelation = new PAP_RelationBO();

                    if (!dr.IsDBNull(dr.GetOrdinal("PAP_HH_RELATIONID")))
                    {
                        objRelation.RelationID = dr.GetInt32(dr.GetOrdinal("PAP_HH_RELATIONID"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("HHID")))
                    {
                        objRelation.HouseholdID = dr.GetInt32(dr.GetOrdinal("HHID"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("HOLDERNAME")))
                    {
                        objRelation.HolderName = dr.GetString(dr.GetOrdinal("HOLDERNAME"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("RESIDEONAFFECTEDLAND")))
                    {
                        objRelation.ResideOnAffectedLand = dr.GetString(dr.GetOrdinal("RESIDEONAFFECTEDLAND"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("DATEOFBIRTH")))
                    {
                        objRelation.DateOfBirth = dr.GetDateTime(dr.GetOrdinal("DATEOFBIRTH"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("LTR_STATUS")))
                    {
                        objRelation.LiteracyStatus = dr.GetString(dr.GetOrdinal("LTR_STATUS"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("CUR_SCH_STATUS")))
                    {
                        objRelation.CurrentSchoolStatus = dr.GetString(dr.GetOrdinal("CUR_SCH_STATUS"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("NVR_ATT_SCH_REASON")))
                    {
                        objRelation.NeverAttendedSchool = dr.GetString(dr.GetOrdinal("NVR_ATT_SCH_REASON"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("SCH_DRP_REASON")))
                    {
                        objRelation.SchoolDropReason = dr.GetString(dr.GetOrdinal("SCH_DRP_REASON"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                    {
                        objRelation.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("GENDER")))
                    {
                        objRelation.Sex = dr.GetString(dr.GetOrdinal("GENDER"));
                    }

                    Relations.Add(objRelation);
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Relations);
        }