private void onClientEvents() { BLL.NubeAccountClient.NubeAccountHub.On <BLL.UserType>("userType_Save", (rv) => { this.Dispatcher.Invoke(() => { rv.Save(true); }); }); BLL.NubeAccountClient.NubeAccountHub.On("userType_Delete", (Action <int>)((pk) => { this.Dispatcher.Invoke((Action)(() => { BLL.UserType d = new BLL.UserType(); d.Find((int)pk); d.Delete((bool)true); })); })); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { if (data.Id == 0) { MessageBox.Show("No Records to Delete"); } else { if (!BLL.UserAccount.AllowDelete(FormName)) { MessageBox.Show(string.Format(Message.PL.DenyDelete, FormName)); } else if (MessageBox.Show("Do you want to Delete this record?", "DELETE", MessageBoxButton.YesNo) != MessageBoxResult.No) { if (data.Delete() == true) { MessageBox.Show("Deleted"); data.Clear(); } } } }
private void btnDelete_Click(object sender, RoutedEventArgs e) { if (data.Id == 0) { MessageBox.Show("No Records to Delete"); } else { if (!BLL.UserAccount.AllowDelete(Common.Forms.frmUserType)) { MessageBox.Show(string.Format(Message.PL.DenyDelete, FormName)); } else if (MessageBox.Show("Do you want to Delete this record?", "DELETE", MessageBoxButton.YesNo) != MessageBoxResult.No) { Common.AppLib.WriteLog(string.Format("User type Delete=>Begins=>Id=>{0}", data.Id)); if (data.Delete() == true) { Common.AppLib.WriteLog(string.Format("User type Deleted Successfully=>Id=>{0}", data.Id)); MessageBox.Show("Deleted"); this.Close(); } } } }