Beispiel #1
0
        /// <summary>
        /// to get the data from the database and bind it to the gridview
        /// </summary>
        /// <param name="addRow"></param>
        /// <param name="deleteRow"></param>

        private void BindGrid(bool addRow, bool deleteRow)
        {
            try
            {
                objSurveyBLL         = new SurveyBLL();
                objLandLivingOffList = new LandLivingOffList();
                objLandLivingOffList = objSurveyBLL.GetLivingOFF(Convert.ToInt32(Session["HH_ID"]));
                grdLandInfoRespondentsOff.DataSource = objLandLivingOffList;
                grdLandInfoRespondentsOff.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        /// <summary>
        /// To Get Living OFF
        /// </summary>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public LandLivingOffList GetLivingOFF(int HHID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_TRN_GET_LANDLIVINGOFF";

            LandLivingOffBO   objLivingOff     = null;
            LandLivingOffList LandLivingOffLst = new LandLivingOffList();

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

            try
            {
                cmd.Connection.Open();
                OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                while (dr.Read())
                {
                    objLivingOff = new LandLivingOffBO();
                    if (!dr.IsDBNull(dr.GetOrdinal("LIVINGOFFID")))
                    {
                        objLivingOff.LivingOffID = dr.GetInt32(dr.GetOrdinal("LIVINGOFFID"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("dwellingtype")))
                    {
                        objLivingOff.Dwellingtype = dr.GetString(dr.GetOrdinal("dwellingtype"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("noofrooms")))
                    {
                        objLivingOff.NoofRooms = dr.GetString(dr.GetOrdinal("noofrooms"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("str_tenure")))
                    {
                        objLivingOff.Str_Tenure = dr.GetString(dr.GetOrdinal("str_tenure"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("TENURE")))
                    {
                        objLivingOff.Tenure = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("TENURE")));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("rooftype")))
                    {
                        objLivingOff.RoofType = dr.GetString(dr.GetOrdinal("rooftype"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("walltype")))
                    {
                        objLivingOff.WallType = dr.GetString(dr.GetOrdinal("walltype"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("floortype")))
                    {
                        objLivingOff.FloorType = dr.GetString(dr.GetOrdinal("floortype"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("IsDeleted")))
                    {
                        objLivingOff.IsDeleted = dr.GetString(dr.GetOrdinal("IsDeleted"));
                    }
                    LandLivingOffLst.Add(objLivingOff);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(LandLivingOffLst);
        }