Пример #1
0
 private void LoadOperationQuestionTraceTraceCompleted(LoadOperation <questiontrace> aLoadOperation)
 {
     QuestionTraceEntityTraceList.Clear();
     foreach (ProductManager.Web.Model.questiontrace questiontrace in aLoadOperation.Entities)
     {
         QuestionTraceEntity questionTraceEntity = new QuestionTraceEntity();
         questionTraceEntity.QuestionTrace = questiontrace;
         questionTraceEntity.Update();
         if (questionTraceEntity.QuestionIsClose)
         {
             continue;
         }
         DepartmentEntity lDepartmentTemp;
         if (DepartmentEntityDictionary.TryGetValue(questionTraceEntity.QuestionResDepartmentID, out lDepartmentTemp))
         {
             questionTraceEntity.QuestionResDepartmentName = lDepartmentTemp.DepartmentName;
         }
         if (DepartmentEntityDictionary.TryGetValue(questionTraceEntity.QuestionHandDepartmentID, out lDepartmentTemp))
         {
             questionTraceEntity.QuestionHandDepartmentName = lDepartmentTemp.DepartmentName;
         }
         if (DepartmentEntityDictionary.TryGetValue(questionTraceEntity.QuestionTraceDepartmentID, out lDepartmentTemp))
         {
             questionTraceEntity.QuestionTraceDepartmentName = lDepartmentTemp.DepartmentName;
         }
         UserEntity lUserEntityTemp;
         if (UserEntityDictionary.TryGetValue(questionTraceEntity.UserIDMain, out lUserEntityTemp))
         {
             questionTraceEntity.UserIDMainString = lUserEntityTemp.CUserName;
         }
         if (UserEntityDictionary.TryGetValue(questionTraceEntity.UserIDCP1, out lUserEntityTemp))
         {
             questionTraceEntity.UserIDCP1String = lUserEntityTemp.CUserName;
         }
         if (UserEntityDictionary.TryGetValue(questionTraceEntity.UserIDCP2, out lUserEntityTemp))
         {
             questionTraceEntity.UserIDCP2String = lUserEntityTemp.CUserName;
         }
         if (UserEntityDictionary.TryGetValue(questionTraceEntity.OwnerUserID, out lUserEntityTemp))
         {
             questionTraceEntity.OwnerUserString = lUserEntityTemp.CUserName;
         }
         if (UserEntityDictionary.TryGetValue(questionTraceEntity.LastAnswerUserID, out lUserEntityTemp))
         {
             questionTraceEntity.LastAnswerUserString = lUserEntityTemp.CUserName;
         }
         ProjectEntity lProjectEntityTemp;
         if (ProjectEntityDictionary.TryGetValue(questionTraceEntity.ManufactureNumber, out lProjectEntityTemp))
         {
             questionTraceEntity.ProjectName = lProjectEntityTemp.ProjectName;
         }
         QuestionTraceEntityTraceList.Add(questionTraceEntity);
     }
     if (aLoadOperation.TotalEntityCount != -1)
     {
         this.questionTraceView.SetTotalItemCount(aLoadOperation.TotalEntityCount);
     }
     UpdateChanged("QuestionTraceEntityList");
     UpdateChanged("CollectionQuestionTraceView");
 }
        public QuestionTraceWindowViewModel(ChildWindow aChildWindow, QuestionTraceOperation aQuestionTraceOperation, ObservableCollection <UserEntity> aUserEntityList, ObservableCollection <DepartmentEntity> aDepartmentEntityList, QuestionTraceEntity aQuestionTraceEntity)
        {
            childWindow            = aChildWindow;
            QuestionTraceOperation = aQuestionTraceOperation;
            DepartmentEntityList   = aDepartmentEntityList;
            UserEntityList         = aUserEntityList;
            QuestionTraceEntity    = aQuestionTraceEntity;
            OnOK     = new DelegateCommand(OnOKCommand);
            OnCancel = new DelegateCommand(OnCancelCommand);

            if (aQuestionTraceOperation == QuestionTraceOperation.ADD)
            {
                IsAdd    = true;
                IsAnswer = false;
                Title    = "添加问题 " + QuestionTraceEntity.ManufactureNumber;
            }
            else if (aQuestionTraceOperation == QuestionTraceOperation.ANSWER)
            {
                IsAdd    = false;
                IsAnswer = true;
                Title    = "回答问题 " + QuestionTraceEntity.ManufactureNumber;
            }
            else if (aQuestionTraceOperation == QuestionTraceOperation.VIEW)
            {
                IsAdd    = false;
                IsAnswer = false;
                Title    = "查看问题 " + QuestionTraceEntity.ManufactureNumber;
            }
            else if (aQuestionTraceOperation == QuestionTraceOperation.CLOSE)
            {
                IsAdd    = false;
                IsAnswer = false;
                Title    = "关闭问题 " + QuestionTraceEntity.ManufactureNumber;
            }
        }
        private void OnAddQuestionCommand()
        {
            AddQuestionTraceEntity = new QuestionTraceEntity();
            AddQuestionTraceEntity.ManufactureNumber = ManufactureNumber;
            AddQuestionTraceEntity.UserIDMain        = -2;
            AddQuestionTraceEntity.UserIDCP1         = -2;
            AddQuestionTraceEntity.UserIDCP2         = -2;
            AddQuestionTraceEntity.QuestionTrace     = new questiontrace();
            QuestionTraceWindow questionTraceWindow = new QuestionTraceWindow(QuestionTraceOperation.ADD, UserEntityList, DepartmentEntityList, AddQuestionTraceEntity);

            questionTraceWindow.Closed += AddQuestionClosed;
            questionTraceWindow.Show();
        }
Пример #4
0
        public void LoadData()
        {
            IsBusy = true;
            ProductDomainContext      = new ProductDomainContext();
            SystemManageDomainContext = new SystemManageDomainContext();
            ProductDomainContext.RejectChanges();
            selectQuestionTraceEntity = null;
            selectProjectEntity       = null;

            App app = Application.Current as App;
            LoadOperation <ProductManager.Web.Model.user_project> loadOperationUserProject =
                ProductDomainContext.Load <ProductManager.Web.Model.user_project>(ProductDomainContext.GetUserProjectQuery(app.UserInfo.UserID));

            loadOperationUserProject.Completed += LoadUserProjectComplete;
        }
 public QuestionTraceWindow(QuestionTraceOperation aQuestionTraceOperation, ObservableCollection <UserEntity> aUserEntityList, ObservableCollection <DepartmentEntity> aDepartmentEntityList, QuestionTraceEntity aQuestionTraceEntity)
 {
     InitializeComponent();
     this.DataContext = new QuestionTraceWindowViewModel(this, aQuestionTraceOperation, aUserEntityList, aDepartmentEntityList, aQuestionTraceEntity);
 }