// For Attributes fill in Attributes group
        public List <AttributeSettingsData> GetAttributeGroupList(string strSearch)
        {
            DataTable dtList = new DataTable();

            using (OracleConnection objConn = new OracleConnection(connectionString))
            {
                OracleCommand objCmd = new OracleCommand("p_get_attr_group_list", objConn);
                objCmd.CommandType = CommandType.StoredProcedure;
                objCmd.Parameters.Add("as_group_name", OracleType.VarChar).Value  = strSearch;
                objCmd.Parameters.Add("p_cur_group", OracleType.Cursor).Direction = ParameterDirection.Output;
                objConn.Open();
                dtList.Load(objCmd.ExecuteReader());
                objConn.Close();
            }

            AttributeSettingsData        outTemp = new AttributeSettingsData();
            List <AttributeSettingsData> AttributeSettingsDataTemp = new List <AttributeSettingsData>();

            foreach (DataRow dr in dtList.Rows)
            {
                outTemp.GroupId         = Convert.ToInt32(dr["group_id"]);
                outTemp.GroupName       = Convert.ToString(dr["group_name"]);
                outTemp.LibraryName     = Convert.ToString(dr["Library_Name"]);
                outTemp.AttributeStatus = Common.GetStringToBoolAttribute(Convert.ToString(dr["status"]));
                outTemp.Updatedby       = Convert.ToString(dr["update_by"]);
                outTemp.UpdatedDate     = TypeConvert.Convert2DateTime(dr["update_date"]);

                AttributeSettingsDataTemp.Add(outTemp);
                outTemp = new AttributeSettingsData();
            }

            return(AttributeSettingsDataTemp.ToList());
        }
        public List <AttributeSettingsData> GetFullAttributeList(string Status, string Search_Param)
        {
            DataTable dtList = new DataTable();

            using (OracleConnection objConn = new OracleConnection(connectionString))
            {
                OracleCommand objCmd = new OracleCommand("P_SEARCH_ATTR_LIST", objConn);
                objCmd.CommandType = CommandType.StoredProcedure;
                objCmd.Parameters.Add("as_status", OracleType.VarChar).Value     = Status;
                objCmd.Parameters.Add("as_attr_name", OracleType.VarChar).Value  = Search_Param;
                objCmd.Parameters.Add("p_cur_attr", OracleType.Cursor).Direction = ParameterDirection.Output;
                objConn.Open();
                dtList.Load(objCmd.ExecuteReader());
                objConn.Close();
            }

            AttributeSettingsData        outTemp = new AttributeSettingsData();
            List <AttributeSettingsData> AttributeSettingsDataTemp = new List <AttributeSettingsData>();

            foreach (DataRow dr in dtList.Rows)
            {
                outTemp.AttributeId     = Convert.ToInt32(dr["attr_id"]);
                outTemp.AttributeName   = Convert.ToString(dr["attr_name"]);
                outTemp.AttributeType   = Convert.ToString(dr["Data_Type"]);
                outTemp.AttributeStatus = Common.GetStringToBoolAttribute(Convert.ToString(dr["status"]));
                outTemp.Description     = Convert.ToString(dr["Description"]);
                outTemp.Style           = Convert.ToString(dr["Style"]);
                outTemp.StyleVal        = Convert.ToString(dr["StyleSml"]);
                outTemp.DefaultValFlag  = Common.GetStringToBoolAttribute(Convert.ToString(dr["default_val_flag"]));
                outTemp.DefaultVal      = Convert.ToString(dr["default_val"]);

                outTemp.IsValueMandatory = Common.GetStringToBoolAttribute(Convert.ToString(dr["VAL_MAND"]));
                outTemp.IsInhMandatory   = Common.GetStringToBoolAttribute(Convert.ToString(dr["INHERIT_MAND"]));
                outTemp.LibraryId        = Convert.ToInt32(dr["LIBRARY_ID"]);
                outTemp.LibraryName      = Convert.ToString(dr["Library_Name"]);
                outTemp.CreatedBy        = Convert.ToString(dr["Insert_By"]);
                outTemp.CreatedDate      = TypeConvert.Convert2DateTime(dr["Insert_Date"]);
                outTemp.Updatedby        = Convert.ToString(dr["update_by"]);
                outTemp.UpdatedDate      = TypeConvert.Convert2DateTime(dr["update_date"]);
                AttributeSettingsDataTemp.Add(outTemp);
                outTemp = new AttributeSettingsData();
            }

            return(AttributeSettingsDataTemp.ToList());
        }
        public List <AttributeSettingsData> GetGroupAttributes(int GroupId, int LibraryId, string GroupFlag)
        {
            DataTable dtList = new DataTable();

            using (OracleConnection objConn = new OracleConnection(connectionString))
            {
                OracleCommand objCmd = new OracleCommand("p_get_group_attr", objConn);
                objCmd.CommandType = CommandType.StoredProcedure;
                objCmd.Parameters.Add("an_group_id", OracleType.VarChar).Value   = GroupId;
                objCmd.Parameters.Add("an_library_id", OracleType.Int32).Value   = LibraryId;
                objCmd.Parameters.Add("as_group_flag", OracleType.VarChar).Value = GroupFlag;
                objCmd.Parameters.Add("p_cur_attr", OracleType.Cursor).Direction = ParameterDirection.Output;
                objConn.Open();
                dtList.Load(objCmd.ExecuteReader());
                objConn.Close();
            }

            AttributeSettingsData        outTemp = new AttributeSettingsData();
            List <AttributeSettingsData> AttributeSettingsDataTemp = new List <AttributeSettingsData>();

            foreach (DataRow dr in dtList.Rows)
            {
                outTemp.GroupId         = Convert.ToInt32(dr["group_id"]);
                outTemp.AttributeId     = Convert.ToInt32(dr["attr_id"]);
                outTemp.AttributeName   = Convert.ToString(dr["attr_name"]);
                outTemp.AttributeType   = Convert.ToString(dr["DATA_TYPE"]);
                outTemp.AttributeStatus = Common.GetStringToBool(Convert.ToString(dr["status"]));
                outTemp.CreatedBy       = Convert.ToString(dr["Insert_By"]);
                outTemp.CreatedDate     = TypeConvert.Convert2DateTime(dr["Insert_Date"]);
                outTemp.Updatedby       = Convert.ToString(dr["update_by"]);
                outTemp.UpdatedDate     = TypeConvert.Convert2DateTime(dr["update_date"]);
                AttributeSettingsDataTemp.Add(outTemp);
                outTemp = new AttributeSettingsData();
            }

            return(AttributeSettingsDataTemp.ToList());
        }