Esempio n. 1
0
 /// <summary>
 /// Handles the Click event of the CmdCancel 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 CmdCancel_Click(object sender, EventArgs e)
 {
     objUtility = new CommonUtility();
     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);
 }
Esempio n. 2
0
 /// <summary>
 /// Called by the ASP.NET page framework to notify server controls 
 /// that use composition-based implementation to create any child controls they contain  
 /// in preparation for posting back or rendering.
 /// </summary>
 protected override void CreateChildControls()
 {
     base.CreateChildControls();
     try
     {
         objCommonUtility = new CommonUtility();
         objMOSSController = objFactory.GetServiceManager("MossService");
         strUserName = objCommonUtility.GetUserName();
         Permission = objCommonUtility.GetTeamPermission(HttpContext.Current.Request.Url.ToString());
         CreateViewerControls();
     }
     catch (Exception ex)
     {
         CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex);
     }
 }
Esempio n. 3
0
        /// <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);
            }
        }