コード例 #1
0
        // *** Start programmer edit section *** (OnUpdateWeek CustomAttributes)
        /// <summary>
        /// Метод обрабатывает дополнительную логику обновления "Стандартной рабочей недели" в базе данных
        /// </summary>
        /// <param name="UpdatedObject">Изменяема неделя</param>
        /// <returns></returns>
        // *** End programmer edit section *** (OnUpdateWeek CustomAttributes)
        public virtual ICSSoft.STORMNET.DataObject[] OnUpdateWeek(IIS.BusinessCalendar.Week UpdatedObject)
        {
            // *** Start programmer edit section *** (OnUpdateWeek)
            if (UpdatedObject.GetStatus() == ObjectStatus.Deleted)
            {
                DataServiceProvider.DataService.LoadObject(Week.Views.WeekE, UpdatedObject, false, false);
                if ((UpdatedObject.Monday != null) || (UpdatedObject.Tuesday != null) || (UpdatedObject.Wednesday != null) || (UpdatedObject.Thursday != null) || (UpdatedObject.Friday != null) || (UpdatedObject.Saturday != null) || (UpdatedObject.Sunday != null))
                {
                    TSSaveHelper.DeleteTimeSpans(UpdatedObject);

                    WorkTimeDefinition tempMon = UpdatedObject.Monday;
                    WorkTimeDefinition tempTue = UpdatedObject.Tuesday;
                    WorkTimeDefinition tempWed = UpdatedObject.Wednesday;
                    WorkTimeDefinition tempThu = UpdatedObject.Thursday;
                    WorkTimeDefinition tempFri = UpdatedObject.Friday;
                    WorkTimeDefinition tempSun = UpdatedObject.Sunday;
                    WorkTimeDefinition tempSat = UpdatedObject.Saturday;

                    UpdatedObject.Monday    = null;
                    UpdatedObject.Tuesday   = null;
                    UpdatedObject.Wednesday = null;
                    UpdatedObject.Thursday  = null;
                    UpdatedObject.Friday    = null;
                    UpdatedObject.Saturday  = null;
                    UpdatedObject.Sunday    = null;
                    DataServiceProvider.DataService.UpdateObject(UpdatedObject);

                    UpdatedObject.SetStatus(ObjectStatus.Deleted);

                    return(new DataObject[8] {
                        tempMon, tempTue, tempWed, tempThu, tempFri, tempSat, tempSun, UpdatedObject
                    });
                }
                else
                {
                    UpdatedObject.SetStatus(ObjectStatus.Deleted);
                }
            }
            return(new ICSSoft.STORMNET.DataObject[0]);
            // *** End programmer edit section *** (OnUpdateWeek)
        }
コード例 #2
0
 // *** Start programmer edit section *** (OnUpdateWeek CustomAttributes)
 /// <summary>
 /// Метод обрабатывает дополнительную логику обновления "Стандартной рабочей недели" в базе данных
 /// </summary>
 /// <param name="UpdatedObject">Изменяема неделя</param>
 /// <returns></returns>
 // *** End programmer edit section *** (OnUpdateWeek CustomAttributes)
 public virtual ICSSoft.STORMNET.DataObject[] OnUpdateWeek(IIS.BusinessCalendar.Week UpdatedObject)
 {
     // *** Start programmer edit section *** (OnUpdateWeek)
     if (UpdatedObject.GetStatus() == ObjectStatus.Deleted)
     {
         DataServiceProvider.DataService.LoadObject(Week.Views.WeekE, UpdatedObject, false, false);
         if ((UpdatedObject.Monday != null) || (UpdatedObject.Tuesday != null) || (UpdatedObject.Wednesday != null) || (UpdatedObject.Thursday != null) || (UpdatedObject.Friday != null) || (UpdatedObject.Saturday != null) || (UpdatedObject.Sunday != null))
         {
             TSSaveHelper.DeleteTimeSpans(UpdatedObject);
             UpdatedObject.SetStatus(ObjectStatus.Deleted);
             return(new DataObject[8] {
                 UpdatedObject, UpdatedObject.Monday, UpdatedObject.Tuesday, UpdatedObject.Wednesday, UpdatedObject.Thursday, UpdatedObject.Friday, UpdatedObject.Saturday, UpdatedObject.Sunday
             });
         }
         else
         {
             UpdatedObject.SetStatus(ObjectStatus.Deleted);
         }
     }
     return(new ICSSoft.STORMNET.DataObject[0]);
     // *** End programmer edit section *** (OnUpdateWeek)
 }