Ejemplo n.º 1
0
        private void UserDel()
        {
            if( DXMessageBox.Show("是否确定删除?", "删除确认", MessageBoxButton.YesNo)==MessageBoxResult.Yes)
              {
              User tempModel = LeftGrid.SelectedItem as User;
              if (tempModel == null) return;
              model = tempModel;
              model.FIsDelete = true;
              visaORM.ObjectStateManager.ChangeObjectState(model, EntityState.Modified);
              visaORM.SaveChanges();
              userList.Remove(model);
              InitData();

              }
        }
Ejemplo n.º 2
0
 private void UserAdd()
 {
     //wordPassConfirm.Visibility = Visibility.Visible;
     //wordPassConfirmInfo.Visibility = Visibility.Visible;
     //txtPassConfirm.Visibility = Visibility.Visible;
     model = new User();
     MainGrid.DataContext = model;
     txtCompanyName.IsEnabled = true;
     txtPassConfirm.Text = "";
 }
Ejemplo n.º 3
0
        private void LeftGrid_SelectedItemChanged(object sender, DevExpress.Xpf.Grid.SelectedItemChangedEventArgs e)
        {
            if (e.OldItem == null || e.NewItem == null)
                return;

            //if (getDefaultModel == 0)
            //{
            //    getDefaultModel = 1;
            //    return;
            //}

            User userModel = e.NewItem as User;

            var tempModel = visaORM.User.FirstOrDefault(c => c.FID == userModel.FID);
            if (tempModel == null)
                return;
            else
            {
                model = tempModel;
                MainGrid.DataContext = model;
                txtPassConfirm.Text = model.FPassword;

            }
            if (model.FCompanyName.ToUpper() == "ADMIN")
            {
                txtCompanyName.IsEnabled = false;
            }
            InitTreeNodesCheck();
            //初始化其他权限
            InitOtherRights();
        }
Ejemplo n.º 4
0
        void InitData()
        {
            model = visaORM.User.FirstOrDefault(u => u.FID == NowUserId);
            if (model == null) return;

            if (MainContext.UserCompanyName.ToUpper() == "ADMIN")
            {
                //customerList = visaORM.User.ToList();
                //LeftGrid.DataContext = customerList;

                if (model.FCompanyName.ToUpper() == "ADMIN")
                txtCompanyName.IsEnabled = false;

            }
            else
            {
                LeftGrid.ItemsSource = visaORM.User.FirstOrDefault(u=>u.FID==MainContext.UserID);
            }

            if (model != null)
            {
                MainGrid.DataContext = model;

                txtPassConfirm.Text = model.FPassword;
            }

            InitTreeNodesCheck();

            //初始化其他权限
            InitOtherRights();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 创建新的 User 对象。
 /// </summary>
 /// <param name="fID">FID 属性的初始值。</param>
 public static User CreateUser(global::System.Int32 fID)
 {
     User user = new User();
     user.FID = fID;
     return user;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 用于向 User EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToUser(User user)
 {
     base.AddObject("User", user);
 }