// Start is called before the first frame update
    void Start()
    {
        selectionManager = GameObject.Find("SelectionManager").GetComponent <SelectionManager>();
        var orderMarkGO = GameObject.Find("OrderMark");

        orderMark = GetComponentInChildren <OrderMark>(true);
    }
Esempio n. 2
0
        private void Remark(HttpContext context)
        {
            string text  = context.Request.Form["orderId"];
            int    value = base.GetIntParam(context, "remarkFlag", false).Value;
            string text2 = context.Request.Form["remarkTxt"];

            if (string.IsNullOrWhiteSpace(text))
            {
                throw new HidistroAshxException("异常的参数:订单编号");
            }
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(text);

            if (orderInfo == null)
            {
                throw new HidistroAshxException("异常的参数:订单编号");
            }
            if (text2.Length > 300)
            {
                throw new HidistroAshxException("备忘录长度限制在300个字符以内");
            }
            Regex regex = new Regex("^(?!_)(?!.*?_$)(?!-)(?!.*?-$)[a-zA-Z0-9_一-龥-]+$");

            if (!regex.IsMatch(text2))
            {
                throw new HidistroAshxException("备忘录只能输入汉字,数字,英文,下划线,减号,不能以下划线、减号开头或结尾");
            }
            text2 = Globals.HtmlEncode(text2);
            if (value > 0)
            {
                OrderMark value2 = (OrderMark)value;
                orderInfo.ManagerMark = value2;
            }
            orderInfo.ManagerRemark = text2;
            if (OrderHelper.SaveRemark(orderInfo))
            {
                base.ReturnResult(context, true, "操作成功", 0, true);
                return;
            }
            throw new HidistroAshxException("保存失败");
        }