Beispiel #1
0
    public static DataSet GetWTOList_Detail(int YJId)
    {
        AdoHelper adoHelper = AdoHelper.CreateHelper(DBInstance_hzzlw);

        SqlParameter[] parameters =
        {
            new SqlParameter("@YJID", SqlDbType.BigInt, 8)
        };
        parameters[0].Value = YJId;
        return(adoHelper.ExecuteSPDataset("UP_WTO_CKZK_GetList", parameters));
    }
Beispiel #2
0
        /// <summary>
        /// 查询分页
        /// </summary>
        /// <param name="ado">数据库选项</param>
        /// <param name="fields">字段</param>
        /// <param name="viewtablesql">表名</param>
        /// <param name="filter">查询sql语句</param>
        /// <param name="sort">排序sql语句</param>
        /// <param name="currentPageIndex">当前页</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="recordCount">数据总量</param>
        /// <returns></returns>
        public static DataTable GetPaginationList(AdoHelper ado, string fields, string viewtablesql, string filter, string sort, int currentPageIndex, int pageSize, out int recordCount)
        {
            SqlParameter[] paras = new SqlParameter[7];
            paras[0]           = new SqlParameter("@RecordCount", SqlDbType.Int, 4);
            paras[0].Direction = ParameterDirection.Output;
            paras[1]           = new SqlParameter("@QueryStr", viewtablesql);
            paras[2]           = new SqlParameter("@FdShow", fields);
            paras[3]           = new SqlParameter("@FdOrder", sort);
            paras[4]           = new SqlParameter("@Where", "where " + filter);
            paras[5]           = new SqlParameter("@PageCurrent", currentPageIndex);
            paras[6]           = new SqlParameter("@PageSize", pageSize);
            DataSet list = ado.ExecuteSPDataset("sp_list", (IDataParameter[])paras);

            recordCount = ParseToInt(paras[0].Value);
            return(list.Tables[0]);
        }
Beispiel #3
0
        public static DataSet GetPaginationList_hzzlw(string fields, string viewtablesql, string filter, string sort, int currentPageIndex, int pageSize, out int recordCount)
        {
            AdoHelper adoHelper_hzzlw = AdoHelper.CreateHelper("DB_InstanceHzqts");

            SqlParameter[] paras = new SqlParameter[7];
            paras[0]           = new SqlParameter("@RecordCount", SqlDbType.Int, 4);
            paras[0].Direction = ParameterDirection.Output;
            paras[1]           = new SqlParameter("@QueryStr", viewtablesql);
            paras[2]           = new SqlParameter("@FdShow", fields);
            paras[3]           = new SqlParameter("@FdOrder", "order by " + sort);
            paras[4]           = new SqlParameter("@Where", "where " + filter);
            paras[5]           = new SqlParameter("@PageCurrent", currentPageIndex + 1);
            paras[6]           = new SqlParameter("@PageSize", pageSize);
            DataSet list = adoHelper_hzzlw.ExecuteSPDataset("sp_list", (IDataParameter[])paras);

            recordCount = Convert.ToInt32(paras[0].Value);
            return(list);
        }
Beispiel #4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public LinkModel GetModel(int LinkId)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@LinkId", SqlDbType.BigInt)
            };
            parameters[0].Value = LinkId;

            LinkModel model = new LinkModel();
            DataSet   ds    = adoHelper.ExecuteSPDataset("sp_Link_GetModel", parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["LinkId"].ToString() != "")
                {
                    model.LinkId = long.Parse(ds.Tables[0].Rows[0]["LinkId"].ToString());
                }
                model.Title = ds.Tables[0].Rows[0]["Title"].ToString();
                model.Link  = ds.Tables[0].Rows[0]["Link"].ToString();
                model.Image = ds.Tables[0].Rows[0]["Image"].ToString();
                if (ds.Tables[0].Rows[0]["DisplayMode"].ToString() != "")
                {
                    model.DisplayMode = int.Parse(ds.Tables[0].Rows[0]["DisplayMode"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                {
                    model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CategoryId"].ToString() != "")
                {
                    model.CategoryId = int.Parse(ds.Tables[0].Rows[0]["CategoryId"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #5
0
    public static DataTable GetAnalyseItem(string task_id, string task_scene_id, string item_id, ref string group_id)
    {
        DataTable dt = new DataTable();

        SqlParameter[] para =
        {
            new SqlParameter("@taskId",      SqlDbType.UniqueIdentifier, 50),
            new SqlParameter("@taskSceneId", SqlDbType.UniqueIdentifier, 50),
            new SqlParameter("@itemIdList",  SqlDbType.VarChar, 4000)
        };
        Guid tempGuid = new Guid(task_id);

        para[0].Value = tempGuid;
        tempGuid      = new Guid(task_scene_id);
        para[1].Value = tempGuid;
        para[2].Value = item_id;
        dt            = adoHelper.ExecuteSPDataset("p_get_analyse_group_item_scene", para).Tables[0];
        if (dt != null && dt.Rows.Count > 0)
        {
            group_id = Convert.ToString(dt.Rows[0]["group_id"]);
        }
        return(dt);
    }
Beispiel #6
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public LinkCategoryModel GetModel(int ID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.BigInt)
            };
            parameters[0].Value = ID;

            LinkCategoryModel model = new LinkCategoryModel();
            DataSet           ds    = adoHelper.ExecuteSPDataset("sp_LinkCategory_GetModel", parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                model.Category = ds.Tables[0].Rows[0]["Category"].ToString();
                if (ds.Tables[0].Rows[0]["AddedDate"].ToString() != "")
                {
                    model.AddedDate = DateTime.Parse(ds.Tables[0].Rows[0]["AddedDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                {
                    model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Type"].ToString() != "")
                {
                    model.Type = int.Parse(ds.Tables[0].Rows[0]["Type"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public NewsModel GetModel(int NewsID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@NewsID", SqlDbType.Int, 4)
            };
            parameters[0].Value = NewsID;

            NewsModel model = new NewsModel();
            DataSet   ds    = adoHelper.ExecuteSPDataset("sp_News_GetModel", parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["NewsID"].ToString() != "")
                {
                    model.NewsID = int.Parse(ds.Tables[0].Rows[0]["NewsID"].ToString());
                }
                model.Title   = ds.Tables[0].Rows[0]["Title"].ToString();
                model.SubHead = ds.Tables[0].Rows[0]["SubHead"].ToString();
                model.Body    = ds.Tables[0].Rows[0]["Body"].ToString();
                if (ds.Tables[0].Rows[0]["AddedUserId"].ToString() != "")
                {
                    model.AddedUserId = int.Parse(ds.Tables[0].Rows[0]["AddedUserId"].ToString());
                }
                model.PublicationUnit = ds.Tables[0].Rows[0]["PublicationUnit"].ToString();
                if (ds.Tables[0].Rows[0]["AddedDate"].ToString() != "")
                {
                    model.AddedDate = DateTime.Parse(ds.Tables[0].Rows[0]["AddedDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsTop"].ToString() != "")
                {
                    model.IsTop = int.Parse(ds.Tables[0].Rows[0]["IsTop"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IndexCommend"].ToString() != "")
                {
                    model.IndexCommend = int.Parse(ds.Tables[0].Rows[0]["IndexCommend"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ArticleType"].ToString() != "")
                {
                    model.ArticleType = int.Parse(ds.Tables[0].Rows[0]["ArticleType"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ReleaseDate"].ToString() != "")
                {
                    model.ReleaseDate = DateTime.Parse(ds.Tables[0].Rows[0]["ReleaseDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ExpireDate"].ToString() != "")
                {
                    model.ExpireDate = DateTime.Parse(ds.Tables[0].Rows[0]["ExpireDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CategoryId"].ToString() != "")
                {
                    model.CategoryId = int.Parse(ds.Tables[0].Rows[0]["CategoryId"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Approved"].ToString() != "")
                {
                    model.Approved = int.Parse(ds.Tables[0].Rows[0]["Approved"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ViewCount"].ToString() != "")
                {
                    model.ViewCount = int.Parse(ds.Tables[0].Rows[0]["ViewCount"].ToString());
                }
                model.ImgLink = ds.Tables[0].Rows[0]["ImgLink"].ToString();
                if (ds.Tables[0].Rows[0]["IsState"].ToString() != "")
                {
                    model.IsState = int.Parse(ds.Tables[0].Rows[0]["IsState"].ToString());
                }
                model.HotPic  = ds.Tables[0].Rows[0]["HotPic"].ToString();
                model.KeyWord = ds.Tables[0].Rows[0]["KeyWord"].ToString();
                if (ds.Tables[0].Rows[0]["HotDays"].ToString() != "")
                {
                    model.HotDays = int.Parse(ds.Tables[0].Rows[0]["HotDays"].ToString());
                }
                model.FromSource = ds.Tables[0].Rows[0]["FromSource"].ToString();
                if (ds.Tables[0].Rows[0]["IsComment"].ToString() != "")
                {
                    model.IsComment = int.Parse(ds.Tables[0].Rows[0]["IsComment"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsScrool"].ToString() != "")
                {
                    model.IsScrool = int.Parse(ds.Tables[0].Rows[0]["IsScrool"].ToString());
                }
                model.Period = ds.Tables[0].Rows[0]["Period"].ToString();
                if (ds.Tables[0].Rows[0]["Leaderid"].ToString() != "")
                {
                    model.Leaderid = int.Parse(ds.Tables[0].Rows[0]["Leaderid"].ToString());
                }
                model.ShareToPlatform = ds.Tables[0].Rows[0]["ShareToPlatform"].ToString();
                model.ShareToSubject  = ds.Tables[0].Rows[0]["ShareToSubject"].ToString();
                model.ShareToMarket   = ds.Tables[0].Rows[0]["ShareToMarket"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }