/// <summary> /// Handles the Click event of the CmdSave control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void CmdSave_Click(object sender, EventArgs e) { try { objUtility = new CommonUtility(); objMossController = objFactory.GetServiceManager("MossService"); Dictionary<string, string> dicListValues = null; //read from the USERRegistration list the staff list for the particular team. string strStaffQuery = "<Where><And><And><Eq><FieldRef Name=\"TeamID\" /><Value Type=\"Text\">" + Request.QueryString["idValue"].ToString() + "</Value></Eq><Eq><FieldRef Name=\"IsTeamOwner\"/><Value Type=\"Text\">No</Value></Eq></And><Eq><FieldRef Name=\"Active\"/><Value Type=\"Text\">Yes</Value></Eq></And></Where>"; DataTable dtTeamStaff = ((MOSSServiceManager)objMossController).ReadList(strCurrSiteUrl, USERACCESSREQUESTLIST, strStaffQuery); ArrayList arlTeamStaff = new ArrayList(); foreach (DataRow objRow in dtTeamStaff.Rows) { arlTeamStaff.Add(objRow["ID"].ToString()); } /// Multi Team Owner Implementation /// Changed By: Yasotha /// Date : 20-Jan-2010 foreach (ListItem objItem in dualManageStaff.RightItems) { if (arlTeamStaff.Count > 0) { if (!arlTeamStaff.Contains(objItem.Value) && (!hidTeamOwnerUserId.Value.Contains(objItem.Value))) /// Multi Team Owner Implementation /// End { dicListValues = new Dictionary<string, string>(); dicListValues.Add("ID", objItem.Value); dicListValues.Add("TeamID", Request.QueryString["idValue"].ToString()); ((MOSSServiceManager)objMossController).UpdateListItem(dicListValues, USERACCESSREQUESTLIST); objUtility.SendEmailForTeamAccessStatus(objItem.Value, "Approved", Request.QueryString["idValue"].ToString()); } } else { /// Multi Team Owner Implementation /// Changed By: Yasotha /// Date : 20-Jan-2010 if (!hidTeamOwnerUserId.Value.Contains(objItem.Value)) { /// Multi Team Owner Implementation /// End dicListValues = new Dictionary<string, string>(); dicListValues.Add("ID", objItem.Value); dicListValues.Add("TeamID", Request.QueryString["idValue"].ToString()); ((MOSSServiceManager)objMossController).UpdateListItem(dicListValues, USERACCESSREQUESTLIST); objUtility.SendEmailForTeamAccessStatus(objItem.Value, "Approved", Request.QueryString["idValue"].ToString()); } } } foreach (ListItem objItem in dualManageStaff.LeftItems) { if (arlTeamStaff.Count > 0) { if (arlTeamStaff.Contains(objItem.Value)) { dicListValues = new Dictionary<string, string>(); dicListValues.Add("ID", objItem.Value); dicListValues.Add("TeamID", "0"); ((MOSSServiceManager)objMossController).UpdateListItem(dicListValues, USERACCESSREQUESTLIST); objUtility.SendEmailForTeamAccessStatus(objItem.Value, "Rejected", Request.QueryString["idValue"].ToString()); } } } string strPermission = objUtility.GetTeamPermission(strCurrSiteUrl); objMossController = objFactory.GetServiceManager("MossService"); if ((!((MOSSServiceManager)objMossController).IsAdmin(strCurrSiteUrl, HttpContext.Current.User.Identity.Name)) && (string.Equals(strPermission, TEAMOWNERPERMISSION))) Response.Redirect("/Pages/MyTeam.aspx", false); else if (((MOSSServiceManager)objMossController).IsAdmin(strCurrSiteUrl, HttpContext.Current.User.Identity.Name)) Response.Redirect("/Pages/TeamManagement.aspx", false); } catch (WebException webEx) { ShowLableMessage(webEx.Message); } catch (Exception ex) { CommonUtility.HandleException(strCurrSiteUrl, ex); } }