public UpdateFileWindowViewModel(ChildWindow aChildWindow, ObservableCollection <FileTypeEntity> aFileTypeEntityList, ObservableCollection <ProjectFilesEntity> aProjectFilesEntityList, ProjectFilesEntity aProjectFileEntity)
        {
            UserFile               = new FileUploader.UserFile();
            ProjectFilesEntity     = aProjectFileEntity;
            ProjectFilesEntityList = aProjectFilesEntityList;
            FileTypeEntityList     = aFileTypeEntityList;
            childWindow            = aChildWindow;
            FileTypes              = new List <String>();
            App  app = Application.Current as App;
            bool lIsPermis;

            if (app.UserInfo.UserAction.TryGetValue(2020100, out lIsPermis))
            {
                if (lIsPermis)
                {
                    FileTypes.Add("合同协议文件");
                    ProjectFilesEntity.fileType = "合同协议文件";
                }
            }

            if (app.UserInfo.UserAction.TryGetValue(2020200, out lIsPermis))
            {
                if (lIsPermis)
                {
                    FileTypes.Add("配置文件");
                    ProjectFilesEntity.fileType = "配置文件";
                }
            }

            Title = "上传文件 生产令号:" + ProjectFilesEntity.ManufactureNumber;

            OnOpenFile = new DelegateCommand(OnOpenFileCommand);
            OnUpdate   = new DelegateCommand(OnUpdateCommand, CanUpdateCommand);
            OnCancel   = new DelegateCommand(OnCancelCommand);
        }
        private void loadOperationProjectFiles_Completed(object sender, EventArgs e)
        {
            ProjectFilesEntityList.Clear();
            LoadOperation <ProductManager.Web.Model.project_files> loadOperation = sender as LoadOperation <ProductManager.Web.Model.project_files>;

            foreach (ProductManager.Web.Model.project_files project_files in loadOperation.Entities)
            {
                ProjectFilesEntity projectFilesEntity = new ProjectFilesEntity();
                projectFilesEntity.ProjectFiles = project_files;
                projectFilesEntity.Update();
                DepartmentEntity lDepartmentEntity;
                if (DepartmentEntityDictionary.TryGetValue(projectFilesEntity.DepartmentID, out lDepartmentEntity))
                {
                    projectFilesEntity.DepartmentName = lDepartmentEntity.DepartmentName;
                }
                UserEntity lUserEntity;
                if (UserEntityDictionary.TryGetValue(projectFilesEntity.UserID, out lUserEntity))
                {
                    projectFilesEntity.UserName = lUserEntity.CUserName;
                }
                if (UserEntityDictionary.TryGetValue(projectFilesEntity.FileDeletePersionID, out lUserEntity))
                {
                    projectFilesEntity.FileDeletePersionName = lUserEntity.CUserName;
                }
                FileTypeEntity lFileTypeEntity;
                if (FileTypeEntityDictionary.TryGetValue(projectFilesEntity.FileTypeID, out lFileTypeEntity))
                {
                    projectFilesEntity.FileTypeName = lFileTypeEntity.FileTypeName;
                }
                ProjectFilesEntityList.Add(projectFilesEntity);
            }
            IsBusy = false;
        }
Esempio n. 3
0
 private void LoadOperationProjectCompleted(LoadOperation <ProductManager.Web.Model.project_files> aLoadOperation)
 {
     ProjectFilesEntityList.Clear();
     foreach (ProductManager.Web.Model.project_files project_files in aLoadOperation.Entities)
     {
         ProjectFilesEntity projectFilesEntity = new ProjectFilesEntity();
         projectFilesEntity.ProjectFiles = project_files;
         projectFilesEntity.Update();
         DepartmentEntity lDepartmentEntity;
         if (DepartmentDictionary.TryGetValue(projectFilesEntity.DepartmentID, out lDepartmentEntity))
         {
             projectFilesEntity.DepartmentName = lDepartmentEntity.DepartmentName;
         }
         UserEntity lUserEntity;
         if (UserEntityDictionary.TryGetValue(projectFilesEntity.UserID, out lUserEntity))
         {
             projectFilesEntity.UserName = lUserEntity.CUserName;
         }
         if (UserEntityDictionary.TryGetValue(projectFilesEntity.FileDeletePersionID, out lUserEntity))
         {
             projectFilesEntity.FileDeletePersionName = lUserEntity.CUserName;
         }
         FileTypeEntity lFileTypeEntity;
         if (FileTypeEntityDictionary.TryGetValue(projectFilesEntity.FileTypeID, out lFileTypeEntity))
         {
             projectFilesEntity.FileTypeName = lFileTypeEntity.FileTypeName;
         }
         ProjectFilesEntityList.Add(projectFilesEntity);
     }
     UpdateChanged("ProjectFilesEntityList");
     canConfirm = isLinkProject ? (ProjectFilesEntityList.Count > 0) : (null != SelectProjectFilesEntity);
     UpdateChanged("CanConfirm");
     IsBusy = false;
 }
Esempio n. 4
0
        public DeleteFileWindowViewModel(ChildWindow aChildWindow, ProjectFilesEntity aProjectFilesEntity)
        {
            childWindow        = aChildWindow;
            ProjectFilesEntity = aProjectFilesEntity;
            OnOK     = new DelegateCommand(OnOKCommand);
            OnCancel = new DelegateCommand(OnCancelCommand);

            Title = "删除文件:" + aProjectFilesEntity.FileName;
        }
        private void ProductFiles_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            ProjectFilesEntity lprojectFilesEntity = e.Row.DataContext as ProjectFilesEntity;

            if (lprojectFilesEntity.FileDelete)
            {
                e.Row.Background = new SolidColorBrush(Colors.Black);
            }
        }
        public ModifyFileWindowViewModel(ChildWindow aChildWindow, ObservableCollection <FileTypeEntity> aFileTypeEntityList, ProjectFilesEntity aProjectFileEntity)
        {
            childWindow        = aChildWindow;
            FileTypeEntityList = aFileTypeEntityList;

            ProjectFilesEntity = aProjectFileEntity;

            OnOK     = new DelegateCommand(OnOKCommand);
            OnCancel = new DelegateCommand(OnCancelCommand);
        }
Esempio n. 7
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, ProjectFilesEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 8
0
        private void OnOKCommand()
        {
            ProjectFilesEntity.FileDelete = true;
            App app = Application.Current as App;

            ProjectFilesEntity.FileDeletePersionID   = app.UserInfo.UserID;
            ProjectFilesEntity.FileDeletePersionName = app.UserInfo.UserName;
            ProjectFilesEntity.FileDeleteTime        = DateTime.Now;

            ProjectFilesEntity.DUpdate();

            childWindow.DialogResult = true;
        }
        private void OnUpdateFileCommand()
        {
            AddProjectFilesEntity = new ProjectFilesEntity();
            App app = Application.Current as App;

            AddProjectFilesEntity.UserID            = app.UserInfo.UserID;
            AddProjectFilesEntity.DepartmentID      = app.UserInfo.DepartmentID;
            AddProjectFilesEntity.DepartmentName    = app.UserInfo.UserDepartment;
            AddProjectFilesEntity.UserName          = app.UserInfo.UserName;
            AddProjectFilesEntity.ManufactureNumber = SelectProjectEntity.ManufactureNumber;
            AddProjectFilesEntity.FileTypeID        = 1;
            AddProjectFilesEntity.ProjectFiles      = new ProductManager.Web.Model.project_files();
            UpdateFileWindow updateFileWindow = new UpdateFileWindow(FileTypeEntityList, ProjectFilesEntityList, AddProjectFilesEntity);

            updateFileWindow.Closed += updateFileWindow_Closed;
            updateFileWindow.Show();
        }
Esempio n. 10
0
 public UpdateFileWindow(ObservableCollection <FileTypeEntity> aFileTypeEntityList, ObservableCollection <ProjectFilesEntity> aProjectFilesEntityList, ProjectFilesEntity aProjectFileEntity)
 {
     InitializeComponent();
     this.DataContext = new UpdateFileWindowViewModel(this, aFileTypeEntityList, aProjectFilesEntityList, aProjectFileEntity);
 }
Esempio n. 11
0
 private void OnCancelCommand()
 {
     ProjectFilesEntity.Update();
     ProjectFilesEntity.RaisALL();
     childWindow.DialogResult = false;
 }
 public DeleteFileWindow(ProjectFilesEntity aProjectFilesEntity)
 {
     InitializeComponent();
     this.DataContext = new DeleteFileWindowViewModel(this, aProjectFilesEntity);
 }
 void OnOKCommand()
 {
     ProjectFilesEntity.DUpdate();
     childWindow.DialogResult = true;
 }