Esempio n. 1
0
        public bool GetParamValue(out object val)
        {
            val             = null;
            _paramErrorInfo = "";

            try
            {
                if (proty.Value == null)
                {
                    _paramErrorInfo = "输入参数为空";
                    return(false);
                }

                if (proty.TConverter is JFComboItemConvert)
                {
                    JFComboItemConvert cmb = (JFComboItemConvert)proty.TConverter;
                    if (cmb.myRealhash.ContainsKey(proty.Value))
                    {
                        val = cmb.myRealhash[proty.Value];
                    }
                }
                else
                {
                    val = proty.Value;
                }
                return(true);
            }
            catch (Exception ex)
            {
                _paramErrorInfo = ex.Message;
                val             = null;
                return(false);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 设置参数值
 /// </summary>
 /// <param name="pv"></param>
 public void SetParamValue(object pv)
 {
     if (pv != null)
     {
         if (proty.TConverter is JFComboItemConvert)
         {
             JFComboItemConvert cmb = (JFComboItemConvert)proty.TConverter;
             foreach (DictionaryEntry myDE in cmb.myRealhash)
             {
                 if (myDE.Value.Equals(pv))
                 {
                     proty.Value = myDE.Key;
                     break;
                 }
             }
         }
         else
         {
             proty.Value = pv;
         }
         this.pGrid.SelectedObject = proCollect;
         this.pGrid.Refresh();
     }
     else //Added by bob
     {
         proty.Value = pv;
         this.pGrid.SelectedObject = proCollect;
         this.pGrid.Refresh();
     }
 }