Example #1
0
        public string GetJson(string userId)
        {
            var json = new JavaScriptSerializer();

            try
            {
                //获取公司用户菜单列表
                string         sql        = " exec  SelectUserFunction @UserID";
                SqlParameter[] parameters = new SqlParameter[1];
                parameters[0] = new SqlParameter("@UserID", userId);
                System.Data.DataSet ds = FMHJJBLL.ExecuteQuerySentence(sql, parameters);
                if (ds.Tables.Count != 1)
                {
                    return(string.Empty);
                }

                var list = Utils.GetModelList <UserFunctionsModel>(ds.Tables[0]);

                //将对象转换为JSON字符串
                return(json.Serialize(list));
            }
            catch
            {
                return(string.Empty);
            }
        }
        private List <FinalBiddingInfoModel> getFinalBiddingInfoList(int bidId)
        {
            string sql = " exec GetFinalist @BidID";

            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0] = new SqlParameter("@BidID", bidId);
            System.Data.DataSet ds = FMHJJBLL.ExecuteQuerySentence(sql, parameters);
            if (ds.Tables.Count == 1)
            {
                return(Utils.GetModelList <FinalBiddingInfoModel>(ds.Tables[0]));
            }

            return(new List <FinalBiddingInfoModel>());
        }