Ejemplo n.º 1
0
        //{F8B5A5CE-4BDF-4bcb-A57B-AD635CA0B5AE}
        public static System.Drawing.Color GetPactColor(string pactCode)
        {
            Neusoft.FrameWork.Management.ControlParam ctlMgr = new Neusoft.FrameWork.Management.ControlParam();

            string returnValue = ctlMgr.QueryControlerInfo("Pact" + pactCode);

            return(System.Drawing.Color.FromArgb(Neusoft.FrameWork.Function.NConvert.ToInt32(returnValue)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得控制参数值,如果数据库出错等原因返回输入的T类型 defaultValue
        /// </summary>
        /// <typeparam name="T">获得的参数类型 例如Int</typeparam>
        /// <param name="controlCode">参数编码</param>
        /// <param name="isRefresh">是否重新刷新数据库</param>
        /// <param name="defaultValue">T类型的默认值</param>
        /// <returns>成功 当前T类型参数值 失败 T 类型的传入默认值</returns>
        public T GetControlParam <T>(string controlCode, bool isRefresh, T defaultValue)
        {
            this.SetDB(controlParam);

            string tempReturnValue = controlParam.QueryControlerInfo(controlCode, isRefresh);

            //如果参数获得错误,默认返回false
            if (tempReturnValue == null || tempReturnValue == "-1")
            {
                return(defaultValue);
            }

            T tempValue = default(T);

            switch (Type.GetTypeCode(typeof(T)))
            {
            case TypeCode.String:
                tempValue = (T)(object)tempReturnValue;

                break;

            case TypeCode.Int32:
                tempValue = (T)(object)Neusoft.FrameWork.Function.NConvert.ToInt32(tempReturnValue);

                break;

            case TypeCode.Boolean:
                tempValue = (T)(object)Neusoft.FrameWork.Function.NConvert.ToBoolean(tempReturnValue);

                break;

            case TypeCode.Decimal:
                tempValue = (T)(object)Neusoft.FrameWork.Function.NConvert.ToDecimal(tempReturnValue);

                break;

            case TypeCode.DateTime:
                tempValue = (T)(object)Neusoft.FrameWork.Function.NConvert.ToDateTime(tempReturnValue);

                break;
            }

            return(tempValue);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 获得是否可以开库存为零的药品
 /// </summary>
 /// <returns></returns>
 public static int GetIsOrderCanNoStock()
 {
     Neusoft.FrameWork.Management.ControlParam controler = new Neusoft.FrameWork.Management.ControlParam();
     return(Neusoft.FrameWork.Function.NConvert.ToInt32(controler.QueryControlerInfo("200001")));
 }