Beispiel #1
0
 public static void NewTeamMailboxPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
 {
     TeamMailbox.TeamMailboxPostAction(inputRow, dataTable, store);
     foreach (object obj in dataTable.Rows)
     {
         DataRow dataRow = (DataRow)obj;
         dataRow["Owners"] = new ADObjectId[]
         {
             RbacPrincipal.Current.ExecutingUserId
         };
     }
 }
Beispiel #2
0
        public static void TeamMailboxPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            foreach (object obj in dataTable.Rows)
            {
                DataRow dataRow = (DataRow)obj;
                dataRow["IsOwner"] = TeamMailbox.IsExecutingUserAnOwner(dataRow["Owners"]);
                if (dataRow["Active"] is bool)
                {
                    if ((bool)dataRow["Active"])
                    {
                        dataRow["Status"] = OwaOptionClientStrings.TeamMailboxLifecycleActive;
                    }
                    else
                    {
                        dataRow["Status"]     = OwaOptionClientStrings.TeamMailboxLifecycleClosed;
                        dataRow["ClosedTime"] = ((DateTime)dataRow["ClosedTime"]).UtcToUserDateString();
                    }
                    dataRow["IsEditable"] = ((bool)dataRow["IsOwner"] && (bool)dataRow["Active"]);
                }
                int userCount = TeamMailbox.GetUserCount(dataRow["Members"]);
                if (userCount == 0)
                {
                    dataRow["MembersNumber"] = "0";
                }
                else
                {
                    dataRow["MembersNumber"] = userCount;
                }
                dataRow["SPSiteLinked"] = ((dataRow["SharePointLinkedBy"] is ADObjectId) ? OwaOptionClientStrings.TeamMailboxSharePointConnectedTrue : OwaOptionClientStrings.TeamMailboxSharePointConnectedFalse);
                if (dataRow["MyRole"] is string)
                {
                    string a;
                    if ((a = (string)dataRow["MyRole"]) != null)
                    {
                        if (a == "Owner")
                        {
                            dataRow["MyRole"] = OwaOptionClientStrings.TeamMailboxYourRoleOwner;
                            goto IL_1B1;
                        }
                        if (a == "Member")
                        {
                            dataRow["MyRole"] = OwaOptionClientStrings.TeamMailboxYourRoleMember;
                            goto IL_1B1;
                        }
                    }
                    dataRow["MyRole"] = OwaOptionClientStrings.TeamMailboxYourRoleNoAccess;
                }
IL_1B1:
                dataRow["ExecutingUserId"]          = RbacPrincipal.Current.ExecutingUserId;
                dataRow["MailToPrimarySmtpAddress"] = "mailto:" + dataRow["PrimarySmtpAddress"];
            }
        }