Exemplo n.º 1
0
        private void dgvDetail_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var d = dgvDetail.SelectedItem as BLL.UserType;

            if (d != null)
            {
                data.Find(d.Id);
            }
        }
        void ViewForm()
        {
            var d = dgvDetail.SelectedItem as BLL.UserType;

            if (d != null)
            {
                if (data.Find(d.Id))
                {
                    //    ckbAllViewForm.IsChecked = data.UserTypeDetails.Where(x => x.UserTypeFormDetail.IsActive && !x.IsViewForm).Count() == 0;
                    //    ckbAllAllowInsert.IsChecked = data.UserTypeDetails.Where(x => x.UserTypeFormDetail.IsActive && x.UserTypeFormDetail.IsInsert && x.AllowInsert == false).Count() == 0;
                    //    ckbAllAllowUpdate.IsChecked = data.UserTypeDetails.Where(x => x.UserTypeFormDetail.IsActive && x.UserTypeFormDetail.IsUpdate && x.AllowUpdate == false).Count() == 0;
                    //    ckbAllAllowDelete.IsChecked = data.UserTypeDetails.Where(x => x.UserTypeFormDetail.IsActive && x.UserTypeFormDetail.IsDelete && x.AllowDelete == false).Count() == 0;
                    //
                }
            }
        }
        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);
                }));
            }));
        }