private void btnSave_Click(object sender, RoutedEventArgs e) { if (data.ProductName == null) { MessageBox.Show(string.Format(Message.PL.Empty_Record, "Product")); } else if (data.Id == 0 && !BLL.UserAccount.AllowInsert(FormName)) { MessageBox.Show(string.Format(Message.PL.DenyInsert, FormName)); } else if (data.Id != 0 && !BLL.UserAccount.AllowUpdate(FormName)) { MessageBox.Show(string.Format(Message.PL.DenyUpdate, FormName)); } else { if (data.Save() == true) { MessageBox.Show(Message.PL.Saved_Alert); data.Clear(); } else { MessageBox.Show(string.Format(Message.PL.Existing_Data, data.ProductName)); } } }