Пример #1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (data.CustomerName == null)
            {
                MessageBox.Show(string.Format(Message.PL.Empty_Record, "Customer Name"));
            }

            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.CustomerName));
                }
            }
        }