Esempio n. 1
0
        public static void UpdateReminderSubscriptionGlobal(
            int ProjectStartDateLag, int ProjectFinishDateLag,
            int CalendarEntryStartDateLag, int CalendarEntryFinishDateLag,
            int TaskStartDateLag, int TaskFinishDateLag,
            int TodoStartDateLag, int TodoFinishDateLag,
            int assignmentFinishDateLag)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                UpdateReminderSubscriptionGlobal(DateTypes.Project_StartDate, ProjectStartDateLag >= 0 ? ProjectStartDateLag : 0, ProjectStartDateLag >= 0);
                UpdateReminderSubscriptionGlobal(DateTypes.Project_FinishDate, ProjectFinishDateLag >= 0 ? ProjectFinishDateLag : 0, ProjectFinishDateLag >= 0);

                UpdateReminderSubscriptionGlobal(DateTypes.CalendarEntry_StartDate, CalendarEntryStartDateLag >= 0 ? CalendarEntryStartDateLag : 0, CalendarEntryStartDateLag >= 0);
                UpdateReminderSubscriptionGlobal(DateTypes.CalendarEntry_FinishDate, CalendarEntryFinishDateLag >= 0 ? CalendarEntryFinishDateLag : 0, CalendarEntryFinishDateLag >= 0);

                UpdateReminderSubscriptionGlobal(DateTypes.Task_StartDate, TaskStartDateLag >= 0 ? TaskStartDateLag : 0, TaskStartDateLag >= 0);
                UpdateReminderSubscriptionGlobal(DateTypes.Task_FinishDate, TaskFinishDateLag >= 0 ? TaskFinishDateLag : 0, TaskFinishDateLag >= 0);

                UpdateReminderSubscriptionGlobal(DateTypes.Todo_StartDate, TodoStartDateLag >= 0 ? TodoStartDateLag : 0, TodoStartDateLag >= 0);
                UpdateReminderSubscriptionGlobal(DateTypes.Todo_FinishDate, TodoFinishDateLag >= 0 ? TodoFinishDateLag : 0, TodoFinishDateLag >= 0);

                UpdateReminderSubscriptionGlobal(DateTypes.AssignmentFinishDate, assignmentFinishDateLag >= 0 ? assignmentFinishDateLag : 0, assignmentFinishDateLag >= 0);

                tran.Commit();
            }
        }
Esempio n. 2
0
        //newRespId: UserId OR "-2" - NotSet, "-1" - GroupResponsibility
        public static int AddForumMesageWithResponsibleChange(int IncidentId, int ForumNodeId, int newRespId)
        {
            ForumThreadNodeInfo info = null;

            using (DbTransaction tran = DbTransaction.Begin())
            {
                BaseIbnContainer destContainer = BaseIbnContainer.Create("FileLibrary", string.Format("IncidentId_{0}", IncidentId));
                ForumStorage     forumStorage  = (ForumStorage)destContainer.LoadControl("ForumStorage");
                if (ForumNodeId > 0)
                {
                    info = forumStorage.GetForumThreadNode(ForumNodeId);
                }
                else
                {
                    info = forumStorage.CreateForumThreadNode("", Security.CurrentUser.UserID, (int)ForumStorage.NodeContentType.Text);
                }

                ForumThreadNodeSettingCollection settings = new ForumThreadNodeSettingCollection(info.Id);
//				settings.Add("IssueEvent", IssueEvent.Responsibility.ToString());
                settings.Add(IssueEvent.Responsibility.ToString(), newRespId.ToString());

                tran.Commit();
            }
            return(info.Id);
        }
Esempio n. 3
0
        public static void Delete(int group_id)
        {
            if (!CanDelete(group_id))
            {
                throw new AccessDeniedException();
            }

            int IMGroupId = -1;

            using (IDataReader reader = DBGroup.GetGroup(group_id))
            {
                if (reader.Read())
                {
                    if (reader["IMGroupId"] != DBNull.Value)
                    {
                        IMGroupId = (int)reader["IMGroupId"];
                    }
                }
            }

            using (DbTransaction tran = DbTransaction.Begin())
            {
                DBGroup.Delete(group_id);

                if (IMGroupId > 0)
                {
                    IMGroup.Delete(IMGroupId);
                }

                tran.Commit();
            }
        }
Esempio n. 4
0
        public static void UnRegisterFinances(TimeTrackingBlock block)
        {
            if (!Configuration.TimeTrackingModule)
            {
                throw new Mediachase.Ibn.LicenseRestrictionException();
            }

            if (!(bool)block.Properties["AreFinancesRegistered"].Value)
            {
                throw new NotSupportedException("Finances are not registered.");
            }

            if (!TimeTrackingBlock.CheckUserRight(block, TimeTrackingManager.Right_UnRegFinances))
            {
                throw new Mediachase.Ibn.AccessDeniedException();
            }


            using (DbTransaction tran = DbTransaction.Begin())
            {
                ActualFinances.DeleteByBlockId(block.PrimaryKeyId.Value);

                // O.R. [2008-07-29]: We don't need to check the "Write" right for Block
                using (SkipSecurityCheckScope scope = Mediachase.Ibn.Data.Services.Security.SkipSecurityCheck())
                {
                    block.Properties["AreFinancesRegistered"].Value = false;
                    block.Save();
                }

                // Recalculate TotalMinutes and TotalApproved
                RecalculateProjectAndObjects(block);

                tran.Commit();
            }
        }
Esempio n. 5
0
        internal static void UpdateManager(int documentId, int managerId, bool checkAccess)
        {
            if (checkAccess)
            {
                VerifyCanUpdate(documentId);
            }

            int oldManagerId = DBDocument.GetManager(documentId);

            if (oldManagerId != managerId)
            {
                using (DbTransaction tran = DbTransaction.Begin())
                {
                    DbDocument2.UpdateManager(documentId, managerId);

                    // TODO: implement Document_Updated_Manager
                    // SystemEvents.AddSystemEvents(SystemEventTypes.Document_Updated_Manager, documentId);

                    // OZ: User Role Addon
                    if (managerId != oldManagerId)
                    {
                        UserRoleHelper.DeleteDocumentManagerRole(documentId, oldManagerId);
                        UserRoleHelper.AddDocumentManagerRole(documentId, managerId);
                    }
                    // end OZ

                    tran.Commit();
                }
            }
        }
Esempio n. 6
0
        public static void UpdateAlertInfo(bool EnableAlerts, string FirstName, string LastName, string Email)
        {
            int UserId = -1;

            using (IDataReader reader = DBUser.GetUserInfoByLogin("alert"))
            {
                reader.Read();
                UserId = (int)reader["UserId"];
            }

            try
            {
                using (DbTransaction tran = DbTransaction.Begin())
                {
                    DBUser.UpdateUserInfo(UserId, "", FirstName, LastName, Email, "", "");
                    PortalConfig.EnableAlerts = EnableAlerts;
                    tran.Commit();
                }
            }
            catch (Exception exception)
            {
                if (exception is SqlException)
                {
                    SqlException sqlException = exception as SqlException;
                    if (sqlException.Number == 2627)
                    {
                        throw new EmailDuplicationException();
                    }
                }
                throw;
            }
            Alerts2.Init();
        }
Esempio n. 7
0
        // Batch
        #region Update
        public static void Update(
            int eventId,
            string title,
            string description,
            string location,
            int projectId,
            int managerId,
            int priorityId,
            int typeId,
            DateTime startDate,
            DateTime finishDate,
            ArrayList categories,
            PrimaryKeyId contactUid,
            PrimaryKeyId orgUid)
        {
            VerifyCanUpdate(eventId);

            using (DbTransaction tran = DbTransaction.Begin())
            {
                UpdateGeneralInfo(eventId, typeId, title, description, location, false);
                UpdateProjectAndManager(eventId, projectId, managerId);
                UpdatePriority(eventId, priorityId, false);
                UpdateTimeline(eventId, startDate, finishDate, false);
                UpdateCategories(ListAction.Set, eventId, categories, false);
                UpdateClient(eventId, contactUid, orgUid, false);

                tran.Commit();
            }
        }
Esempio n. 8
0
        public static int CreatePartner(string name, PrimaryKeyId contactUid, PrimaryKeyId orgUid, ArrayList VisibleGroups, byte[] IMGroupLogo)
        {
            if (!Security.IsUserInGroup(InternalSecureGroups.Administrator))
            {
                throw new AccessDeniedException();
            }

            int PartnerId = -1;

            using (DbTransaction tran = DbTransaction.Begin())
            {
                PartnerId = DBGroup.Create((int)InternalSecureGroups.Partner, name);
                foreach (int GroupId in VisibleGroups)
                {
                    DBGroup.AddPartnerGroup(PartnerId, GroupId);
                }

                int IMGroupId = IMGroup.Create(name, "2B6087", true, IMGroupLogo, new ArrayList(), new ArrayList());

                DBGroup.UpdateIMGroupId(PartnerId, IMGroupId);
                DBGroup.UpdateClient(PartnerId, contactUid, orgUid);

                tran.Commit();
            }

            return(PartnerId);
        }
Esempio n. 9
0
        /// <summary>
        /// Updates the list access.
        /// </summary>
        /// <param name="ListId">The list id.</param>
        /// <param name="ListAccess">The list access.</param>
        public static void UpdateListAccess(int ListId, DataTable ListAccess)
        {
            if (!CanAdmin(ListId))
            {
                throw new AccessDeniedException();
            }

            using (DbTransaction tran = DbTransaction.Begin())
            {
                DBListInfo.DeleteListAccessByList(ListId);

                foreach (DataRow row in ListAccess.Rows)
                {
                    int  PrincipalId = (int)row["PrincipalId"];
                    byte AllowLevel  = (byte)row["AllowLevel"];
                    if (AllowLevel < 1 || AllowLevel > 3)
                    {
                        throw new ArgumentOutOfRangeException("AllowLevel", AllowLevel, "should be > 0 and < 3");
                    }
                    DBListInfo.CreateListAccess(ListId, PrincipalId, AllowLevel);
                }

                tran.Commit();
            }
        }
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp            = (CommandParameters)Element;
                string[]          elemsToDelete = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]);

                using (DbTransaction tran = DbTransaction.Begin())
                {
                    foreach (string elem in elemsToDelete)
                    {
                        int id = Convert.ToInt32(elem.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture);
                        if (id > 0)
                        {
                            if (Incident.CanUpdate(id))
                            {
                                Issue2.UpPriority(id, false);
                            }
                        }
                    }
                    tran.Commit();
                }

                CHelper.RequireBindGrid();
            }
        }
Esempio n. 11
0
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp = (CommandParameters)Element;

                int todoId = int.Parse(cp.CommandArguments["ObjectId"]);

                if (cp.CommandArguments.ContainsKey("SelectedValue"))
                {
                    string[] elemsToAdd = cp.CommandArguments["SelectedValue"].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    using (DbTransaction tran = DbTransaction.Begin())
                    {
                        foreach (string elem in elemsToAdd)
                        {
                            int selectedValue = 0;
                            if (int.TryParse(elem, out selectedValue))
                            {
                                if (ToDo.CanUpdate(selectedValue))
                                {
                                    ToDo.CreateToDoLink(selectedValue, todoId);
                                }
                            }
                        }
                        tran.Commit();
                    }
                }

                CHelper.RequireBindGrid();
            }
        }
Esempio n. 12
0
        public static void UpdateCompanyInfo(string supportName, string supportEmail
                                             , string title1, string title2, string text1, string text2
                                             , bool resetCompanyLogo, byte[] companyLogo
                                             , bool resetLogonPageLogo, byte[] logonPageLogo
                                             )
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                PortalConfig.PortalSupportName    = supportName;
                PortalConfig.PortalSupportEmail   = supportEmail;
                PortalConfig.PortalHomepageTitle1 = title1;
                PortalConfig.PortalHomepageTitle2 = title2;
                PortalConfig.PortalHomepageText1  = text1;
                PortalConfig.PortalHomepageText2  = text2;

                if (resetCompanyLogo || companyLogo != null)
                {
                    PortalConfig.PortalCompanyLogo = companyLogo;
                }

                if (resetLogonPageLogo || logonPageLogo != null)
                {
                    PortalConfig.PortalHomepageImage = logonPageLogo;
                }

                tran.Commit();
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Deletes the user.
        /// </summary>
        /// <param name="UserId">The user id.</param>
        public static void DeleteUser(int UserId)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                foreach (IncidentBox box in IncidentBox.List())
                {
                    bool bWasModified = false;

                    if (box.Document.GeneralBlock.ResponsiblePool.Contains(UserId))
                    {
                        box.Document.GeneralBlock.ResponsiblePool.Remove(UserId);
                        bWasModified = true;
                    }

                    if (box.Document.EMailRouterBlock.InformationRecipientList.Contains(UserId))
                    {
                        box.Document.EMailRouterBlock.InformationRecipientList.Remove(UserId);
                        bWasModified = true;
                    }

                    if (bWasModified)
                    {
                        IncidentBoxDocument.Save(box.Document);
                    }
                }

                tran.Commit();
            }
        }
Esempio n. 14
0
        public static void UpdateActualFinancesValueAndDescription(int ActualId,
                                                                   decimal Value, string Description)
        {
            int AccountId;
            int ObjectTypeId, ObjectId;

            using (IDataReader reader = DBFinance.GetActualFinances(ActualId))
            {
                reader.Read();
                AccountId    = (int)reader["AccountId"];
                ObjectTypeId = (int)reader["ObjectTypeId"];
                ObjectId     = (int)reader["ObjectId"];
            }

            if (!CanWork(ObjectTypeId, ObjectId))
            {
                throw new AccessDeniedException();
            }

            using (DbTransaction tran = DbTransaction.Begin())
            {
                DBFinance.UpdateActualFinancesValueAndDescription(ActualId, Value, Description, Security.CurrentUser.UserID);

                RecalculateActualAccounts(AccountId);

                tran.Commit();
            }
        }
Esempio n. 15
0
        public static void DeleteActualFinances(int ActualId)
        {
            int AccountId;
            int ObjectTypeId, ObjectId;

            using (IDataReader reader = DBFinance.GetActualFinances(ActualId))
            {
                reader.Read();
                AccountId    = (int)reader["AccountId"];
                ObjectTypeId = (int)reader["ObjectTypeId"];
                ObjectId     = (int)reader["ObjectId"];
            }

            if (!CanWork(ObjectTypeId, ObjectId))
            {
                throw new AccessDeniedException();
            }

            using (DbTransaction tran = DbTransaction.Begin())
            {
                DBFinance.DeleteActualFinances(ActualId);
                RecalculateActualAccounts(AccountId);

                tran.Commit();
            }
        }
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp            = (CommandParameters)Element;
                string[]          elemsToDelete = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]);
                if (elemsToDelete.Length > 1)
                {
                    using (DbTransaction tran = DbTransaction.Begin())
                    {
                        for (int i = 0; i < elemsToDelete.Length - 1; i++)
                        {
                            for (int j = i + 1; j < elemsToDelete.Length; j++)
                            {
                                int id1 = Convert.ToInt32(elemsToDelete[i].Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture);
                                int id2 = Convert.ToInt32(elemsToDelete[j].Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture);
                                if (id1 > 0 && id2 > 0)
                                {
                                    Project2.AddRelation(id1, id2);
                                }
                            }
                        }

                        tran.Commit();
                    }

                    CHelper.RequireBindGrid();
                }
            }
        }
Esempio n. 17
0
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp            = (CommandParameters)Element;
                string[]          elemsToDelete = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]);

                int error = 0;
                using (DbTransaction tran = DbTransaction.Begin())
                {
                    foreach (string elem in elemsToDelete)
                    {
                        int id = Convert.ToInt32(elem.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture);
                        if (id > 0)
                        {
                            Document.Delete(id);
                        }
                    }
                    tran.Commit();
                }
                if (error > 0)
                {
                    ClientScript.RegisterStartupScript(((Control)Sender).Page, ((Control)Sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("alert('{0}');", CHelper.GetResFileString("{IbnFramework.ListInfo:RefItemException}")), true);
                }

                CHelper.RequireBindGrid();
            }
        }
Esempio n. 18
0
        /// <summary>
        /// Adds the internal E mail2 incident.
        /// </summary>
        /// <param name="IncidentId">The incident id.</param>
        /// <param name="EMailMessageId">The E mail message id.</param>
        /// <param name="SenderName">Name of the sender.</param>
        /// <param name="SenderEmail">The sender email.</param>
        /// <returns></returns>
        private static int AddInternalEMail2Incident(int IncidentId, int EMailMessageId, string SenderName, string SenderEmail)
        {
            ForumThreadNodeInfo info = null;

            using (DbTransaction tran = DbTransaction.Begin())
            {
                BaseIbnContainer FOcontainer  = BaseIbnContainer.Create("FileLibrary", string.Format("IncidentId_{0}", IncidentId));
                ForumStorage     forumStorage = (ForumStorage)FOcontainer.LoadControl("ForumStorage");

                int SenderUserID    = Security.UserID;
                EMailMessageInfo mi = EMailMessageInfo.Load(EMailMessageId);

                info = forumStorage.CreateForumThreadNode(EMailMessageInfo.ExtractTextFromHtml(mi.HtmlBody),
                                                          DateTime.UtcNow,
                                                          Security.UserID,
                                                          EMailMessageId,
                                                          (int)ForumStorage.NodeContentType.EMail);

                ForumThreadNodeSettingCollection settings = new ForumThreadNodeSettingCollection(info.Id);
                settings.Add(ForumThreadNodeSetting.Outgoing, "1");

                if (HttpContext.Current != null && HttpContext.Current.Items.Contains(ForumThreadNodeSetting.AllRecipients))
                {
                    settings.Add(ForumThreadNodeSetting.AllRecipients, HttpContext.Current.Items[ForumThreadNodeSetting.AllRecipients].ToString());
                }

                tran.Commit();
            }

            return(info.Id);
        }
Esempio n. 19
0
        private static void UpdateProjectAndManager(int objectId, int projectId, int managerId)
        {
            int oldProjectId = DBEvent.GetProject(objectId);
            int oldManagerId = DBEvent.GetManager(objectId);

            if (managerId == 0)             // Don't change manager
            {
                managerId = oldManagerId;
            }

            if (projectId == 0)            // Don't change project
            {
                projectId = oldProjectId;
            }

            if (projectId != oldProjectId || managerId != oldManagerId)
            {
                using (DbTransaction tran = DbTransaction.Begin())
                {
                    DbCalendarEntry2.UpdateProjectAndManager(objectId, projectId, managerId);

                    // OZ: User Role Addon
                    if (managerId != oldManagerId)
                    {
                        UserRoleHelper.DeleteEventManagerRole(objectId, oldManagerId);
                        UserRoleHelper.AddEventManagerRole(objectId, managerId);
                    }

                    if (projectId != oldProjectId)
                    {
                        ForeignContainerKey.Delete(UserRoleHelper.CreateEventContainerKey(objectId), UserRoleHelper.CreateProjectContainerKey(oldProjectId));
                        if (projectId > 0)
                        {
                            ForeignContainerKey.Add(UserRoleHelper.CreateEventContainerKey(objectId), UserRoleHelper.CreateProjectContainerKey(projectId));
                        }
                    }
                    // end OZ

                    if (projectId != oldProjectId)
                    {
                        if (projectId > 0)
                        {
                            SystemEvents.AddSystemEvents(SystemEventTypes.Project_Updated_CalendarEntryList_CalendarEntryAdded, projectId, objectId);
                        }
                        else
                        {
                            SystemEvents.AddSystemEvents(SystemEventTypes.Project_Updated_CalendarEntryList_CalendarEntryDeleted, oldProjectId, objectId);
                        }
                    }

                    if (managerId != oldManagerId)
                    {
                        SystemEvents.AddSystemEvents(SystemEventTypes.CalendarEntry_Updated_Manager_ManagerDeleted, objectId, oldManagerId);
                        SystemEvents.AddSystemEvents(SystemEventTypes.CalendarEntry_Updated_Manager_ManagerAdded, objectId, managerId);
                    }

                    tran.Commit();
                }
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Updates the POP3 box.
        /// </summary>
        /// <param name="box">The box.</param>
        /// <returns></returns>
        public Pop3Box UpdatePop3Box(Pop3Box box)
        {
            if (box.IsBoxModified())
            {
                using (DbTransaction tra = DbTransaction.Begin())
                {
                    int BoxId = box.Id;

                    if (box.Modified)
                    {
                        if (BoxId == -1)
                        {
                            using (IDataReader reader = DBPop3Box.Create(box.Name, box.Server,
                                                                         box.Port, box.Login, box.Password, box.IsActive,
                                                                         box.Interval, box.LastRequest, box.LastSuccessfulRequest,
                                                                         box.LastErrorText, box.AutoKillForRead))
                            {
                                if (reader.Read())
                                {
                                    BoxId = (int)reader["Pop3BoxId"];
                                }
                            }
                        }
                        else
                        {
                            DBPop3Box.Update(BoxId, box.Name, box.Server,
                                             box.Port, box.Login, box.Password, box.IsActive,
                                             box.Interval, box.LastRequest, box.LastSuccessfulRequest,
                                             box.LastErrorText, box.AutoKillForRead);
                        }

                        box.ResetModified();
                    }

                    if (box.Handlers.IsModified)
                    {
                        DBPop3Box.DeleteHandlers(BoxId);

                        foreach (Pop3MessageHandlerInfo info in box.Handlers)
                        {
                            DBPop3Box.CreateHandler(BoxId, info.Name);
                        }
                        box.Handlers.ResetModified();
                    }
                    if (box.Parameters.IsModified)
                    {
                        DBPop3Box.DeleteParameters(BoxId);

                        foreach (string name in box.Parameters.Keys)
                        {
                            DBPop3Box.AddParameter(BoxId, name, box.Parameters[name]);
                        }
                    }

                    tra.Commit();
                }
            }
            return(box);
        }
Esempio n. 21
0
    /// <summary>
    /// トランザクションを開始する。
    /// </summary>
    /// <returns></returns>
    public DbTransaction BeginTransaction()
    {
        var transaction = new DbTransaction(this._connection);

        transaction.Begin();

        return(transaction);
    }
Esempio n. 22
0
        /// <summary>
        /// Clears this instance.
        /// </summary>
        public static void Clear()
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                EMailMessageLogRow.Clear();

                tran.Commit();
            }
        }
Esempio n. 23
0
        public static void ReadFromStream(int fileID, Stream stream)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                DBFile.ReadFromStream(fileID, stream);

                tran.Commit();
            }
        }
Esempio n. 24
0
        public void Remove(string Name)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                DBForum.RemoveSetting(m_NodeId, Name);
                m_settings.Remove(Name);

                tran.Commit();
            }
        }
Esempio n. 25
0
        public static void DeleteLocalAddressRange(int rangeId)
        {
            CheckAccess();

            using (DbTransaction tran = DbTransaction.Begin())
            {
                DbActiveDirectory.LocalAddressRangeDelete(rangeId);
                tran.Commit();
            }
        }
Esempio n. 26
0
        public void Remove(string Name)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                DBUser.RemoveProperty(m_UserID, Name);
                m_properties.Remove(Name);

                tran.Commit();
            }
        }
Esempio n. 27
0
        /// <summary>
        /// Approves the pending.
        /// </summary>
        public static void ApprovePending()
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                foreach (int EMailMessageId in EMailMessage.ListPendigEMailMessageIds())
                {
                    ApprovePending(EMailMessageId);
                }

                tran.Commit();
            }
        }
Esempio n. 28
0
        /// <summary>
        /// Deletes all.
        /// </summary>
        /// <param name="IncidentBoxId">The incident box id.</param>
        public static void DeleteAll(int IncidentBoxId)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                foreach (IncidentBoxRule rule in IncidentBoxRule.List(IncidentBoxId))
                {
                    IncidentBoxRule.Delete(rule.IncidentBoxRuleId);
                }

                tran.Commit();
            }
        }
Esempio n. 29
0
        public static void Delete(ArrayList ItemIds)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                foreach (int ItemId in ItemIds)
                {
                    Delete(ItemId);
                }

                tran.Commit();
            }
        }
Esempio n. 30
0
        /// <summary>
        /// Copies to incident.
        /// </summary>
        /// <param name="emailMessageIdList">The email message id list.</param>
        /// <param name="incidentId">The incident id.</param>
        public static void CopyToIncident(ArrayList emailMessageIdList, int incidentId)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                foreach (int emailMessageId in emailMessageIdList)
                {
                    CopyToIncident(emailMessageId, incidentId);
                }

                tran.Commit();
            }
        }