コード例 #1
0
        public override CustomJsonResult AjaxGetByPage(int?page, int?rows)
        {
            if (!page.HasValue)
            {
                page = 1;
            }
            if (!rows.HasValue)
            {
                rows = PagedResult <WFTaskList> .DefaultPageSize;
            }
            int pageNumber = page.Value;
            int pageSize   = rows.Value;

            var json = new CustomJsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;

            try
            {
                var service = DomainServiceFactory.Create <FlowServices>();
                service.FlowAction = FlowAction.我的任务;
                service.Invoke();
                var modelList = service.Result.DataObject as EasyUIGridModel <MyTaskListViewModel>;
                json.Data = modelList;
            }
            catch (Exception ex)
            {
                Logger.LogError("AjaxGetByPage:", ex);
            }
            return(json);
        }
コード例 #2
0
        public override CustomJsonResult AjaxAdd(EDMSMaintenanceBill model)
        {
            Guid pboId  = Guid.Parse(LRequest.GetString("pboId"));
            Guid taskId = Guid.Parse(LRequest.GetString("taskId"));

            model.MaintainPerson         = RbacPrincipal.CurrentUser.UserName;
            model.MaintainPersonPhone    = RbacPrincipal.CurrentUser.TelePhone;
            model.RepairUnit             = RbacPrincipal.CurrentUser.DepName;
            model.FulfillDate            = DateTime.Now;
            model.EDMSMaintenanceBill_ID = pboId;
            //处理流程
            var flow = DomainServiceFactory.Create <FlowServices>();

            flow.Arguments.Attributes = new System.Collections.Hashtable();
            flow.Arguments.Attributes.Add("taskId", taskId);
            flow.Arguments.Attributes.Add("isExamine", true);
            flow.Arguments.Attributes.Add("State", 2);
            flow.Arguments.Attributes.Add("Memo", "处理报修单");
            flow.FlowAction = FlowAction.处理任务;
            flow.Invoke();
            var result = flow.Result;

            if (result.Success)
            {
                return(base.AjaxAdd(model));
            }
            else
            {
                var json = new CustomJsonResult();
                json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
                json.Data = result;
                return(json);
            }
        }
コード例 #3
0
        public void DT_Service_Override_VersionSpecific()
        {
            var service = DomainServiceFactory.Create(typeof(AddBookService), new Version("1.0.0.2")) as AddBookService;

            service.Invoke();
            Assert.IsTrue(service.Result == 2);
        }
コード例 #4
0
        public void DT_Service_Override()
        {
            var service = DomainServiceFactory.Create <AddBookService>();

            service.Invoke();
            Assert.IsTrue(service.Result == 3);
        }
コード例 #5
0
        public void DT_Service_InterfaceContract()
        {
            var service = DomainServiceFactory.Create <ITestAddService>();

            service.A = 10;
            service.B = 20;
            service.Invoke();
            Assert.IsTrue(service.Result == 30);
        }
コード例 #6
0
        protected override void DoAdd(EDMSRepairsBill entity)
        {
            //启动流程
            var flow = DomainServiceFactory.Create <FlowServices>();

            flow.Arguments.Attributes = new System.Collections.Hashtable();
            flow.Arguments.Attributes.Add("itemId", entity.ID);
            flow.Arguments.Attributes.Add("userId", entity.RepairsPerson);
            flow.FlowAction = FlowAction.申请工作;
            flow.Invoke();

            entity.WFItem = (WFItem)flow.Result.DataObject;
            base.DoAdd(entity);
        }
コード例 #7
0
        /// <summary>
        /// 完成任务
        /// </summary>
        /// <param name="taskId"></param>
        /// <returns></returns>
        public ActionResult frmTask(Guid taskId)
        {
            var ser = DomainServiceFactory.Create <FlowServices>();

            ser.Arguments.Attributes.Add("taskId", taskId);
            ser.FlowAction = FlowAction.任务地址;
            ser.Invoke();
            string taskUrl = ser.Result.Attributes["taskUrl"].ToString();

            if (string.IsNullOrWhiteSpace(taskUrl))
            {
                taskUrl = "frmTask";
            }
            return(Json(taskUrl, JsonRequestBehavior.AllowGet));
        }