Esempio n. 1
0
        private void OnSaveCustomerRepair()
        {
            var returnStatus = false;

            returnStatus = !IsInEditMode
                               ? CustomerAction.AddCustomerRepair(this.DBConnectionString, this.Entity)
                               : CustomerAction.UpdateCustomerRepair(this.DBConnectionString, this.Entity);

            if (returnStatus)
            {
                if (RefreshCustomerRepair != null)
                {
                    this.RefreshCustomerRepair();
                }

                var messageDailog = new MessageDailog()
                {
                    Caption      = MessageResources.DataSavedSuccessfully,
                    DialogButton = DialogButton.Ok,
                    Title        = TitleResources.Information
                };

                MessengerInstance.Send(messageDailog);

                if (this.CloseWindow != null)
                {
                    this.CloseWindow();
                }
            }
            else
            {
                var messageDailog = new MessageDailog()
                {
                    Caption      = MessageResources.DataSavedFailed,
                    DialogButton = DialogButton.Ok,
                    Title        = TitleResources.Error
                };
                MessengerInstance.Send(messageDailog);
            }
        }