/// <summary> /// To Get Sub County /// </summary> /// <param name="countyID"></param> /// <returns></returns> public SubCountyList GetSubCounty(string countyID) { OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GET_SUBCOUNTY"; cmd = new OracleCommand(proc, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@CountyIDIN", countyID); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); SubCountyBO objsubcountBO = null; SubCountyList objsubcountlist = new SubCountyList(); while (dr.Read()) { objsubcountBO = new SubCountyBO(); objsubcountBO.SubCountyID = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("SUBCOUNTYID")))); objsubcountBO.SubCountyName = dr.GetValue(dr.GetOrdinal("SUBCOUNTYNAME")).ToString(); objsubcountlist.Add(objsubcountBO); } dr.Close(); return(objsubcountlist); }
/// <summary> /// To Get All Sub Counties /// </summary> /// <param name="COUNTYID"></param> /// <returns></returns> public SubCountyList GetAllSubCounties(int COUNTYID) { SubCountyList objSubCountyList = null; using (cnn = new OracleConnection(connStr)) { using (cmd = new OracleCommand("USP_MST_GET_SUBCOUNTY_ALL", cnn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("CountyIDIN", COUNTYID); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); SubCountyBO objSubCountyBO = null; objSubCountyList = new SubCountyList(); while (dr.Read()) { objSubCountyBO = new SubCountyBO(); if (!dr.IsDBNull(dr.GetOrdinal("COUNTYNAME"))) { objSubCountyBO.CountyName = dr.GetValue(dr.GetOrdinal("COUNTYNAME")).ToString(); } if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTNAME"))) { objSubCountyBO.DistrictName = dr.GetValue(dr.GetOrdinal("DISTRICTNAME")).ToString(); } if (!dr.IsDBNull(dr.GetOrdinal("SUBCOUNTYID"))) { objSubCountyBO.SubCountyID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("SUBCOUNTYID"))); } if (!dr.IsDBNull(dr.GetOrdinal("SUBCOUNTYNAME"))) { objSubCountyBO.SubCountyName = dr.GetValue(dr.GetOrdinal("SUBCOUNTYNAME")).ToString(); } if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED"))) { objSubCountyBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED")); } // if (!dr.IsDBNull(dr.GetOrdinal("districtname"))) objSubCountyBO.DistrictName = dr.GetString(dr.GetOrdinal("districtname")); // if (!dr.IsDBNull(dr.GetOrdinal("districtid"))) objCountyBO.DistrictID =Convert.ToInt32( dr.GetString(dr.GetOrdinal("districtid"))); objSubCountyList.Add(objSubCountyBO); } dr.Close(); } } return(objSubCountyList); }
/// <summary> /// To Get Sub Counties /// </summary> /// <param name="subCounty"></param> /// <returns></returns> public SubCountyList GetSubCounties(string subCounty) { OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_SER_SUBCOUNTYSEARCH"; cmd = new OracleCommand(proc, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("SubCountyName_", subCounty); //cmd.Parameters.Add("COUNTYID_", CountyID); //cmd.Parameters.Add("SUBCOUNTYNAME_", subCounty); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); SubCountyBO objsubcountBO = null; SubCountyList objsubcountlist = new SubCountyList(); while (dr.Read()) { objsubcountBO = new SubCountyBO(); if (!dr.IsDBNull(dr.GetOrdinal("COUNTYNAME"))) { objsubcountBO.CountyName = dr.GetString(dr.GetOrdinal("COUNTYNAME")); } if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTNAME"))) { objsubcountBO.DistrictName = dr.GetString(dr.GetOrdinal("DISTRICTNAME")); } if (!dr.IsDBNull(dr.GetOrdinal("SUBCOUNTYID"))) { objsubcountBO.SubCountyID = dr.GetInt32(dr.GetOrdinal("SUBCOUNTYID")); } if (!dr.IsDBNull(dr.GetOrdinal("SUBCOUNTYNAME"))) { objsubcountBO.SubCountyName = dr.GetString(dr.GetOrdinal("SUBCOUNTYNAME")); } if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED"))) { objsubcountBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED")); } //if (!dr.IsDBNull(dr.GetOrdinal("districtname"))) objsubcountBO.DistrictName = dr.GetString(dr.GetOrdinal("districtname")); objsubcountlist.Add(objsubcountBO); } dr.Close(); return(objsubcountlist); }
public SubCountyList LoadSubCountyData(string pCountyId) { cnn = new OracleConnection(AppConfiguration.ConnectionString); string proc = "USP_MST_GET_SUBCOUNTY"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@CountyIDIN", pCountyId); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); SubCountyBO obMaster = null; SubCountyList Master = new SubCountyList(); while (dr.Read()) { obMaster = new SubCountyBO(); obMaster.SubCountyID = dr.GetInt32(dr.GetOrdinal("SUBCOUNTYID")); obMaster.SubCountyName = dr.GetString(dr.GetOrdinal("SUBCOUNTYNAME")); Master.Add(obMaster); } dr.Close(); return(Master); }