简体   繁体   English

LightSwitch应用程序和操作//更改行值时的操作

[英]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. 我有一个LightSwitch应用程序(C#),一切正常,但是需要一个功能,不确定如何去做。

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? 在LightSwitch应用程序中甚至有可能吗?

If I understand you correctly this sounds like exactly what LightSwitch is intended for. 如果我对您的理解正确,那听起来完全像是LightSwitch的用途。

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
      }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM