Пример #1
0
        /// <summary>
        /// To Get ALL Shocks Experienced
        /// </summary>
        /// <returns></returns>
        public ShocksExperiencedList GetALLShocksExperienced()//(ShocksExperienced oShocksExperienced)
        {
            proc = "USP_MST_GETALL_SHOCKSEXP";
            cnn  = new OracleConnection(con);
            ShocksExperiencedBO objShocksExperienced = null;

            ShocksExperiencedList lstShocksExperiencedList = new ShocksExperiencedList();

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

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

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

                while (dr.Read())
                {
                    objShocksExperienced = new ShocksExperiencedBO();

                    if (ColumnExists(dr, "SHOCKID") && !dr.IsDBNull(dr.GetOrdinal("SHOCKID")))
                    {
                        objShocksExperienced.ShocksExperiencedID = dr.GetInt32(dr.GetOrdinal("SHOCKID"));
                    }
                    if (ColumnExists(dr, "SHOCKEXPERIENCED") && !dr.IsDBNull(dr.GetOrdinal("SHOCKEXPERIENCED")))
                    {
                        objShocksExperienced.ShocksExperience = dr.GetString(dr.GetOrdinal("SHOCKEXPERIENCED"));
                    }
                    if (ColumnExists(dr, "isdeleted") && !dr.IsDBNull(dr.GetOrdinal("isdeleted")))
                    {
                        objShocksExperienced.IsDeleted = dr.GetString(dr.GetOrdinal("isdeleted"));
                    }
                    lstShocksExperiencedList.Add(objShocksExperienced);
                }

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

            return(lstShocksExperiencedList);
        }
Пример #2
0
        // To get type of shock from MST_SHOCKSEXPERIENCED
        public void GetTypeofshock()
        {
            string SHOCKID = string.Empty;

            if (typeofshockDropDownList.SelectedValue.ToString() == "")
            {
                SHOCKID = "0";
                //msgSaveLabel.Text = null; // if value is select then error msg will display
            }
            else
            {
                // SHOCKID = typeofshockDropDownList.SelectedValue.ToString(); // get UI screen Value
                DataSet Ds = new DataSet();
                // MajorshockBLL Typeofshock_BLL = new MajorshockBLL(); // Function or object creation for next layer
                ShocksExperiencedBLL Typeofshock_BLL = new ShocksExperiencedBLL();
                objShocksExperiencedList = new ShocksExperiencedList();
                // Ds = Typeofshock_BLL.GetShocksExperienced(SHOCKID); // data pass through object SHOCKID
                objShocksExperiencedList = Typeofshock_BLL.GetShocksExperienced();
                try
                {
                    //if (Ds.Tables[0].Rows.Count > 0) // Data from BLL
                    if (objShocksExperiencedList.Count > 0)
                    {
                        typeofshockDropDownList.DataSource = objShocksExperiencedList;
                        //typeofshockDropDownList.DataTextField = Ds.Tables[0].Columns[1].ToString();
                        //typeofshockDropDownList.DataValueField = Ds.Tables[0].Columns[0].ToString();
                        typeofshockDropDownList.DataTextField  = "ShocksExperience";
                        typeofshockDropDownList.DataValueField = "ShocksExperiencedID";
                        typeofshockDropDownList.DataBind();
                        //typeofshockDropDownList.Items.Insert(0, "--Select--");
                    }
                }
                catch (Exception ee)
                {
                    throw ee;
                }
                finally // set the finally class nothing but Empty the object
                {
                    Typeofshock_BLL = null;
                }
            }
        }