示例#1
0
        protected override void OnSaving(Job obj, FormCollection form, EditingType type)
        {
            base.OnSaving(obj, form, type);

            if (type == EditingType.Edit)
            {
                var curObj = _repo.GetLive(obj.BaseID);
                previousID = curObj.ID;
                jobID      = curObj.JobID;
            }

            if (obj.ListOnIndeed && string.IsNullOrEmpty(obj.IndeedRef))
            {
                if (obj.IndeedDate == null)
                {
                    obj.IndeedDate = DateTime.Now;
                }
                obj.IndeedRef = String.Format("{0}{1}", obj.IndeedDate.Value.ToString("yyyymmdd"), obj.BaseID);
            }

            using (MiniProfiler.Current.Step("duplicate title check"))
            {
                if (_repo.FindBy(x => x.Title == obj.Title && x.BaseID != obj.BaseID && x.Status == VersionableItemStatus.Live).Count() > 0)
                {
                    ModelState.AddModelError("DuplicateTitles", "Duplicate job titles. Please rename a job.");
                }
            }
        }
示例#2
0
 void OnEditmode(EditingType type)
 {
     this.editingType = type;
     if (type == EditingType.FLOORS)
     {
         UpdateWorldFloorCorners();
     }
     else if (type == EditingType.WALLS)
     {
         ShowAllCorners();
     }
 }
示例#3
0
        protected override void OnSaving(TeamMember obj, FormCollection form, EditingType type)
        {
            base.OnSaving(obj, form, type);

            if (type == EditingType.Insert)
            {
                obj.Order = int.MaxValue;
            }

            if (string.IsNullOrEmpty(obj.Email))
            {
                obj.Email = ConfigurationManager.AppSettings["DefaultEmail"];
            }
        }
        /// <summary>
        /// Конструктор для вызова из ParametersEdit
        /// </summary>
        /// <param name="t">Тип(скролл, текстовое поле)</param>
        /// <param name="DefaultValue">Значение по умолчанию</param>
        public ParameterControl(EditingType t, ParameterListUnit Unit)
        {
            InitializeComponent();
            this.Unit = Unit;

            ParameterName.Text = Unit.sName;

            this.Type = t;

            switch (t)
            {
                case EditingType.None: break;
                case EditingType.TextBox: AddTextBox(Unit.Value); break; // добавляем textbox
                case EditingType.Scroll: break;
            }
        }
        public EditRecurring(Window Owner, EditingType editType)
        {
            InitializeComponent();
            this.Owner = Owner;
            EditType   = editType;

            switch (EditType)
            {
            case EditingType.Delete:
                Title            = "Delete Recurring Item";
                detailsText.Text = "What do you want to delete?";
                break;

            case EditingType.Open:
                break;
            }

            AccessKeyManager.Register(" ", okButton);
        }
示例#6
0
        public bool EnabledInlineEditing(EditingType type)
        {
            if (DisableInlineEditing)
            {
                return(false);
            }

            var enabled = InlineEditing;

            if (!enabled)
            {
                if (this.PageRequestContext.RequestChannel == Web.FrontRequestChannel.Draft)
                {
                    enabled = false;
                    if ((type & EditingType.Page) == EditingType.Page)
                    {
                        enabled = true;
                    }
                }
            }
            return(enabled);
        }
 /// <summary>
 /// Called right before the ModelState is checked, but within the same SQL transaction
 /// </summary>
 /// <param name="obj">The object about to be saved</param>
 /// <param name="form">The HTTP Form collection of values</param>
 /// <param name="type">Editing type, Inserting or Editing the object</param>
 protected virtual void OnSaving(T obj, FormCollection form, EditingType type)
 {
 }
示例#8
0
        protected override void OnSaving(EmployeePortalPage obj, FormCollection form, EditingType type)
        {
            base.OnSaving(obj, form, type);
            if (type == EditingType.Edit)
            {
                if (obj.ParentId == null)
                {
                    var curObj = _repo.GetLive(obj.BaseID);
                    previousID = curObj.ID;
                    obj.Slug   = GenerateSlug(obj);
                }
            }

            if (obj.PageType == PortalType.Redirect)
            {
                obj.RedirectUrl = CheckURL(obj.RedirectUrl);
            }

            using (MiniProfiler.Current.Step("duplicate title check"))
            {
                if (_repo.FindBy(x => x.Title == obj.Title && x.BaseID != obj.BaseID && x.ParentId == obj.ParentId && x.Status == VersionableItemStatus.Live).Count() > 0)
                {
                    ModelState.AddModelError("DuplicateTitles", "Duplicate page titles on the same level. Please rename a page");
                }
            }
        }
示例#9
0
        public bool EnabledInlineEditing(EditingType type)
        {
            if (DisableInlineEditing)
            {
                return false;
            }

            var enabled = InlineEditing;
            if (!enabled)
            {
                if (this.PageRequestContext.RequestChannel == Web.FrontRequestChannel.Draft)
                {
                    enabled = false;
                    if ((type & EditingType.Page) == EditingType.Page)
                    {
                        enabled = true;
                    }
                }
            }
            return enabled;
        }
 public EditingButton(EditingType Type, string Name, System.Windows.Media.SolidColorBrush Color)
 {
     penColour = Color;
     name = Name;
     type = Type;
     generateRGBAsInt();
     generateDrawnPenPreview();
     generateBrushPreviewPoints();
 }
示例#11
0
 public Form2(EditingType editingType)
 {
     _editingType = editingType;
 }