Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • gilad 185 posts 425 karma points
    Feb 07, 2012 @ 13:24
    gilad
    0

    contour custom events

    hello everyone.

    i have 2 questions.

    1) i try to use a custom events for contour like i did for document or page..

    this code is not actually what i am trying to do but i write it for testing and it is not work for me.

    i am using contor 1.1.12

    this is the code: ( outer class )

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Umbraco.Forms.Core;
    using Umbraco.Forms.Core.Services;
    using umbraco.cms.businesslogic.web;
    using umbraco.BusinessLogic;

    namespace customEvents
    {
    public class FormEvent : umbraco.BusinessLogic.ApplicationBase
    {
    public void formsEvent()
    {
    RecordService.RecordSubmitted+=new EventHandler<RecordEventArgs>(RecordService_RecordSubmitted);
    RecordService.RecordApproved += new EventHandler<RecordEventArgs>(RecordService_RecordApproved);
    }

    void RecordService_RecordApproved(object sender, RecordEventArgs e)
    {
    RecordService rs = (RecordService)sender;
    rs.Delete();
    }

    void RecordService_RecordSubmitted(object sender, RecordEventArgs e)
    {
    RecordService rs = (RecordService)sender;
    rs.Delete();
    }
    }
    }

    2 ) what i am actually triyng to do is to check some field - lets say : coupon code.

    and then change another field - lets say : description of discount.

    ( this is for the site-manager when export the entries )

    if there is another/better way to do it i would i'd love to hear.

    thanks in advacne.

     

  • Comment author was deleted

    Feb 09, 2012 @ 08:57

    Hey could you share some more details on what you want to do that way I'l be able to point you in the correct direction

    Is it just changing the value of a certain field depending on an other field when the record has been submitted?

  • gilad 185 posts 425 karma points
    Feb 09, 2012 @ 09:04
    gilad
    0

    Hii tim,

    yes. that what i am trying to do.

    actually i managed to do it but i will be glad if you write here what do you think is the right way to do it.

    thanks in advance.

Please Sign in or register to post replies

Write your reply to:

Draft