Exemple #1
0
        private void BinddgMembers()
        {
            dt = CalendarEntry.GetListEventResourcesDataTable(EventID);

            bool isinres = false;

            int _UserID = 0;

            using (IDataReader rdr = CalendarEntry.GetEvent(EventID))
            {
                if (rdr.Read())
                {
                    _UserID = (int)rdr["ManagerId"];
                }
            }

            foreach (DataRow dr in dt.Rows)
            {
                if ((int)dr["PrincipalId"] == _UserID)
                {
                    isinres = true;
                }
            }

            if (!isinres)
            {
                DataRow dr = dt.NewRow();

                dr["PrincipalId"]     = _UserID;
                dr["IsGroup"]         = false;
                dr["MustBeConfirmed"] = false;
                dr["ResponsePending"] = false;

                dt.Rows.InsertAt(dr, 0);
            }

            dgMembers.DataSource = dt;
            dgMembers.DataBind();
        }
        private void GetEventData()
        {
            int UserID = 0;

            using (IDataReader rdr = CalendarEntry.GetEvent(EventID))
            {
                if (rdr.Read())
                {
                    UserID = (int)rdr["ManagerId"];
                }
            }

            DataTable dt      = CalendarEntry.GetListEventResourcesDataTable(EventID);
            bool      isinres = false;

            foreach (DataRow dr in dt.Rows)
            {
                if ((int)dr["PrincipalId"] == UserID)
                {
                    isinres = true;
                }
            }

            if (!isinres)
            {
                DataRow dr = dt.NewRow();

                dr["PrincipalId"]     = UserID;
                dr["IsGroup"]         = false;
                dr["MustBeConfirmed"] = false;
                dr["ResponsePending"] = false;

                dt.Rows.InsertAt(dr, 0);
            }

            ViewState["Participants"] = dt;
        }