Example #1
0
 public PeopleViewModel(IMessageBoxService messageBox)
 {
     IsModified       = false;
     People           = new ObservableCollection <Person>();
     this.peopleLogic = new PeopleLogic();
     this.path        = CurrentUserHelper.GetCurrentUserDirectory() + "\\people.xml";
     this.messageBox  = messageBox;
 }
        public async Task OnWorkOrderSendingDialogCompletion(ApproveOpinionModel e)
        {
            if (e != null)
            {
                #region 產生一筆稽核送審記錄
                var user = await CurrentUserHelper.GetCurrentUserAsync();

                var code = UniqueStringHelper.GetCode();
                FlowMasterAdapterModel flowMasterAdapterModel = new FlowMasterAdapterModel()
                {
                    Code           = code,
                    MyUserId       = user.Id,
                    PolicyHeaderId = e.PolicyHeaderAdapterModel.Id,
                    CreateDate     = DateTime.Now,
                    ProcessLevel   = 0,
                    Title          = $"工單完工 - {CurrentRecord.Description}",
                    Content        = "",
                    Status         = 0,
                    SourceType     = FlowSourceTypeEnum.WorkOrder,
                    SourceJson     = JsonConvert.SerializeObject(CurrentRecord),
                    SourceCode     = CurrentRecord.Code,
                };

                flowMasterAdapterModel.UpdateAt = DateTime.Now;
                await FlowMasterService.AddAsync(flowMasterAdapterModel);

                flowMasterAdapterModel = await FlowMasterService.GetAsync(code);

                await FlowMasterService.SendAsync(flowMasterAdapterModel, e);

                CurrentRecord.Status = MagicHelper.WorkOrderStatus送審;
                await CurrentService.UpdateAsync(CurrentRecord);

                this.dataGrid.RefreshGrid();
                #endregion
            }
            ShowWorkOrderSendingDialog = false;
        }
Example #3
0
        public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
        {
            if (args.Item.Id == ButtonIdHelper.ButtonIdAdd)
            {
                CurrentRecord = new FlowMasterAdapterModel();
                #region 針對新增的紀錄所要做的初始值設定商業邏輯
                #endregion
                EditRecordDialogTitle = "新增紀錄";
                IsNewRecordMode       = true;
                IsShowEditRecord      = true;
                var user = await CurrentUserHelper.GetCurrentUserAsync();

                CurrentRecord.MyUserId     = user.Id;
                CurrentRecord.MyUserName   = user.Name;
                CurrentRecord.Status       = 0;
                CurrentRecord.ProcessLevel = 0;
                CurrentRecord.Code         = UniqueStringHelper.GetCode();
                CurrentRecord.CreateDate   = DateTime.Now;
            }
            else if (args.Item.Id == ButtonIdHelper.ButtonIdRefresh)
            {
                dataGrid.RefreshGrid();
            }
        }
        public ActionResult SaveData(Base_SysNavigation theData)
        {
            string msg = string.Empty;

            if (theData.Id.IsNullOrEmpty())
            {
                Base_User base_User = CurrentUserHelper.GetCurrentUserInfo();
                _base_SysNavigationBusiness.AddData(theData, base_User);
                msg = "添加成功!";
            }
            else
            {
                _base_SysNavigationBusiness.UpdateData(theData);
                msg = "修改成功!";
            }

            return(Ok(new AjaxResult
            {
                Success = true,
                Msg = msg,
                Data = null,
                ErrorCode = 0
            }));
        }