Пример #1
0
        /// <summary>
        /// Gets the team details.
        /// </summary>
        /// <returns></returns>
        private TeamDetails GetTeamDetails()
        {
            /// Assign the values to the object of UserDetails class
            TeamDetails objTeamDetails = new TeamDetails();
            objTeamDetails.TeamName = txtTeamName.Text.Trim();

            if (string.Compare(strMode, ADD) == 0)
            {
                objTeamDetails.Terminated = STATUSACTIVE;
            }
            else if (string.Compare(strMode, EDIT) == 0)
            {
                objTeamDetails.Terminated = STATUSTERMINATED;
                objTeamDetails.RowId = Int32.Parse(HttpContext.Current.Request.QueryString[IDVALUEQUERYSTRING]);
            }
            if (cboAssetOwner.SelectedItem != null)
            {
                objTeamDetails.AssetOwner = cboAssetOwner.SelectedItem.Text;
                objTeamDetails.AssetOwnerID = cboAssetOwner.SelectedItem.Value;
            }

            return objTeamDetails;
        }
Пример #2
0
        /// <summary>
        /// Gets the details of the selected Team
        /// </summary>
        /// <param name="siteUrl">Site URL.</param>
        /// <param name="selectedID">Team ID.</param>
        /// <param name="listName">List Name.</param>
        /// <exception>Handled in calling class</exception>
        /// <returns>List Entry object.</returns>
        internal ListEntry GetTeamDetails(string siteUrl, string selectedID, string listName)
        {
            ListEntry objListEntry = null;
            SPList list;
            SPListItem objListItem;

            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite site = new SPSite(siteUrl))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        list = web.Lists[listName];

                        string strCAMLQuery = @"<Where><Eq><FieldRef Name='ID'/><Value Type='Counter'>" + selectedID + "</Value></Eq></Where>";
                        string strViewFields = @"<FieldRef Name='Title'/><FieldRef Name='Asset_Owner'/><FieldRef Name='Terminate_Status'/><FieldRef Name='ID'/>";

                        SPQuery query = new SPQuery();
                        query.Query = strCAMLQuery;
                        query.ViewFields = strViewFields;

                        SPListItemCollection listItemCollection = list.GetItems(query);
                        if (listItemCollection != null && listItemCollection.Count > 0)
                        {
                            objListItem = listItemCollection[0];

                            if (objListItem != null)
                            {
                                objListEntry = new ListEntry();
                                TeamDetails objTeamDetails = new TeamDetails();
                                objTeamDetails.TeamName = Convert.ToString(objListItem["Title"]);
                                objTeamDetails.AssetOwner = Convert.ToString(objListItem["Asset_Owner"]);
                                objTeamDetails.Terminated = Convert.ToString(objListItem["Terminate_Status"]);
                                objTeamDetails.RowId = Convert.ToInt32(objListItem["ID"]);

                                objListEntry.TeamDetails = objTeamDetails;
                            }
                        }
                    }
                }
            });

            return objListEntry;
        }
Пример #3
0
        /// <summary>
        /// Gets the selected teams while creating new user.
        /// </summary>
        /// <returns></returns>
        private ArrayList GetTeams()
        {
            ArrayList arlTeams = new ArrayList();
            TeamDetails objTeamDetails = null;
            foreach (ListItem item in lstTeams.Items)
            {
                if (item.Selected)
                {
                    objTeamDetails = new TeamDetails();
                    objTeamDetails.RowId = Int32.Parse(item.Value);
                    objTeamDetails.TeamName = item.Text;
                    arlTeams.Add(objTeamDetails);
                }
            }

            return arlTeams;
        }