protected void btnSave_Click(object sender, EventArgs e) { groupLogic = new GroupModel(); preferencesLogic = new PreferencesModel(); int oldDefaultGroupID = groupLogic.GetDefaultGroupID(); int oldAdminGroupID = groupLogic.GetGroupList().Single(g => g.IsAdmin == true).GroupID; int newDefaultGroupID = Convert.ToInt32(ddlDefaultGroup.SelectedValue); int newAdminGroupID = Convert.ToInt32(ddlAdminGroup.SelectedValue); if (oldDefaultGroupID != newDefaultGroupID) { //Update Default Group groupLogic.UpdateGroup(null, null, newDefaultGroupID, true, false); // >> Update Old Default Group groupLogic.UpdateGroup(null, null, oldDefaultGroupID, false, false); } if (oldAdminGroupID != newAdminGroupID) { //Update Admin Group groupLogic.UpdateGroup(null, null, newAdminGroupID, false, true); // >> Update Old Admin Group groupLogic.UpdateGroup(null, null, oldAdminGroupID, false, false); } //Update File Server - System Settings preferencesLogic.UpdatePreferences("FileServer", txtFileServer.Text); //Update Thumbnail Path - System Settings preferencesLogic.UpdatePreferences("ThumbnailPath", txtThumbPath.Text); //Update Webmaster Email - System Settings preferencesLogic.UpdatePreferences("WebmasterEmail", txtWebmasterEmail.Text); //Update Search Module - Module Settings preferencesLogic.UpdatePreferences("SearchModule", cbSearchBoxModule.Checked.ToString()); //Update Login Module - Module Settings preferencesLogic.UpdatePreferences("LoginModule", cbLoginBoxModule.Checked.ToString()); //Update Most View & Most Rate Module - Module Settings preferencesLogic.UpdatePreferences("MostViewMostRateModule", cbMostViewRateBoxModule.Checked.ToString()); preferencesLogic.UpdatePreferences("MostViewMostRate_Amount", txtMostViewRateBoxModuleAmount.Text); //Update Random & Most Download Module -Module Settings preferencesLogic.UpdatePreferences("RandomMostDownloadModule", cbRandomDownloadBoxModule.Checked.ToString()); preferencesLogic.UpdatePreferences("RandomMostDownload_Amount", txtRandomDownloadBoxModuleAmount.Text); //Update Category Module - Module Settings preferencesLogic.UpdatePreferences("CategoryModule", cbCategoryModule.Checked.ToString()); }