bendr
bendr

Reputation: 2475

LightSwitch Application and Doing //Something when a row value has been changed

I have a LightSwitch application (C#) and it's all working fine, but am in need of a feature and not sure how to go about it.

Let's say that there is a Status column in my Orders screen. And when I change a status to, say, "Confirmed" in the Status column, I would like to send an e-mail to the email address corresponding to that particular person about their order.

Is this even possible in LightSwitch applications?

Upvotes: 1

Views: 399

Answers (1)

If I understand you correctly this sounds like exactly what LightSwitch is intended for.

What I would do is that I would add a changed handler for Status field on the Orders table (so that's it's available in all screens).

Something like this:

public partial class Order
{
    partial void Status_Changed()
    {
      if (status == Status.Confirmed)
      {
         // Write code to send email
      }
    }
}

Upvotes: 1

Related Questions