Beispiel #1
0
        /// <summary>
        /// to bind the grid
        /// </summary>

        private void BindGrid()
        {
            SocioConcernBLL  objSocioConcernBLL  = new SocioConcernBLL();
            SocioConcernList objSocioConcernList = new SocioConcernList();
            int HHID = Convert.ToInt32(Session["HH_ID"].ToString());

            objSocioConcernList         = objSocioConcernBLL.getSocioConcern(HHID);
            grdSocioConcerns.DataSource = objSocioConcernList;
            grdSocioConcerns.DataBind();
        }
Beispiel #2
0
        /// <summary>
        /// To get Socio Concern
        /// </summary>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public SocioConcernList getSocioConcern(int HHID)
        {
            // used in Master page
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = " USP_TRN_GETSOCIALCONCERNS";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("HHID_", HHID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();
            OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            SocioConcernBO   objSocioConcern  = null;
            SocioConcernList SocioConcernList = new SocioConcernList();

            while (dr.Read())
            {
                objSocioConcern = new SocioConcernBO();

                if (!dr.IsDBNull(dr.GetOrdinal("PAP_CONCERNID")))
                {
                    objSocioConcern.PapConcernID = dr.GetInt32(dr.GetOrdinal("PAP_CONCERNID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("HHID")))
                {
                    objSocioConcern.HHID = dr.GetInt32(dr.GetOrdinal("HHID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("CONCERNID")))
                {
                    objSocioConcern.ConcernID = dr.GetInt32(dr.GetOrdinal("CONCERNID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("CONCERN")))
                {
                    objSocioConcern.ConcernName = dr.GetString(dr.GetOrdinal("CONCERN"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("OTHERCONCERN")))
                {
                    objSocioConcern.OtherConcern = dr.GetString(dr.GetOrdinal("OTHERCONCERN"));
                }

                SocioConcernList.Add(objSocioConcern);
            }

            dr.Close();

            return(SocioConcernList);
        }
Beispiel #3
0
        /// <summary>
        /// To Get Socio Concern By Id
        /// </summary>
        /// <param name="PapConcernID"></param>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public SocioConcernBO GetSocioConcernById(int PapConcernID, int HHID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GET_SOC_CONCERN_ID";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("PapConcernID_", PapConcernID);
            cmd.Parameters.Add("HHID_", HHID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();

            OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            SocioConcernBO   SocioConcernObj  = null;
            SocioConcernList SocioConcernList = new SocioConcernList();

            SocioConcernObj = new SocioConcernBO();
            while (dr.Read())
            {
                if (ColumnExists(dr, "OTHERCONCERN") && !dr.IsDBNull(dr.GetOrdinal("OTHERCONCERN")))
                {
                    SocioConcernObj.OtherConcern = dr.GetString(dr.GetOrdinal("OTHERCONCERN"));
                }
                if (ColumnExists(dr, "PAP_CONCERNID") && !dr.IsDBNull(dr.GetOrdinal("PAP_CONCERNID")))
                {
                    SocioConcernObj.PapConcernID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("PAP_CONCERNID")));
                }
                if (ColumnExists(dr, "CONCERNID") && !dr.IsDBNull(dr.GetOrdinal("CONCERNID")))
                {
                    SocioConcernObj.ConcernID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("CONCERNID")));
                }
            }
            dr.Close();
            return(SocioConcernObj);
        }