protected override IPointBehaiver DrawPoint(Point point, ViewRule rule)
        {
            PointBehaiver behaiver = null;

            if (pointPool.Count > 0)
            {
                behaiver = pointPool.Dequeue();
                behaiver.Body.SetActive(true);
            }
            else
            {
                var instence = new GameObject(point.id, typeof(PointBehaiver));
                instence.transform.SetParent(pointParent);
                behaiver           = instence.GetComponent <PointBehaiver>();
                behaiver.onClicked = (x) => { if (onClickPoint != null)
                                              {
                                                  onClickPoint(x);
                                              }
                };
                behaiver.onHover = (x) => { if (onHoverPoint != null)
                                            {
                                                onHoverPoint(x);
                                            }
                };
            }
            behaiver.OnInitialized(point);
            return(behaiver);
        }
Пример #2
0
        protected override ILineBehaiver DrawLine(Line line, ViewRule rule)
        {
            LineBehaiver behaiver = null;

            if (linePool.Count > 0)
            {
                behaiver = linePool.Dequeue();
                behaiver.Body.SetActive(true);
            }

            else
            {
                var instence = new GameObject(line.id, typeof(LineBehaiver));
                instence.transform.SetParent(lineParent);
                behaiver           = instence.GetComponent <LineBehaiver>();
                behaiver.onClicked = (x) => { if (onClickLine != null)
                                              {
                                                  onClickLine(x.Info);
                                              }
                                              Debug.Log("click:" + x); };
            }
            var startPoint = linesObject.points.Find(x => x.id == line.fromNodeId);
            var endPoint   = linesObject.points.Find(x => x.id == line.toNodeId);

            behaiver.Body.transform.localPosition = (startPoint.position + endPoint.position) * 0.5f;
            behaiver.Body.transform.forward       = (endPoint.position - startPoint.position).normalized;
            behaiver.ReSetLength(Vector3.Distance(endPoint.position, startPoint.position));
            behaiver.OnInitialized(line);
            behaiver.SetMaterial(rule.GetMaterial(line.type));
            behaiver.SetLineWidth(rule.GetLineWidth(line.type));
            behaiver.SetColor(rule.GetColor(line.type));
            return(behaiver);
        }
Пример #3
0
        // GET: BonusImpower
        public ActionResult Index(string userID, string CompanyID)
        {
            try
            {
                //解密
                CompanyID = Base64MIMA.JIE(CompanyID);
                userID    = Base64MIMA.JIE(userID);
                //加密
                ViewBag.CompanyId = Base64MIMA.JIA(CompanyID);
                ViewBag.UserID    = Base64MIMA.JIA(userID);
            }
            catch (Exception)
            {
                //跳转错误页面
                return(Redirect("/ErrorPage/Index"));
            }
            //判断登录系统的用户是不是奖金项负责人
            int rule = ViewRule.GetRule(userID);

            if (rule > 0)
            {
                //主页面显示被授权人列表
                //string namesql = string.Format("SELECT DISTINCT e.EmpID,Name FROM dbo.Employee e INNER JOIN dbo.BonusImpower b ON b.EmpID = e.EmpID");
                //DataTable emp = sql.GetDataTableCommand(namesql);
                //if (emp.Rows.Count > 0)
                //{
                //    ViewBag.emp = emp;
                //}
                //else
                //{
                //    ViewBag.emp = emp;
                //}

                //主页面显示奖金项负责人被授权过的奖金项列表
                //string itemsql = string.Format("SELECT BonusImpower.BonusItemID,BIName,BIPrincipal FROM dbo.BonusImpower INNER JOIN dbo.BonusItem ON BonusItem.BonusItemID = BonusImpower.BonusItemID WHERE BIPrincipal='{0}'",userID);

                //主页面显示奖金项负责人可以授权的奖金项列表
                string    itemsql = string.Format("SELECT BonusItem.BonusItemID,BIPrincipal,BIName FROM BonusItem WHERE BIState=0 AND BIPRincipal='{0}' and CompanyID='{1}'", userID, CompanyID);
                DataTable emp     = sql.GetDataTableCommand(itemsql);
                if (emp.Rows.Count > 0)
                {
                    ViewBag.emp = emp;
                }
                else
                {
                    ViewBag.emp    = null;
                    ViewBag.userid = userID;
                }
                return(View());
            }
            else
            {
                return(Content("<script> alert('您不是奖金项负责人暂无此页面的操作权限!'); history.go(-1);</script>"));
            }
        }
Пример #4
0
        public ActionResult Edit(string id)
        {
            ViewRule viewmodel = new ViewRule();

            AspectF.Define
            .Log(log, "RuleController-Edit[get]开始", "RuleController-Edit[get]结束")
            .HowLong(log)
            .Retry(log)
            .Do(() =>
            {
                BizRule bizRule = new BizRule();
                bizRule.RuleID  = id;
                bizRule         = ruleService.Single(bizRule);
                DBToViewForModel(bizRule, viewmodel);
            });
            return(new JsonResultPro(viewmodel, JsonRequestBehavior.AllowGet, "yyyy-MM-dd HH:mm:ss"));
        }