在ASP.Net中,我们会为此编写一个连接查询,但不支持在silverlight连接查询中。
在SilverlightApplication.Xaml.cs
中 private void btnreject_Click(object sender, RoutedEventArgs e)
{
DomainContext objectcontext=new DomainContext();
EMPLOYEE emp = new EMPLOYEE(); //EMPLOYEE is a Table name
string from = emp.EMPEMAIL;
string to = emp.EMP_EMPEMAIL; //How To Get a To Address Here That is The Email id is Based on Subcode in leave Table
if (DataGrid1.SelectedItem != null)
{
objectcontext.Load(this.objectcontext.GetLeaveCancellationQuery(Int32.Parse(WebContext.Current.User.Name))).Completed += new EventHandler(LeaveApprovCancelApplication_Completed);
objectcontext.SubmitChanges();
objectcontext.sendemail(From,To);
}
}
表格结构:
我有一个数据网格如下:
CheckBoxField,EmployeeName, EmployeeId,LeaveStatus,SubCode
* , XX , 1 , Pending ,2
我有2个表,他们是员工表,并留下表......
员工表有以下数据字段:
Employee Id, EmployeeName,Email
1 , XX ,x@g.c
2 ,YY ,Y@g.c
保持表格具有以下字段:
EmployeeId, EmployeeName, LeaveStatus, SubCode
1 ,XX ,Pending ,2
我的DataGrid ItemSource = Leavetable 我正在使用DomainServiceClass和Ado.NetDataEntityModel
当用户在DataGrid中检查CheckBox并单击取消按钮时。 Leavestatus将被更新为“已取消”并且邮件将自动发送给员工
在此邮件FromAddress将被采取EmployeeTable 由LeaveTable SubCode = EmployeeTable EmployeeID加入。然后将等于子代码的电子邮件地址视为地址
我怎样才能成功