Beispiel #1
0
 /// <summary>
 /// 初始化相关属性值
 /// </summary>
 public void InitPropValue()
 {
     if (EntityPlan != null)
     {
         IsEditFlag = true;
     }
     else
     {
         IsEditFlag = false;
         EntityPlan = new Lib.PlanEntity()
         {
             CreateUserId      = AppSet.LoginUser.Id,
             ResponsiblePerson = AppSet.LoginUser.Id,
             Department        = AppSet.LoginUser.Department,
             BeginDate         = DateTime.Now,
             EndDate           = DateTime.Now.AddDays(10),
             FinishNote        = "",
             CurrectState      = PlanStatus.WaitBegin,
             ReadGrant         = "all"
         };
     }
     UserGrantSelectList  = new ObservableCollection <SelectObj <Lib.UserEntity> >();
     UserHelperSelectList = new ObservableCollection <SelectObj <Lib.UserEntity> >();
     foreach (Lib.UserEntity item in AppSet.SysUsers.Where(e => !e.Id.Equals("admin", StringComparison.Ordinal)).OrderBy(x => x.OrderIndex))
     {
         UserGrantSelectList.Add(new SelectObj <Lib.UserEntity>(EntityPlan.ReadGrant != null && (EntityPlan.ReadGrant.Contains(item.Id) || EntityPlan.ReadGrant.Equals("all", StringComparison.Ordinal)), item));
         UserHelperSelectList.Add(new SelectObj <Lib.UserEntity>(EntityPlan.Helpers != null && (EntityPlan.Helpers.Contains(item.Id) || EntityPlan.Helpers.Equals("all", StringComparison.Ordinal)), item));
     }
 }
Beispiel #2
0
        public async void Init_PlanInfoAsync(Lib.PlanEntity P_Entity, Action <Lib.PlanEntity> P_CallBack = null)
        {
            _CallBack     = P_CallBack;
            _UCPlanInfoVM = new CurUcViewModel();
            await _UCPlanInfoVM.Init_PlanInfoVMAsync(P_Entity);

            _UCPlanInfoVM.SetPlanOperateGrant();
            _UCPlanInfoVM.SetPlanFileDelete();
            DataContext = _UCPlanInfoVM;
        }
Beispiel #3
0
            public async Task Init_PlanInfoVMAsync(Lib.PlanEntity P_Entity)
            {
                CurPlan = P_Entity;
                if (PlanFiles.Count < 1)
                {
                    //如果该计划的附件文件没有读取则读取之。
                    PlanFileSearch mSearchFile = new PlanFileSearch()
                    {
                        PlanId = P_Entity.Id, UserId = AppSet.LoginUser.Id
                    };
                    PlanFileSearchResult planFileSearchResult = await DataPlanFileRepository.ReadFiles(mSearchFile);

                    if (planFileSearchResult != null && planFileSearchResult.RecordList != null)
                    {
                        planFileSearchResult.RecordList.ToList().ForEach(e =>
                        {
                            e.UpIntProgress = 100;

                            PlanFiles.Add(e);
                        });
                    }
                }
                if (CurPlan.CreateUserId != null)
                {
                    CurPlanCreateUserName = AppSet.SysUsers.Where(e => CurPlan.CreateUserId.Equals(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name).FirstOrDefault()?.Trim();
                }
                if (CurPlan.ResponsiblePerson != null)
                {
                    CurPlanResponsibleName = AppSet.SysUsers.Where(e => CurPlan.ResponsiblePerson.Equals(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name).FirstOrDefault()?.Trim();
                }
                if (CurPlan.ReadGrant != null)
                {
                    CurPlanHasGrantNames = string.Join(",", AppSet.SysUsers.Where(e => CurPlan.ReadGrant.Contains(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name)?.ToArray());
                }
                if (CurPlan.Helpers != null)
                {
                    CurPlanHelperNames = string.Join(",", AppSet.SysUsers.Where(e => CurPlan.Helpers.Contains(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name)?.ToArray());
                }
            }
Beispiel #4
0
        /// <summary>
        /// 删除一个计划信息
        /// </summary>
        /// <param name="DelePlan"></param>
        /// <returns></returns>
        public static async Task <ExcuteResult> DeletePlan(Lib.PlanEntity DelePlan)
        {
            ExcuteResult JsonResult = await DataApiRepository.DeleteApiUri <ExcuteResult>(_ApiUrlBase + "Plan/" + DelePlan.Id).ConfigureAwait(false);

            return(JsonResult);
        }
Beispiel #5
0
        /// <summary>
        /// 更新计划信息(采用PUT)
        /// </summary>
        /// <param name="UpdatePlan"></param>
        /// <returns></returns>
        public static async Task <ExcuteResult> UpdatePlan(Lib.PlanEntity PEntity)
        {
            ExcuteResult JsonResult = await DataApiRepository.PutApiUriAsync(_ApiUrlBase + "Plan", PEntity).ConfigureAwait(false);

            return(JsonResult);
        }
 public PageSettingsTools(Lib.PlanEntity P_Plan = null)
 {
     InitializeComponent();
 }
Beispiel #7
0
 public PageEditPlan(Lib.PlanEntity P_Plan = null)
 {
     InitializeComponent();
     _PageViewModel = new PageViewModel(P_Plan);
 }
Beispiel #8
0
 public PageViewModel(Lib.PlanEntity CurPlan)
 {
     EntityPlan     = CurPlan;
     ServerSettings = AppSet.ServerSetting;
 }