Example #1
0
        /// <summary>
        /// Get ALL CopMechanism
        /// </summary>
        /// <returns></returns>
        public CopMechanismList GetALLCopMechanism()//(CopMechanism oCopMechanism)
        {
            proc = "USP_MST_GETALLCOP_MECHANISM";
            cnn  = new OracleConnection(con);
            CopMechanismBO objCopMechanism = null;

            CopMechanismList lstCopMechanismList = new CopMechanismList();

            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())
                {
                    objCopMechanism = new CopMechanismBO();

                    if (ColumnExists(dr, "cop_mechanismid") && !dr.IsDBNull(dr.GetOrdinal("cop_mechanismid")))
                    {
                        objCopMechanism.CopMechanismID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("cop_mechanismid")));
                    }
                    if (ColumnExists(dr, "cop_mechanism") && !dr.IsDBNull(dr.GetOrdinal("cop_mechanism")))
                    {
                        objCopMechanism.CopMechanismName = dr.GetString(dr.GetOrdinal("cop_mechanism"));
                    }
                    if (ColumnExists(dr, "isdeleted") && !dr.IsDBNull(dr.GetOrdinal("isdeleted")))
                    {
                        objCopMechanism.IsDeleted = dr.GetString(dr.GetOrdinal("isdeleted"));
                    }

                    lstCopMechanismList.Add(objCopMechanism);
                }

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

            return(lstCopMechanismList);
        }
Example #2
0
        //To get coping mechanism from the table MST_COPING_MECHANISM
        public void Getcopingmechanism()
        {
            string COP_MECHANISMID = string.Empty;

            if (copingmechDropDownList.SelectedValue.ToString() == "")
            {
                COP_MECHANISMID = "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 copmech_BLL = new MajorshockBLL(); // Function or object creation for next layer
                CopMechanismBLL copmech_BLL = new CopMechanismBLL();
                //Ds = copmech_BLL.GetCopMech(COP_MECHANISMID); // data pass through object SHOCKID

                objCopMechanismList = copmech_BLL.GetCopMechanism();
                try
                {
                    //if (Ds.Tables[0].Rows.Count > 0) // Data from BLL
                    if (objCopMechanismList.Count > 0)
                    {
                        copingmechDropDownList.DataSource = objCopMechanismList;
                        //copingmechDropDownList.DataTextField = Ds.Tables[0].Columns[1].ToString();
                        //copingmechDropDownList.DataValueField = Ds.Tables[0].Columns[0].ToString();
                        copingmechDropDownList.DataTextField  = "CopMechanismName";
                        copingmechDropDownList.DataValueField = "CopMechanismID";
                        copingmechDropDownList.DataBind();
                        //  copingmechDropDownList.Items.Insert(0, "--Select--");
                    }
                }
                catch (Exception ee)
                {
                    throw ee;
                }
                finally // set the finally class nothing but Empty the object
                {
                    copmech_BLL = null;
                }
            }
        }