Example #1
0
        private void Save(SideButton sideButton)
        {
            if (!Banjar.HasErrors)
            {
                switch (sideButton)
                {
                case SideButton.Add:
                    Banjar.Insert();
                    Banjars.Add(Banjar);
                    break;

                case SideButton.Edit:
                    Banjar.Update();
                    OldBanjar.Copy(Banjar);
                    break;
                }
                ReturnState(sideButton);
            }
            else
            {
                RadWindow.Alert(new DialogParameters
                {
                    Content = "Ada data yg masih kosong",
                    Owner   = Application.Current.MainWindow
                });
            }
        }
Example #2
0
        private void Delete()
        {
            string confirmText = "yakin menghapus pegawai ini?";

            RadWindow.Confirm(new DialogParameters
            {
                Content = confirmText,
                Closed  = new EventHandler <WindowClosedEventArgs>((object senderDialog, WindowClosedEventArgs eDialog) =>
                {
                    if (eDialog.DialogResult == true)
                    {
                        Banjar.Delete();
                        Banjars.Remove(Banjar);
                    }
                }),
                Owner = Application.Current.MainWindow
            });
        }