예제 #1
0
    protected void EditCategories_Click(object sender, EventArgs e)
    {
        try
        {
            PRMS controller = new PRMS();
            controller.DeleteUserCategories(CurrentUserID);

            #region add professions
            List<int> professions = (List<int>)Session["professions"];
            foreach (int profession in professions)
            {
                controller.AddUserProfessions(CurrentUserID, profession);
            }

            #endregion

            #region add skills
            List<int> skills = (List<int>)Session["skills"];
            foreach (int skill in skills)
            {
                controller.AddUserSkills(CurrentUserID, skill);
            }

            #endregion
            #region add regions
            List<int> regions = (List<int>)Session["regions"];
            foreach (int region in regions)
            {
                controller.AddUserRegions(CurrentUserID, region);
            }
            #endregion
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Categories have been updated successfully.')", true);
        }
        catch {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with udpating categories. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }