Пример #1
0
        public static void Update(IncidentBox box, IncidentBoxDocument document)
        {
            if (!CanModify())
            {
                throw new AccessDeniedException();
            }

            using (Database.DbTransaction tran = Database.DbTransaction.Begin())
            {
                IncidentBox.Update(box);
                IncidentBoxDocument.Save(document);

                // O.R.[2008-12-16]: Recalculate Current Responsible
                DBIncident.RecalculateCurrentResponsibleByIncidentBox(box.IncidentBoxId);

                tran.Commit();
            }
        }
Пример #2
0
        public static void Delete(int IncidentBoxId)
        {
            if (!CanModify())
            {
                throw new AccessDeniedException();
            }

            using (Database.DbTransaction tran = Database.DbTransaction.Begin())
            {
//				using(IDataReader reader = Incident.GetListIncidentsByIncidentBox(IncidentBoxId))
//				{
//					while(reader.Read())
//					{
//						int IncidentId = (int)reader["IncidentId"];
//						Incident.Delete(IncidentId, true, false);
//					}
//				}

                IncidentBoxRow.Delete(IncidentBoxId);

                tran.Commit();
            }
        }