Exemple #1
0
        public object ExecuteSaveMethod(LibClientInfo clientInfo, string accountId, string funcId, string method, LibTable[] param)
        {
            DalResult result = new DalResult();

            try
            {
                ReflectionOperate reflect = new ReflectionOperate(funcId);
                object            obj     = reflect.InstanceTarget();
                DALBase           dalBase = ((DALBase)obj);
                dalBase.AccountID = accountId;
                dalBase.ProgId    = funcId;
                dalBase.LibTables = param;
                dalBase.LibClient = clientInfo;
                //dalBase.Language = clientInfo .Language;
                Type       t    = obj.GetType();
                MethodInfo func = t.GetMethod(method);

                object[] p = new object[] { param };
                result.Value       = func.Invoke(obj, p);
                result.Messagelist = dalBase.GetMessage();
                //result.Messagelist.Add("jjjj");
            }
            catch (Exception ex)
            {
                ErrorMessage error = new ErrorMessage();
                while (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
                error.Message = ex.Message;
                error.Stack   = ex.StackTrace;
                result.ErrorMsglst.Add(error);
            }
            return(result);
        }
Exemple #2
0
        public object ExecuteDalUpdate(string accountId, string funcId)
        {
            ReflectionOperate reflect = new ReflectionOperate(funcId);
            object            obj     = reflect.InstanceTarget();
            Type       t      = obj.GetType();
            MethodInfo method = t.GetMethod("GetAccount");

            object[] param =
            {
            };
            return(method.Invoke(obj, null));
        }
Exemple #3
0
        public object ExecuteDalMethod(string accountId, int language, string funcId, string method, params object[] param)
        {
            ReflectionOperate reflect = new ReflectionOperate(funcId);
            object            obj     = reflect.InstanceTarget();
            DALBase           dalBase = ((DALBase)obj);

            dalBase.AccountID = accountId;
            //dalBase.Language = (Language)language;
            Type       t    = obj.GetType();
            MethodInfo func = t.GetMethod(method);

            return(func.Invoke(obj, param));
        }