Exemple #1
0
        public string getFlowList(string financePageJson)
        {
            //分页对象
            FinancePage <Flow> financePage = null;

            try
            {
                //创建service层实例
                llowService = new FlowService();
                //处理json
                financePage = FinanceJson.getFinanceJson().toObject <FinancePage <Flow> >(financePageJson);
                //获取处理过的分页对象
                financePage = llowService.getFlowList(financePage);

                return(FinanceResultData.getFinanceResultData().success(200, financePage, "成功"));
            }
            catch (InvalidOperationException ex)
            {
                //身份验证不通过
                return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
            }
            catch (Exception ex)
            {
                //未知的错误
                return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
            }
        }
        /// <summary>
        /// 作废
        /// </summary>
        /// <param name="WORKID"></param>
        /// <param name="NODEID"></param>
        /// <returns></returns>
        public ActionResult DeleteWork(int WORKID, int NODEID)
        {
            using (var trans = NH.Session.BeginTransaction())
            {
                try
                {
                    var work          = NH.Session.Load <WF_GenerWorkFlow>(WORKID);
                    var CurrentNodeID = BP.WF.Dev2Interface.Node_GetCurrentNodeID(work.FK_Flow, WORKID);

                    if (CurrentNodeID != NODEID)
                    {
                        throw new DomainException("当前案件信息已更新,请刷新页面!");
                    }

                    FlowService.OnTuiJian(work.FK_Flow, WORKID, work.YWH, NODEID);

                    BP.WF.Dev2Interface.Port_Login(ApplicationUser.Current.Name, "dd2f628c-3f38-4c8c-aa83-1a52ebf6a45a");
                    BP.WF.Dev2Interface.Flow_DoDeleteFlowByFlag(work.FK_Flow, WORKID, "", false);

                    trans.Commit();
                    return(Json(new { success = true }));
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    return(Json(new { success = false, message = ex.Message }));
                }
            }
        }
        /// <summary>
        /// 执行工作退回(退回指定的点)
        /// </summary>
        /// <param name="WorkID"></param>
        /// <param name="NodeID"></param>
        /// <param name="ToNodeID"></param>
        /// <returns></returns>
        public ActionResult Node_ReturnWork(int WorkID, int NodeID, int ToNodeID)
        {
            using (var trans = NH.Session.BeginTransaction())
            {
                try
                {
                    var work          = NH.Session.Load <WF_GenerWorkFlow>(WorkID);
                    var CurrentNodeID = BP.WF.Dev2Interface.Node_GetCurrentNodeID(work.FK_Flow, WorkID);

                    if (CurrentNodeID != NodeID)
                    {
                        throw new DomainException("当前案件信息已更新,请刷新页面!");
                    }
                    FlowService.OnReturn(work.FK_Flow, WorkID, work.YWH, NodeID, ToNodeID);
                    var msg = BP.WF.Dev2Interface.Node_ReturnWork(WorkID, ToNodeID, "", true);

                    trans.Commit();
                    return(Json_Get(new { success = true, msg = "操作成功" }));
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    return(Json_Get(new { success = false, msg = ex.Message }));
                }
            }
        }
        /// <summary>
        /// 保存为草稿
        /// </summary>
        /// <param name="WorkID">工作ID</param>
        /// <returns>操作结果</returns>
        public ActionResult SaveAsDraft(int WorkID)
        {
            var work = NH.Session.QueryOver <WF_GenerWorkFlow>().Where(x => x.WorkID == WorkID).List().FirstOrDefault();
            var flow = NH.Session.Load <WF_Flow>(work.FK_Flow);

            if (string.IsNullOrEmpty(work.YWH))
            {
                var ywh = Sys_BH.GetBH(flow.BHID);
                work.YWH = ywh;
                work.SaveOrUpdate();
            }
            try
            {
                if (work == null)
                {
                    throw new Exception("找不到该流程");
                }

                FlowService.OnSaveAsDraft(work.FK_Flow, WorkID, work.YWH);

                BP.WF.Dev2Interface.Node_SetDraft(work.FK_Flow, work.WorkID);
            }
            catch (DomainException ex)
            {
                return(Json_Get(new { success = false, msg = ex.Message }));
            }
            catch (Exception ex)
            {
                return(Json_Get(new { success = false, msg = "保存失败,请联系管理员!" }));
            }

            return(Json_Get(new { success = true }));
        }
Exemple #5
0
        protected Dictionary <string, DataProviderInfo> GetServiceDataSources()
        {
            Repeater repeater = dataSourcesRepeater;
            Dictionary <string, DataProviderInfo> sources = null;

            foreach (RepeaterItem item in repeater.Items)
            {
                Label        dsKeyLabel = item.FindControl("dsKeyValueLabel") as Label;
                string       key        = dsKeyLabel.Text;
                DropDownList dataSourcesDropDownList = item.FindControl("dataSourcesDropDownList") as DropDownList;
                if (dataSourcesDropDownList == null)
                {
                    throw new ArgumentNullException(string.Format("Could not find dataSourcesDropDownList for key: {0}", key));
                }
                if (dataSourcesDropDownList.SelectedValue == NOT_SELECTED_TEXT)
                {
                    throw new ArgumentException(string.Format("Data source not selected for key: {0}", key));
                }
                string           dsName   = dataSourcesDropDownList.SelectedValue;
                DataProviderInfo provider = FlowService.GetDataSourceByName(dsName);
                if (provider == null)
                {
                    throw new ArgumentNullException(string.Format("Could not find data source: {0}", dsName));
                }
                if (sources == null)
                {
                    sources = new Dictionary <string, DataProviderInfo>();
                }
                sources.Add(key, provider);
            }
            return(sources);
        }
 public ParametersController(BasicImportService basicImportService, AlarmsService alarmsService,
     NearestPciCellService neighborService, FlowService flowService)
 {
     _basicImportService = basicImportService;
     _alarmsService = alarmsService;
     _neighborService = neighborService;
     _flowService = flowService;
 }
Exemple #7
0
        public TicketController()
        {
            serviceTicket     = new TicketService(db);
            serviceUserTicket = new UserTicketService(db);
            serviceFlow       = new FlowService(db);

            userTicketDetail = new UserTicketDetailService(db);
        }
 public ParametersController(BasicImportService basicImportService, AlarmsService alarmsService,
                             NearestPciCellService neighborService, FlowService flowService)
 {
     _basicImportService = basicImportService;
     _alarmsService      = alarmsService;
     _neighborService    = neighborService;
     _flowService        = flowService;
 }
Exemple #9
0
        public Flowdock(string apiKey)
        {
            _apiKey = apiKey;

            _userService = new UserService(_apiKey);
            _flowService = new FlowService(_apiKey);

            _users = _userService.GetUsers();
            _flows = _flowService.GetFlows();
        }
        protected void GivenANewFlowAndFlowBatch()
        {
            // clean up existing files
            foreach (var file in Directory.GetFiles(Environment.CurrentDirectory, "*SampleFlow*.json"))
            {
                File.Delete(file);
            }

            _flowService = new FlowService(new FlowIdRepo());
            _batch       = _flowService.GetNewFlowBatch("SampleFlow");
        }
Exemple #11
0
 //实例化
 public OrderController()
 {
     serviceOrder     = new OrderService(db);
     serviceDetail    = new OrderDetailService(db);
     serviceRoom      = new RoomService(db);
     serviceMoney     = new MoneyService(db);
     serviceFlow      = new FlowService(db);
     serviceDiscount  = new DiscountService(db);
     servicePay       = new PayService(db);
     UserTicketDetail = new UserTicketDetailService(db);
 }
Exemple #12
0
 public FlowManagement()
 {
     this.flowService = new FlowServiceImp(new FlowDAOImp());
     InitializeComponent();
     this.addBtn.FlatStyle = FlatStyle.Flat;
     this.addBtn.FlatAppearance.BorderSize = 0;
     this.newFlow.FlatStyle = FlatStyle.Flat;
     this.newFlow.FlatAppearance.BorderSize = 0;
     this.loadFlow();
     this.loadTypes();
 }
Exemple #13
0
        public void FlowService_Delete_WithIncorrectParamater_Returns_False()
        {
            // Arrange
            var service = new FlowService(mockFlowRepo.Object);

            // Act
            var result = service.Delete(Guid.Empty);

            // Assert
            Assert.AreEqual(false, result);
        }
Exemple #14
0
        public void FlowService_Delete_WithCorrectParamater_Returns_True()
        {
            // Arrange
            var service = new FlowService(mockFlowRepo.Object);

            // Act
            var result = service.Delete(Guid.Parse("17007b98-1f5a-4d7c-bd27-f02023999887"));

            // Assert
            Assert.AreEqual(true, result);
        }
Exemple #15
0
        public void FlowService_Get_WithIncorrectParameter_Returns_Null()
        {
            // Arrange
            var service = new FlowService(mockFlowRepo.Object);

            // Act
            var flow = service.Get(Guid.Empty);

            // Assert
            Assert.IsNull(flow);
        }
Exemple #16
0
        protected void CollapseAllLinkButton_Click(object sender, EventArgs e)
        {
            IList <DataFlow> flows = FlowService.GetFlows(VisitHelper.GetVisit(), true);

            SessionStateData.HiddenFlows.Clear();
            CollectionUtils.ForEach(flows, delegate(DataFlow dataFlow)
            {
                SessionStateData.HiddenFlows.Add(dataFlow.Id);
            });
            UserSettingsManager.SaveAdminFlowPageHiddenFlowIds(GetCurrentUsername(), SessionStateData.HiddenFlows);
            NeedsRebind = true;
        }
        public FlowController(FlowService flowService, IHttpContextAccessor accessor)
        {
            _service  = flowService;
            _accessor = accessor;
            WxHelper wx = new WxHelper(_accessor.HttpContext);

            userInfo = wx.CheckAndGetUserInfo();
            if (userInfo.code == 2)
            {
                Redirect(userInfo.message);
            }
        }
Exemple #18
0
        public void FlowService_Get_WithCorrectParameter_Returns_Data()
        {
            // Arrange
            var service = new FlowService(mockFlowRepo.Object);

            // Act
            var flow = service.Get(Guid.Parse("17007b98-1f5a-4d7c-bd27-f02023999887"));

            // Assert
            Assert.IsNotNull(flow);
            Assert.AreEqual(Guid.Parse("17007b98-1f5a-4d7c-bd27-f02023999887"), flow.Id);
            Assert.AreEqual("Test Flow1", flow.Title);
        }
        protected void AndGivenANewFlow()
        {
            // cleanup any existing file
            foreach (var file in Directory.GetFiles(Environment.CurrentDirectory, "*Test*.json"))
            {
                File.Delete(file);
            }

            this._flowService = new FlowService(new FlowIdRepo());

            this._flow      = this._flowService.CreateNew("Test");
            this._flowBatch = this._flowService.GetNewFlowBatch("Test");
        }
Exemple #20
0
        public void FlowService_Update_WithIncorrectParamater_Returns_False()
        {
            // Arrange
            var service = new FlowService(mockFlowRepo.Object);

            // Act
            var result = service.Update(Guid.Empty, new FlowDto
            {
                Title = "Test Flow2"
            });

            // Assert
            Assert.AreEqual(false, result);
        }
        public async Task Get_DontExist_ShouldReturnNull()
        {
            // Arrange
            var options = BuildContextOptions();

            using (var context = new BorrowBuddyContext(options)) {
                var service = new FlowService(context);
                // Act
                var result = await service.GetAsync(Guid.NewGuid());

                // Assert
                Assert.Null(result);
            }
        }
Exemple #22
0
 public AddZone(ZoneService zoneService, FlowService flowService, WindowsObserver observer)
 {
     this.subject = new WindowsSubject();
     this.subject.Attach(observer);
     this.zoneService = zoneService;
     this.flowService = flowService;
     InitializeComponent();
     this.addBtn.FlatStyle = FlatStyle.Flat;
     this.addBtn.FlatAppearance.BorderSize = 0;
     this.cancelBtn.FlatStyle = FlatStyle.Flat;
     this.cancelBtn.FlatAppearance.BorderSize = 0;
     this.comboTypes.Enabled = false;
     this.init();
 }
Exemple #23
0
        protected void DeleteDataItem(object sender, EventArgs e)
        {
            try
            {
                FlowService.DeleteService(Model.DataService, VisitHelper.GetVisit());

                ResponseRedirect("../Secure/Flow.aspx");
            }
            catch (Exception ex)
            {
                LOG.Error(ex.Message, ex);
                SetDivPageError(ex);
            }
        }
Exemple #24
0
 public NewFlow(WindowsObserver observer, FlowService flowService, List <FlowStepDTO> subzoneTypes)
 {
     flow         = new Dictionary <int, FlowStepDTO>();
     this.subject = new WindowsSubject();
     this.subject.Attach(observer);
     this.flowService = flowService;
     InitializeComponent();
     this.addType.FlatStyle = FlatStyle.Flat;
     this.addType.FlatAppearance.BorderSize = 0;
     this.removeType.FlatStyle = FlatStyle.Flat;
     this.removeType.FlatAppearance.BorderSize = 0;
     this.newFlowBtn.FlatStyle = FlatStyle.Flat;
     this.newFlowBtn.FlatAppearance.BorderSize = 0;
     this.loadTypes(subzoneTypes);
 }
        /// <summary>
        /// 发送流程
        /// </summary>
        /// <param name="WorkID"></param>
        /// <param name="NodeID"></param>
        /// <param name="ToNodeID"></param>
        /// <param name="WFPARAMS"></param>
        /// <param name="NEXTWORKER"></param>
        /// <returns></returns>
        public ActionResult Node_SendWork(int WorkID, int NodeID, int ToNodeID = 0, List <KeyValuePair <string, string> > WFPARAMS = null, string NEXTWORKER = null)
        {
            var work = NH.Session.Load <WF_GenerWorkFlow>(WorkID);
            var flow = NH.Session.Load <WF_Flow>(work.FK_Flow);

            if (string.IsNullOrEmpty(work.YWH))
            {
                var ywh = Sys_BH.GetBH(flow.BHID);
                work.YWH = ywh;
                work.Update();
            }
            var node = new BP.WF.Node(NodeID);

            using (var trans = NH.Session.BeginTransaction())
            {
                try
                {
                    BP.WF.Dev2Interface.Port_Login(ApplicationUser.Current.Name, "dd2f628c-3f38-4c8c-aa83-1a52ebf6a45a");
                    if (node.IsEndNode)
                    {
                        FlowService.OnCompleted(work.FK_Flow, WorkID, work.YWH, NodeID);
                    }
                    else
                    {
                        FlowService.OnSend(work.FK_Flow, WorkID, work.YWH, NodeID);
                    }

                    WFPARAMS = WFPARAMS == null ? new List <KeyValuePair <string, string> >() : WFPARAMS;

                    var result = BP.WF.Dev2Interface.Node_SendWork(work.FK_Flow, WorkID, ToNodeID, NEXTWORKER);

                    trans.Commit();

                    var message = string.Format("案件【{0}】办理成功!", work.YWH);
                    return(Json(new { success = true, message = message }));
                }
                catch (DomainException ex)
                {
                    trans.Rollback();
                    return(Json(new { success = false, message = ex.Message }));
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    return(Json(new { success = false, message = ex.Message }));
                }
            }
        }
Exemple #26
0
        public JsonResult Index(CustomDataTableRequestHelper requestData)
        {
            try
            {
                #region " [ Declaration ] "

                FlowService _service = new FlowService();

                #endregion

                #region " [ Main processing ] "

                if (requestData.Parameter1 == null)
                {
                    requestData.Parameter1 = "";
                }
                if (requestData.Parameter2 == null) // By year month
                {
                    requestData.Parameter2 = DateTime.Now.ToString("yyyyMM");
                }
                #endregion

                //Call to service
                Dictionary <string, object> _return = _service.List(requestData, UserID);
                //
                if ((ResponseStatusCodeHelper)_return[DatatableCommonSetting.Response.STATUS] == ResponseStatusCodeHelper.OK)
                {
                    DataTableResponse <FlowModel> itemResponse = _return[DatatableCommonSetting.Response.DATA] as DataTableResponse <FlowModel>;
                    return(this.Json(itemResponse, JsonRequestBehavior.AllowGet));
                }
                //
                return(this.Json(new DataTableResponse <FlowModel>(), JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, MethodInfo.GetCurrentMethod().Name, UserID, ex);
            }
        }
Exemple #27
0
        public void FlowService_Add_Returns_ParamaterItself()
        {
            // Arrange
            var service  = new FlowService(mockFlowRepo.Object);
            var flowData = new FlowDto
            {
                Id    = Guid.NewGuid(),
                Title = "Test Flow"
            };

            // Act
            var flow = service.Add(flowData);

            // Assert
            Assert.IsNotNull(flow);
            Assert.AreEqual(flowData.Id, flow.Id);
            Assert.AreEqual(flowData.Title, flow.Title);
        }
Exemple #28
0
 public ParametersController(BasicImportService basicImportService, AlarmsService alarmsService,
                             NearestPciCellService neighborService, MrGridService mrGridService,
                             FlowService flowService, CoverageStatService coverageService, StationImportService stationImportService,
                             ZhangshangyouQualityService zhangshangyouQualityService, ZhangshangyouCoverageService zhangshangyouCoverageService,
                             HourPrbService hourKpiService, HourUsersService hourUsersService, HourCqiService hourCqiService)
 {
     _basicImportService           = basicImportService;
     _alarmsService                = alarmsService;
     _neighborService              = neighborService;
     _mrGridService                = mrGridService;
     _flowService                  = flowService;
     _coverageService              = coverageService;
     _stationImportService         = stationImportService;
     _zhangshangyouQualityService  = zhangshangyouQualityService;
     _zhangshangyouCoverageService = zhangshangyouCoverageService;
     _hourKpiService               = hourKpiService;
     _hourUsersService             = hourUsersService;
     _hourCqiService               = hourCqiService;
 }
Exemple #29
0
        protected void SaveDataItem(object sender, EventArgs e)
        {
            if (divPageError.Visible || !Page.IsValid)
            {
                // Error on page, get out of here
                return;
            }
            try
            {
                ControlsToModel();

                Model.DataService = FlowService.SaveService(Model.DataService, VisitHelper.GetVisit());

                ResponseRedirect("../Secure/Flow.aspx");
            }
            catch (Exception ex)
            {
                LOG.Error(ex.Message, ex);
                SetDivPageError(ex);
            }
        }
Exemple #30
0
        public ZoneManagement()
        {
            ZoneDAO    zoneDao    = new ZoneDAOImp();
            VehicleDAO vehicleDao = new VehicleDAOImpl();
            FlowDAO    flowDao    = new FlowDAOImp();

            this.zoneService = new ZoneServiceImp(zoneDao, flowDao, vehicleDao);
            this.flowService = new FlowServiceImp(flowDao);
            InitializeComponent();
            this.addBtn.FlatStyle = FlatStyle.Flat;
            this.addBtn.FlatAppearance.BorderSize = 0;
            this.modifyBtn.FlatStyle = FlatStyle.Flat;
            this.modifyBtn.FlatAppearance.BorderSize = 0;
            this.delBtn.FlatStyle = FlatStyle.Flat;
            this.delBtn.FlatAppearance.BorderSize     = 0;
            this.detailsBtn.FlatStyle                 = FlatStyle.Flat;
            this.detailsBtn.FlatAppearance.BorderSize = 0;
            this.assignBtn.FlatStyle = FlatStyle.Flat;
            this.assignBtn.FlatAppearance.BorderSize = 0;
            this.init();
        }
        public async Task Get_Exists_ShouldReturnFlow()
        {
            // Arrange
            var  options = BuildContextOptions();
            Flow flow;

            using (var context = new BorrowBuddyContext(options)) {
                flow = context.AddFlow();
                context.SaveChanges();
            }

            using (var context = new BorrowBuddyContext(options)) {
                var service = new FlowService(context);

                // Act
                var result = await service.GetAsync(flow.Id);

                // Assert
                Assert.NotNull(result);
            }
        }
 public DumpHuaweiFlowController(FlowService service)
 {
     _service = service;
 }
Exemple #33
0
 public void Setup()
 {
     _service = new FlowService(null, null, null, null);
 }
 public DumpZteFlowController(FlowService service)
 {
     _service = service;
 }