public ProfileManagementInfo GetById(int id)
        {
            ProfileManagementInfo profileItem = null;

            foreach (ProfileManagementInfo profileProperty in InnerList)
            {
                if ((profileProperty.ProfileID == id))
                {
                    // Found Profile property
                    profileItem = profileProperty;
                }
            }
            return(profileItem);
        }
        public ProfileManagementInfo GetByName(string name)
        {
            ProfileManagementInfo profileItem = null;

            foreach (ProfileManagementInfo profileProperty in InnerList)
            {
                if ((profileProperty.Name == name))
                {
                    // Found Profile property
                    profileItem = profileProperty;
                }
            }
            return(profileItem);
        }
        private void Edit(int EditID)
        {
            ClearProfilepropertyForm();
            ProfileManagementController objController = new ProfileManagementController();
            ProfileManagementInfo       objinfo       = objController.GetProfileByProfileID(EditID);

            if (objinfo != null)
            {
                txtCaption.Text = objinfo.Name;
                ddlPropertyType.SelectedIndex = ddlPropertyType.Items.IndexOf(ddlPropertyType.Items.FindByValue(objinfo.PropertyTypeID.ToString()));
                chkIsRequred.Checked          = bool.Parse(objinfo.IsRequired.ToString());
                ddlDataType.SelectedIndex     = ddlDataType.Items.IndexOf(ddlDataType.Items.FindByValue(objinfo.DataType));

                if (objinfo.PropertyTypeID != 1 && objinfo.PropertyTypeID != 5 && objinfo.PropertyTypeID != 6 && objinfo.PropertyTypeID != 7 && objinfo.PropertyTypeID != 8 && Session[SessionKeys.PropertyValueDataTable] != null)
                {
                    List <ProfileManagementInfo> dtActual = objController.GetActiveProfileValueByProfileID(EditID, GetPortalID);
                    CommonFunction LToDCon = new CommonFunction();
                    if (dtActual != null && dtActual.Count > 0)
                    {
                        DataTable dt = (DataTable)Session[SessionKeys.PropertyValueDataTable];
                        for (int i = 0; i < dtActual.Count; i++)
                        {
                            DataRow newrow1 = dt.NewRow();
                            dt.Rows.Add(newrow1);
                            dt.Rows[dt.Rows.Count - 1]["ProfileValueID"] = dtActual[i].ProfileValueID.ToString();
                            dt.Rows[dt.Rows.Count - 1]["Name"]           = dtActual[i].Name;
                            dt.AcceptChanges();
                        }
                        lstvPropertyValue.DataSource     = dt;
                        lstvPropertyValue.DataTextField  = "Name";
                        lstvPropertyValue.DataValueField = "ProfileValueID";
                        lstvPropertyValue.DataBind();
                        trListPropertyValue.Style.Add("display", "");
                    }
                }
                else
                {
                    lstvPropertyValue.DataSource = null;
                    lstvPropertyValue.DataBind();
                    trListPropertyValue.Style.Add("display", "none");
                }
            }
            HideAll();
            divForm.Style.Add("display", "block");
            Session[SessionKeys.EditProfileID] = EditID;
        }
 private void MoveProperty(int index, int destIndex)
 {
     try
     {
         ProfileManagementInfo objProperty = ProfileProperties[index];
         ProfileManagementInfo objNext     = ProfileProperties[destIndex];
         int currentOrder = (int)objProperty.DisplayOrder;
         int nextOrder    = (int)objNext.DisplayOrder;
         // Swap ViewOrders
         objProperty.DisplayOrder     = nextOrder;
         ProfileProperties[index]     = objProperty;
         objNext.DisplayOrder         = currentOrder;
         ProfileProperties[destIndex] = objNext;
         // 'Refresh Grid
         ProfileProperties.Sort();
         BindGrid();
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
 public int Add(ProfileManagementInfo value)
 {
     return(List.Add(value));
 }
 public void Remove(ProfileManagementInfo value)
 {
     List.Remove(value);
 }
 public void Insert(int index, ProfileManagementInfo value)
 {
     List.Insert(index, value);
 }
 public int IndexOf(ProfileManagementInfo value)
 {
     return(List.IndexOf(value));
 }
 public bool Contains(ProfileManagementInfo value)
 {
     return(List.Contains(value));
 }