Esempio n. 1
0
 public void onOK()
 {
     if (FileTypeEntity.Validate())
     {
         FileTypeEntity.DUpdate();
         FileTypeEntity.RaisALL();
         childWindow.DialogResult = true;
     }
 }
        private void OnAddCommand()
        {
            AddFileTypeEntity          = new FileTypeEntity();
            AddFileTypeEntity.FileType = new ProductManager.Web.Model.filetype();
            FileTypeWindow fileTypeWindow = new FileTypeWindow(AddFileTypeEntity);

            fileTypeWindow.Closed += fileTypeWindow_Closed;
            fileTypeWindow.Show();
        }
        private void onAddFileType()
        {
            addFileTypeEntity = new FileTypeEntity();
            Web.Model.filetype fileType = new Web.Model.filetype();
            addFileTypeEntity.FileType = fileType;
            addFileTypeEntity.Update();
            FileTypeWindow lFileTypeWindow = new FileTypeWindow(FileTypeWindowType.ADD, addFileTypeEntity);

            lFileTypeWindow.Closed += AddFileType_Closed;
            lFileTypeWindow.Show();
        }
        public void LoadData()
        {
            IsBusy = true;
            systemManageDomainContext = new SystemManageDomainContext();
            systemManageDomainContext.PropertyChanged -= systemManageDomainContext_PropertyChanged;
            systemManageDomainContext.PropertyChanged += systemManageDomainContext_PropertyChanged;
            FileTypeEntityList.Clear();
            selectFileTypeEntity = null;
            LoadOperation <ProductManager.Web.Model.filetype> loadOperationDepartment =
                systemManageDomainContext.Load <ProductManager.Web.Model.filetype>(systemManageDomainContext.GetFiletypeQuery());

            loadOperationDepartment.Completed += loadOperationFileType_Completed;
        }
 private void loadOperation_Completed(LoadOperation <DocumentManager.Web.Model.filetype> sender)
 {
     FileTypeList.Clear();
     fileTypeSource.Source = sender.Entities;
     foreach (DocumentManager.Web.Model.filetype filetype in sender.Entities)
     {
         FileTypeEntity fileTypeEntity = new FileTypeEntity();
         fileTypeEntity.FileType = filetype;
         fileTypeEntity.Update();
         FileTypeList.Add(fileTypeEntity);
     }
     UpdateChanged("FileTypeList");
     IsBusy = false;
 }
        void loadOperationFileType_Completed(object sender, EventArgs e)
        {
            FileTypeEntityList.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (ProductManager.Web.Model.filetype filetype in loadOperation.Entities)
            {
                FileTypeEntity fileTypeEntity = new FileTypeEntity();
                fileTypeEntity.FileType = filetype;
                fileTypeEntity.Update();
                FileTypeEntityList.Add(fileTypeEntity);
            }
            UpdateChanged("FileTypeEntityList");
            IsBusy = false;
        }
Esempio n. 7
0
        public FileTypeWindowViewModel(ChildWindow aChildWindow, FileTypeWindowType aFileTypeWindowType, FileTypeEntity aFileTypeEntity)
        {
            childWindow        = aChildWindow;
            fileTypeWindowType = aFileTypeWindowType;
            FileTypeEntity     = aFileTypeEntity;

            if (aFileTypeWindowType == FileTypeWindowType.ADD)
            {
                Title = "添加档案类型";
            }
            else
            {
                Title = "修改档案类型";
            }

            OnOK     = new DelegateCommand(onOK);
            OnCancel = new DelegateCommand(onCancel);
        }
        void SubOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                submitOperation.MarkErrorAsHandled();
                NotifyWindow notifyWindow = new NotifyWindow("错误", "保存失败");
                notifyWindow.Show();
                if (addFileTypeEntity != null)
                {
                    FileTypeList.Remove(addFileTypeEntity);
                    addFileTypeEntity = null;
                }
            }
            else
            {
                NotifyWindow notifyWindow = new NotifyWindow("保存成功", "保存成功!");
                notifyWindow.Show();
                addFileTypeEntity = null;
                LoadData();
            }
            IsBusy = false;
        }
Esempio n. 9
0
 public void onCancel()
 {
     FileTypeEntity.Update();
     FileTypeEntity.RaisALL();
     childWindow.DialogResult = false;
 }
Esempio n. 10
0
 public FileTypeWindow(FileTypeEntity aFileTypeEntity)
 {
     InitializeComponent();
     this.DataContext = new FileTypeWindowViewModel(this, aFileTypeEntity);
 }