Beispiel #1
0
        private static string CreateOrUpdate(ApplicationUserDataModel data, RequestProfile requestProfile, string action)
        {
            var sql = "EXEC ";

            switch (action)
            {
            case "Create":
                sql += "dbo.ApplicationUserInsert  " +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId);
                break;

            case "Update":
                sql += "dbo.ApplicationUserUpdate  " +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId);
                break;

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.ApplicationUserId) +
                  ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.ApplicationId) +
                  ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.ApplicationUserName) +
                  ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.EmailAddress) +
                  ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.FirstName) +
                  ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.LastName) +
                  ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.MiddleName) +
                  ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.ApplicationUserTitleId);
            return(sql);
        }
Beispiel #2
0
        //Shows the ApplicationRoles associated with the Person with the given PersonId
        //
        #region ShowRelationship
        public void ShowRelation(int PersonId, bool showParentInfo)
        {
            // most parent pages taht will use this contorl already know
            // parent details, no need to show explictly again
            if (showParentInfo)
            {
                var oData = new ApplicationUserDataModel();

                oData.ApplicationUserId = PersonId;
                if (Framework.Components.ApplicationUser.ApplicationUserDataManager.GetDetails(oData, SessionVariables.RequestProfile).Rows.Count > 0)
                {
                    var personDetailsrow = Framework.Components.ApplicationUser.ApplicationUserDataManager.GetDetails(oData, SessionVariables.RequestProfile).Rows[0];
                    var name             = personDetailsrow["FirstName"].ToString() + " " + personDetailsrow["LastName"].ToString();
                    lblName.Text = name;
                }
            }

            // convert to table and bind or explicitly fill in some how.
            var ApplicationRolesTable = Framework.Components.ApplicationUser.ApplicationUserXApplicationRoleDataManager.GetByApplicationUser(PersonId, SessionVariables.RequestProfile);

            foreach (DataRow row in ApplicationRolesTable.Rows)
            {
                var newRow  = new TableRow();
                var newCell = new TableCell();
                //newCell.Width = 100;
                newCell.Text = row["RoleName"].ToString();
                newRow.Cells.Add(newCell);
                tblMain2.Rows.Add(newRow);
            }
        }
Beispiel #3
0
        public static List <ApplicationUserDataModel> GetAllApplicationUserList(RequestProfile requestProfile)
        {
            var sql = "EXEC dbo.ApplicationUserSearch " +
                      " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                      ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, null);

            var result = new List <ApplicationUserDataModel>();

            using (var reader = new DBDataReader("Get List", sql, DataStoreKey))
            {
                var dbReader = reader.DBReader;

                while (dbReader.Read())
                {
                    var dataItem = new ApplicationUserDataModel();

                    dataItem.ApplicationUserId       = (int)dbReader[ApplicationUserDataModel.DataColumns.ApplicationUserId];
                    dataItem.ApplicationUserName     = dbReader[ApplicationUserDataModel.DataColumns.ApplicationUserName].ToString();
                    dataItem.FirstName               = dbReader[ApplicationUserDataModel.DataColumns.FirstName].ToString();
                    dataItem.LastName                = dbReader[ApplicationUserDataModel.DataColumns.LastName].ToString();
                    dataItem.MiddleName              = dbReader[ApplicationUserDataModel.DataColumns.MiddleName].ToString();
                    dataItem.EmailAddress            = dbReader[ApplicationUserDataModel.DataColumns.EmailAddress].ToString();
                    dataItem.ApplicationCode         = dbReader[ApplicationUserDataModel.DataColumns.ApplicationCode].ToString();
                    dataItem.FullName                = dataItem.FirstName + " ";
                    dataItem.FullName               += dataItem.MiddleName == string.Empty || dataItem.MiddleName == "." ? (dataItem.LastName) : (dataItem.MiddleName + " " + dataItem.LastName);
                    dataItem.ApplicationUserFullName = dbReader[ApplicationUserDataModel.DataColumns.FirstName]
                                                       + " " + dbReader[ApplicationUserDataModel.DataColumns.MiddleName]
                                                       + " " + dbReader[ApplicationUserDataModel.DataColumns.LastName];

                    result.Add(dataItem);
                }
            }

            return(result);
        }
Beispiel #4
0
        public override int?Save(string action)
        {
            var data = new ApplicationUserDataModel();

            data.ApplicationUserId      = ApplicationUserId;
            data.ApplicationUserName    = ApplicationUserName;
            data.EmailAddress           = EmailAddress;
            data.FirstName              = FirstName;
            data.MiddleName             = MiddleName;
            data.LastName               = LastName;
            data.ApplicationUserTitleId = ApplicationUserTitleId;
            data.ApplicationId          = ApplicationId;

            if (action == "Insert")
            {
                var dtApplicationUser = Framework.Components.ApplicationUser.ApplicationUserDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtApplicationUser.Rows.Count == 0)
                {
                    Framework.Components.ApplicationUser.ApplicationUserDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                Framework.Components.ApplicationUser.ApplicationUserDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(ApplicationUserId);
        }
Beispiel #5
0
        protected void lnkSave_Click(object sender, EventArgs e)
        {
            for (var i = 0; i < rptrApplicationUser.Items.Count; i++)
            {
                if (rptrApplicationUser.Items[i].ItemType == ListItemType.Item || rptrApplicationUser.Items[i].ItemType == ListItemType.AlternatingItem)
                {
                    Label   lblApplicationUserId   = rptrApplicationUser.Items[i].FindControl("lblApplicationUserId") as Label;
                    TextBox txtFirstName           = rptrApplicationUser.Items[i].FindControl("txtFirstName") as TextBox;
                    TextBox txtLastName            = rptrApplicationUser.Items[i].FindControl("txtLastName") as TextBox;
                    var     txtApplicationUserName = rptrApplicationUser.Items[i].FindControl("txtApplicationUserName") as TextBox;
                    if (lblApplicationUserId != null)
                    {
                        var data    = new ApplicationUserDataModel();
                        var AuditId = SessionVariables.RequestProfile.AuditId;
                        data.ApplicationUserId   = int.Parse(lblApplicationUserId.Text);
                        data.ApplicationUserName = txtApplicationUserName.Text.Trim();
                        data.LastName            = txtLastName.Text;
                        data.FirstName           = txtFirstName.Text;

                        Framework.Components.ApplicationUser.ApplicationUserDataManager.Update(data, SessionVariables.RequestProfile);
                    }
                }
            }
            Response.Redirect("Default.aspx?Added=true", false);
        }
Beispiel #6
0
        public static List <ApplicationUserDataModel> GetEntityDetails(ApplicationUserDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails)
        {
            const string sql = @"dbo.ApplicationUserSearch ";

            var parameters =
                new
            {
                AuditId                  = requestProfile.AuditId
                , ApplicationId          = requestProfile.ApplicationId
                , ReturnAuditInfo        = returnAuditInfo
                , ApplicationMode        = requestProfile.ApplicationModeId
                , ApplicationUserId      = dataQuery.ApplicationUserId
                , ApplicationUserName    = dataQuery.ApplicationUserName
                , EmailAddress           = dataQuery.EmailAddress
                , FirstName              = dataQuery.FirstName
                , MiddleName             = dataQuery.MiddleName
                , LastName               = dataQuery.LastName
                , ApplicationUserTitleId = dataQuery.ApplicationUserTitleId
            };

            List <ApplicationUserDataModel> result;

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                result = dataAccess.Connection.Query <ApplicationUserDataModel>(sql, parameters, commandType: CommandType.StoredProcedure).ToList();
            }

            return(result);
        }
Beispiel #7
0
        protected void btnSubmit_OnClick(object sender, EventArgs e)
        {
            var data = new ApplicationUserDataModel();

            data.ApplicationUserId = int.Parse(drpApplicationUser.SelectedValue);
            var dt = ApplicationUserDataManager.GetDetails(data, SessionVariables.RequestProfile);

            txtPersonId.Text    = dt.Rows[0][ApplicationUserDataModel.DataColumns.ApplicationUserName].ToString();
            txtPersonId.Visible = true;

            var result      = GetWorkCategoryDetails(int.Parse(drpApplicationUser.SelectedValue));
            var groupedList = result
                              .GroupBy(u => u.Week)
                              .Select(grp => grp.ToList())
                              .ToList();
            var categorizedList = new List <ResultSet>();
            var finalList       = new List <List <ResultSet> >();

            for (var i = 0; i < groupedList.Count; i++)
            {
                categorizedList = groupedList[i]
                                  .GroupBy(u => u.Category)
                                  .Select(grp => new ResultSet("", "", 0)
                {
                    Category = grp.First().Category,
                    Week     = grp.First().Week,
                    Value    = grp.Sum(u1 => u1.Value),
                }).ToList();

                finalList.Add(categorizedList);
            }
            rpt.DataSource = finalList.ToList();
            rpt.DataBind();
        }
Beispiel #8
0
        public void LoadData(int applicationUserId)
        {
            var oData = new ApplicationUserDataModel();

            oData.ApplicationUserId = applicationUserId;

            var oApplicationUserTable = ApplicationUserDataManager.GetDetails(oData, SessionVariables.RequestProfile);

            if (oApplicationUserTable.Rows.Count == 1)
            {
                var row = oApplicationUserTable.Rows[0];
                txtApplicationUserName.Text = row[ApplicationUserDataModel.DataColumns.ApplicationUserName].ToString();
                txtEmailAddress.Text        = row[ApplicationUserDataModel.DataColumns.EmailAddress].ToString();
                txtLastName.Text            = row[ApplicationUserDataModel.DataColumns.LastName].ToString();
                txtFirstName.Text           = row[ApplicationUserDataModel.DataColumns.FirstName].ToString();
                txtMiddleName.Text          = row[ApplicationUserDataModel.DataColumns.MiddleName].ToString();

                drpApplicationUserTitle.SelectedValue = Convert.ToString(row[ApplicationUserDataModel.DataColumns.ApplicationUserTitleId]);
                txtApplicationUserTitle.Text          = Convert.ToString(row[ApplicationUserDataModel.DataColumns.ApplicationUserTitleId]);
            }
            else
            {
                txtLastName.Text             = String.Empty;
                txtFirstName.Text            = String.Empty;
                txtMiddleName.Text           = String.Empty;
                txtApplicationUserTitle.Text = String.Empty;
                txtEmailAddress.Text         = string.Empty;
                txtApplicationUserName.Text  = String.Empty;
            }
        }
Beispiel #9
0
        protected override void ShowData(int ApplicationUserId)
        {
            base.ShowData(ApplicationUserId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var dataQuery = new ApplicationUserDataModel();

            dataQuery.ApplicationUserId = ApplicationUserId;

            var entityList = Framework.Components.ApplicationUser.ApplicationUserDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile);

            if (entityList.Count == 1)
            {
                foreach (var entityItem in entityList)
                {
                    lblApplicationUserId.Text    = entityItem.ApplicationUserId.ToString();
                    lblApplicationUserName.Text  = entityItem.ApplicationUserName;
                    lblEmailAddress.Text         = entityItem.EmailAddress;
                    lblLastName.Text             = entityItem.LastName;
                    lblFirstName.Text            = entityItem.FirstName;
                    lblMiddleName.Text           = entityItem.MiddleName;
                    lblApplicationUserTitle.Text = entityItem.ApplicationUserTitle;
                    lblApplication.Text          = entityItem.Application;

                    oUpdateInfo.LoadText(entityItem.UpdatedDate, entityItem.UpdatedBy, entityItem.LastAction);

                    oHistoryList.Setup(PrimaryEntity, ApplicationUserId, "ApplicationUser");
                }
            }
        }
Beispiel #10
0
        public static DataTable DoesExist(ApplicationUserDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new ApplicationUserDataModel();

            doesExistRequest.ApplicationUserName = data.ApplicationUserName;

            return(Search(doesExistRequest, requestProfile));
        }
Beispiel #11
0
        public static DataTable Search(ApplicationUserDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 0);

            var table = list.ToDataTable();

            return(table);
        }
Beispiel #12
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new ApplicationUserDataModel();

            var dt = Framework.Components.ApplicationUser.ApplicationUserDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Beispiel #13
0
        public static string GetFullName(ApplicationUserDataModel data, RequestProfile requestProfile)
        {
            var dr    = GetFullNameDetails(data, requestProfile).Rows[0];
            var value = dr["FirstName"]
                        + " " + dr["MiddleName"]
                        + " " + dr["LastName"];

            return(value);
        }
Beispiel #14
0
        protected override void Clear()
        {
            base.Clear();

            var data = new ApplicationUserDataModel();


            ApplicationId = data.ApplicationId;
        }
Beispiel #15
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var applicationUserdata = new ApplicationUserDataModel();

            applicationUserdata.ApplicationUserId = entityKey;
            var results = Framework.Components.ApplicationUser.ApplicationUserDataManager.Search(applicationUserdata, SessionVariables.RequestProfile);

            return(results);
        }
Beispiel #16
0
        private DataTable GetApplicationUserData(int applicationId)
        {
            var data = new ApplicationUserDataModel();
            //data.ApplicationId = applicationId;

            var dt = Framework.Components.ApplicationUser.ApplicationUserDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Beispiel #17
0
        public IEnumerable <ApplicationUserDataModel> ListUsers()
        {
            var data = new ApplicationUserDataModel();

            data.ApplicationId = SessionVariables.RequestProfile.ApplicationId;
            var listUsers = ApplicationUserDataManager.GetEntityDetails(data, SessionVariables.RequestProfile, ApplicationCommon.ReturnAuditInfo);

            return(listUsers);
        }
Beispiel #18
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new ApplicationUserDataModel();

            // copies properties from values dictionary object to data object
            PropertyMapper.CopyProperties(data, values);

            Framework.Components.ApplicationUser.ApplicationUserDataManager.Update(data, SessionVariables.RequestProfile);
            base.Update(values);
        }
Beispiel #19
0
        private DataTable GetData(string name)
        {
            var data = new ApplicationUserDataModel();

            data.LastName = name;

            var dt = Framework.Components.ApplicationUser.ApplicationUserDataManager.Search(data, AuditId, SessionVariables.ApplicationMode);

            return(dt);
        }
Beispiel #20
0
        private static DataSet GetChildren(ApplicationUserDataModel data, RequestProfile requestProfile)
        {
            var sql = "EXEC dbo.ApplicationUserChildrenGet " +
                      " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                      ", " + ToSQLParameter(data, ApplicationUserDataModel.DataColumns.ApplicationUserId);

            var oDT = new DataAccess.DBDataSet("Get Children", sql, DataStoreKey);

            return(oDT.DBDataset);
        }
Beispiel #21
0
        public static bool DoesExist(ApplicationUserDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new ApplicationUserDataModel();

            doesExistRequest.ApplicationUserName = data.ApplicationUserName;
            doesExistRequest.ApplicationId       = data.ApplicationId;

            var list = GetEntityDetails(doesExistRequest, requestProfile, 0);

            return(list.Count > 0);
        }
        public async Task <IdentityResult> Register(RegisterModel model)
        {
            var applicationUser = new ApplicationUserDataModel
            {
                Email         = model.Email,
                SecurityStamp = Guid.NewGuid().ToString(),
                UserName      = model.Username
            };

            return(await _authenticationAuthorizationRepo.Register(applicationUser, model.Password));
        }
Beispiel #23
0
        private void PopulateDropDownList()
        {
            //parent

            var ApplicationEntry = Framework.Components.ApplicationUser.ApplicationDataManager.GetList(SessionVariables.RequestProfile);

            drpApplication.DataSource     = ApplicationEntry.DefaultView;
            drpApplication.DataTextField  = "Name";
            drpApplication.DataValueField = "ApplicationId";
            drpApplication.DataBind();

            ApplicationUserDataModel data = new ApplicationUserDataModel();
            //data.ApplicationId = Convert.ToInt32(drpApplication.SelectedItem.Value);
            var ApplicationUserEntry = Framework.Components.ApplicationUser.ApplicationUserDataManager.Search(data, SessionVariables.RequestProfile);

            drpApplicationUser.DataSource     = ApplicationUserEntry.DefaultView;
            drpApplicationUser.DataTextField  = "Name";
            drpApplicationUser.DataValueField = "ApplicationUserId";
            drpApplicationUser.DataBind();


            if (drpApplicationUser.Items.Count == 0)
            {
                drpApplicationUser.Items.Add(new ListItem("None", "-1"));
            }


            //Source List
            var ApplicationRoleEntry = Framework.Components.ApplicationUser.ApplicationRoleDataManager.GetList(SessionVariables.RequestProfile);

            lstSourceApplicationRole.DataSource     = ApplicationRoleEntry.DefaultView;
            lstSourceApplicationRole.DataTextField  = "Name";
            lstSourceApplicationRole.DataValueField = "ApplicationRoleId";
            lstSourceApplicationRole.DataBind();

            PopulateTargetApplicationRole();
            CleanUpApplicationRole();

            drpApplicationRole.DataSource     = ApplicationRoleEntry.DefaultView;
            drpApplicationRole.DataTextField  = "Name";
            drpApplicationRole.DataValueField = "ApplicationRoleId";
            drpApplicationRole.DataBind();

            ApplicationUserEntry = Framework.Components.ApplicationUser.ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);
            lstSourceApplicationUser.DataSource     = ApplicationUserEntry.DefaultView;
            lstSourceApplicationUser.DataTextField  = "Name";
            lstSourceApplicationUser.DataValueField = "ApplicationUserId";
            lstSourceApplicationUser.DataBind();

            PopulateTargetApplicationUser();
            CleanUpApplicationUser();
        }
Beispiel #24
0
 public void LoadApplicationUserName(ApplicationUserDataModel item)
 {
     try
     {
         txtApplicationUserName.Text           = item.ApplicationUserName;
         txtEmailAddress.Text                  = item.EmailAddress;
         txtLastName.Text                      = item.LastName;
         txtFirstName.Text                     = item.FirstName;
         txtMiddleName.Text                    = item.MiddleName;
         drpApplicationUserTitle.SelectedValue = item.ApplicationUserTitleId.ToString();
         txtApplicationUserTitle.Text          = item.ApplicationUserTitleId.ToString();
     }
     catch { }
 }
Beispiel #25
0
        private void GetCurrentUserEmailAddress()
        {
            var data = new ApplicationUserDataModel();

            data.ApplicationId       = SessionVariables.RequestProfile.ApplicationId;
            data.ApplicationUserName = SessionVariables.ApplicationUserName;

            DataTable dt = ApplicationUserDataManager.Search(data, SessionVariables.RequestProfile);

            if (dt.Rows.Count == 1)
            {
                txtEmailAddress.Text = dt.Rows[0]["EmailAddress"].ToString();
            }
        }
Beispiel #26
0
        public static void Delete(ApplicationUserDataModel dataQuery, RequestProfile requestProfile)
        {
            const string sql = @"dbo.ApplicationUserDelete ";

            var parameters =
                new
            {
                AuditId             = requestProfile.AuditId
                , ApplicationUserId = dataQuery.ApplicationUserId
            };

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure);
            }
        }
Beispiel #27
0
        private string GetApplicationUserName(int applicationUserId)
        {
            var applicationUserName = string.Empty;
            var data = new ApplicationUserDataModel();

            data.ApplicationUserId = applicationUserId;

            DataTable dt = ApplicationUserDataManager.Search(data, SessionVariables.RequestProfile);

            if (dt.Rows.Count == 1)
            {
                applicationUserName = dt.Rows[0][ApplicationUserDataModel.DataColumns.ApplicationUserName].ToString();
            }

            return(applicationUserName);
        }
Beispiel #28
0
        public static int GetCurrentUserId(int applicationId)
        {
            var aplicationUserEmail = string.Empty;              // set the PersonId of the user you want to log-in with
            var aplicationUserId    = 0;

            try
            {
                var strFilePath = HttpContext.Current.Server.MapPath("~/");
                var strFileName = "MyConfigurations.xml";
                var doc         = new XmlDocument();

                doc.Load(strFilePath + "//" + strFileName);
                var documentElement = doc.DocumentElement;

                if (documentElement != null)
                {
                    var xConfiguration = documentElement.FirstChild;
                    if (xConfiguration.Name == "Configuration")
                    {
                        foreach (XmlNode configChild in xConfiguration.ChildNodes)
                        {
                            if (configChild.Name == "ApplicationUserEmail")
                            {
                                aplicationUserEmail = configChild.InnerText;
                                break;
                            }
                        }
                    }
                }
            }
            catch { }

            if (!string.IsNullOrEmpty(aplicationUserEmail))
            {
                var applicationUserData = new ApplicationUserDataModel();
                applicationUserData.EmailAddress  = aplicationUserEmail;
                applicationUserData.ApplicationId = applicationId;

                var dt = Framework.Components.ApplicationUser.ApplicationUserDataManager.Search(applicationUserData, SessionVariables.SystemRequestProfile);
                if (dt != null && dt.Rows.Count > 0)
                {
                    aplicationUserId = Convert.ToInt32(dt.Rows[0][ApplicationUserDataModel.DataColumns.ApplicationUserId]);
                }
            }

            return(aplicationUserId);
        }
Beispiel #29
0
        public static bool IsDeletable(ApplicationUserDataModel data, RequestProfile requestProfile)
        {
            var isDeletable = true;
            var ds          = GetChildren(data, requestProfile);

            if (ds != null && ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        isDeletable = false;
                        break;
                    }
                }
            }
            return(isDeletable);
        }
Beispiel #30
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         var      notDeletableIds = new List <int>();
         string[] deleteIndexList = DeleteIds.Split(',');
         foreach (string index in deleteIndexList)
         {
             var data = new ApplicationUserDataModel();
             data.ApplicationUserId = int.Parse(index);
             if (!Framework.Components.ApplicationUser.ApplicationUserDataManager.IsDeletable(data, SessionVariables.RequestProfile))
             {
                 notDeletableIds.Add(Convert.ToInt32(data.ApplicationUserId));
             }
         }
         if (notDeletableIds.Count == 0)
         {
             foreach (string index in deleteIndexList)
             {
                 var data = new ApplicationUserDataModel();
                 data.ApplicationUserId = int.Parse(index);
                 Framework.Components.ApplicationUser.ApplicationUserDataManager.Delete(data, SessionVariables.RequestProfile);
             }
             DeleteAndRedirect();
         }
         else
         {
             var msg = String.Empty;
             foreach (var id in notDeletableIds)
             {
                 if (!string.IsNullOrEmpty(msg))
                 {
                     msg += ", <br/>";
                 }
                 msg += "ApplicationUserId: " + id + " has detail records";
             }
             Response.Write(msg);
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }