Пример #1
0
    void specialItemChoose()
    {
        currentButton.LoadSprite(currentButton.sprite.name.Replace("_h", ""));
        currentButton = null;
        m_uplane.SetActive(false);
        chooseResult = global::specialItemChoose.None;

        List <UPageBase> list = m_uplane.GetChildren();

        UPageBase.FindPage("ChooseGoodsUI/ChooseItems/chooseItemFinishButton").gameObejct.SetActive(true);
        if (btnName == "right")
        {
            specialItem.bIsOk = true;
            specialItem.ChangeState();
            chooseResult = global::specialItemChoose.right;
        }
        else
        {
            specialItem.bIsOk = false;
            //specialItem.errorIcon.SetActive(true);
            specialItem.ChangeState();
            if (btnName == "overdate")
            {
                chooseResult = global::specialItemChoose.overDate;
            }
            //else if (tmp.getimage() == breakImage)
            //{
            //    chooseResult = global::specialItemChoose.broken;
            //}
            else if (btnName == "error")
            {
                chooseResult = global::specialItemChoose.wrongType;
            }
        }
        if (string.IsNullOrEmpty(btnName))
        {
            OnSpecialNone.Invoke();
            return;
        }

        m_uplane.gameObejct.SetActive(false);
        if (OnItemStateChange != null)
        {
            OnItemStateChange();
        }
    }
Пример #2
0
    //private static Dictionary<string, string> GetUrlDatas()
    //{
    //    string cacheName = "UrlDatas";
    //    Object ret = HttpContext.Current.Cache.Get(cacheName);
    //    if (ret == null)
    //    {
    //        Dictionary<string, string> pageNames = new Dictionary<string, string>();
    //        string path = HttpContext.Current.Server.MapPath("~/App_Data/Biz/ERP/urlData.xml");
    //        if (!File.Exists(path))
    //        {
    //            ExceptionHander.GoToErrorPage();
    //        }

    //        XmlDocument doc = new XmlDocument();
    //        doc.Load(path);
    //        XmlNodeList list = doc.SelectNodes("UrlDatas/UrlData");
    //        foreach (XmlNode item in list)
    //        {
    //            pageNames.Add(item.Attributes["type"].Value, item.InnerText);
    //        }
    //        HttpContext.Current.Cache.Insert(cacheName, pageNames, new System.Web.Caching.CacheDependency(path));
    //        return pageNames;
    //    }

    //    return ret as Dictionary<string, string>;
    //}

    public static string GetErpFormTitle(UPageBase page)
    {
        string formTitle = HttpContext.Current.Request["formTitle"];
        string id        = HttpContext.Current.Request["Id"];

        if (string.IsNullOrEmpty(id))
        {//新建页面
            if (string.IsNullOrEmpty(formTitle))
            {
                return("ERP合同审批");
            }
            return(formTitle);
        }
        else
        {
            return(page._BPMContext.ProcInst.ProcName);
        }
    }
Пример #3
0
    void setSpecialObjPlane(soloItem item)
    {
        specialItem = item;
        if (m_uplane != null)
        {
            m_uplane.Destroy();
        }

        string str = "right,error,overdate";

        if (btnList.Count == 0)
        {
            foreach (var number in MyCommon.RandomRepeat(3))
            {
                btnList.Add(str.Split(',')[number]);
            }
        }

        m_uplane = new UPlane();                             //定义UI
        m_uplane.SetAnchored(AnchoredPosition.center);       //定义位置远点
        m_uplane.rect = new Rect(65, 0, 1620, 1080 / 6 * 5); //定义显示框的位置的大小
        m_uplane.gameObejct.AddComponent <ToggleGroup>();    //副节点
        m_uplane.color = new Color(0.9f, 0.9f, 0.9f);
        m_uplane.LoadImage("");

        UText m_utext = new UText();

        m_utext.SetAnchored(AnchoredPosition.center);
        m_utext.text = "请选择正确物品";
        m_utext.rect = new Rect(100, -375, 500, 100);
        m_utext.baseText.fontSize = 55;
        m_utext.baseText.color    = Color.white;
        m_utext.SetParent(m_uplane);

        for (int i = 0; i < btnList.Count; i++)
        {
            UPageButton btn = new UPageButton();
            btn.SetParent(m_uplane);
            btn.name = btnList[i];
            btn.SetAnchored(AnchoredPosition.center);
            btn.rect = new Rect(-540 + i * 500 + 50, 9, 500, 300);
            btn.LoadSprite("check_anesthetic_3");
            btn.LoadPressSprite("check_anesthetic_3_h");
            btn.onClick.AddListener(() => { OnImageButtonClick(btn); });

            UText m_datetext_1 = new UText();
            m_datetext_1.SetAnchored(AnchoredPosition.center);
            m_datetext_1.SetParent(m_uplane);
            m_datetext_1.rect = new Rect(-300 + i * 500 + 50, 240, 500, 300);
            m_datetext_1.baseText.fontSize = 23;
            m_datetext_1.baseText.color    = new Color(0f, 0f, 0f);

            m_datetext_1.rectTransform.localEulerAngles = new Vector3(0f, 0f, 5.6f);
            m_datetext_1.baseText.raycastTarget         = false;
            UText m_type_1 = new UText();

            m_type_1.SetAnchored(AnchoredPosition.center);
            m_type_1.SetParent(m_uplane);
            m_type_1.rect           = new Rect(-300 + i * 500 + 50, 200, 500, 300);
            m_type_1.baseText.color = new Color(0f, 0f, 0f);
            m_type_1.rectTransform.localEulerAngles = new Vector3(0f, 0f, 5.6f);
            m_type_1.baseText.fontSize      = 23;
            m_type_1.baseText.raycastTarget = false;
            if (btnList[i] == "right")
            {
                m_datetext_1.text = "有效日期: " + (DateTime.Now.Year + 2).ToString() + "年" + (DateTime.Now.Month.ToString()) + "月1日";
                m_type_1.text     = "规格:16Fr        ";
            }
            else
            {
                if (btnList[i] == "error")
                {
                    m_datetext_1.text = "有效日期: " + (DateTime.Now.Year + 2).ToString() + "年" + (DateTime.Now.Month.ToString()) + "月1日";
                    m_type_1.text     = "规格:8Fr\0\0\0\0\0\0\0\0";
                }
                else
                {
                    m_type_1.text     = "规格:16Fr\r\r\r\r\r\r   ";
                    m_datetext_1.text = "有效日期: " + (DateTime.Now.Year - 1).ToString() + "年" + (DateTime.Now.Month.ToString()) + "月1日";
                }
            }
        }


        UFinishButton OkButton = new UFinishButton("确定", new Rect(23, 363, 180, 70), AnchoredPosition.center);

        OkButton.SetParent(m_uplane);
        OkButton.baseButton.onClick.AddListener(specialItemChoose);

        m_uplane.transform.SetAsLastSibling();
        List <UPageBase> list = m_uplane.GetChildren();

        foreach (UPageBase upb in list)
        {
            UToogleItem tmp = null;
            try
            {
                tmp = (UToogleItem)upb;
            }
            catch
            {
                continue;
            }

            if (tmp != null)
            {
                upb.gameObejct.GetComponent <Toggle>().isOn = false;
            }
        }
        m_uplane.gameObejct.SetActive(true);
        UPageBase.FindPage("ChooseGoodsUI/ChooseItems/chooseItemFinishButton").gameObejct.SetActive(false);
        //GameObject.Find("Canvas").transform.Find("ChooseItems/UPageButton").gameObject.SetActive(false);
    }