예제 #1
0
파일: MaxCapDAL.cs 프로젝트: abigabaw/wis
        /// <summary>
        /// To fetch details
        /// </summary>
        /// <param name="districtID"></param>
        /// <returns></returns>
        public MaxCapList GetMaxCapByDist(string districtID)
        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_MST_GET_MAXCAP";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("DistrictIDIN", districtID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr           = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            MaxCapBO         objcountBO   = null;
            MaxCapList       objcountlist = new MaxCapList();

            while (dr.Read())
            {
                objcountBO           = new MaxCapBO();
                objcountBO.MaxCapID  = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("MAXCAPCROPDISTID"))));
                objcountBO.MaxCapVal = dr.GetDecimal(dr.GetOrdinal("MAXCAPSTNDRDRATE"));
                objcountlist.Add(objcountBO);
            }

            dr.Close();
            return(objcountlist);
        }
예제 #2
0
파일: MaxCapDAL.cs 프로젝트: abigabaw/wis
        /// <summary>
        /// To fetch details
        /// </summary>
        /// <param name="districtID"></param>
        /// <returns></returns>
        public MaxCapList GetAllMaxCap(int ProjectId)
        {
            MaxCapList objCountyList = null;

            using (cnn = new OracleConnection(connStr))
            {
                using (cmd = new OracleCommand("USP_MST_GET_MAXCAP_ALL", cnn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add("PROJECTID_", ProjectId);
                    cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                    cmd.Connection.Open();

                    OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                    MaxCapBO objMaxCapBO = null;
                    objCountyList = new MaxCapList();

                    while (dr.Read())
                    {
                        objMaxCapBO = new MaxCapBO();
                        if (!dr.IsDBNull(dr.GetOrdinal("MAXCAPCROPDISTID")))
                        {
                            objMaxCapBO.MaxCapID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("MAXCAPCROPDISTID")));
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("MAXCAPSTNDRDRATE")))
                        {
                            objMaxCapBO.MaxCapVal = dr.GetDecimal(dr.GetOrdinal("MAXCAPSTNDRDRATE"));
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                        {
                            objMaxCapBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("districtname")))
                        {
                            objMaxCapBO.DistrictName = dr.GetString(dr.GetOrdinal("districtname"));
                        }
                        // if (!dr.IsDBNull(dr.GetOrdinal("districtid"))) objMaxCapBO.DistrictID =Convert.ToInt32( dr.GetString(dr.GetOrdinal("districtid")));
                        objCountyList.Add(objMaxCapBO);
                    }

                    dr.Close();
                }
            }

            return(objCountyList);
        }
예제 #3
0
파일: MaxCapDAL.cs 프로젝트: abigabaw/wis
        /// <summary>
        /// To get details
        /// </summary>
        /// <param name="MaxCap"></param>
        /// <returns></returns>

        public MaxCapList GetMaxCap(string MaxCap)
        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_MST_SER_MAXCAP";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("MAXCAPVAL_", MaxCap);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr           = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            MaxCapBO         objcountBO   = null;
            MaxCapList       objcountlist = new MaxCapList();

            while (dr.Read())
            {
                objcountBO = new MaxCapBO();
                if (!dr.IsDBNull(dr.GetOrdinal("MAXCAPCROPDISTID")))
                {
                    objcountBO.MaxCapID = dr.GetInt32(dr.GetOrdinal("MAXCAPCROPDISTID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTID")))
                {
                    objcountBO.DistrictID = dr.GetInt32(dr.GetOrdinal("DISTRICTID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("MAXCAPSTNDRDRATE")))
                {
                    objcountBO.MaxCapVal = dr.GetDecimal(dr.GetOrdinal("MAXCAPSTNDRDRATE"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                {
                    objcountBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("districtname")))
                {
                    objcountBO.DistrictName = dr.GetString(dr.GetOrdinal("districtname"));
                }
                objcountlist.Add(objcountBO);
            }

            dr.Close();
            return(objcountlist);
        }