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); }
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); } }
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); }
public void DT_Service_Override() { var service = DomainServiceFactory.Create <AddBookService>(); service.Invoke(); Assert.IsTrue(service.Result == 3); }
public void DT_Service_InterfaceContract() { var service = DomainServiceFactory.Create <ITestAddService>(); service.A = 10; service.B = 20; service.Invoke(); Assert.IsTrue(service.Result == 30); }
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); }
/// <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)); }