发布网友 发布时间:2022-04-19 19:49
共7个回答
懂视网 时间:2022-04-12 22:46
生成 内容 1.ACCESS 2.net2.0的泛型操作的 3.。net3.5-4.0的linq to entity 生成 的net2.0 代码 MODEL using System;using System.Collections.Generic;namespace ChineseCode.Bll{public class News{/// summary/// /// /summarypublic int NewsId{set;get;
生成内容
1.ACCESS
2.net2.0的泛型操作的
3.。net3.5-4.0的linq to entity
生成的net2.0代码
MODEL
using System; using System.Collections.Generic; namespace ChineseCode.Bll { public class News { ////// /// public int NewsId { set; get; } ////// /// public int UserID { set; get; } ////// /// public int TypeID { set; get; } ////// /// public string Author { set; get; } ////// /// public string Title { set; get; } ////// /// public string Excerpts { set; get; } ////// /// public string Body { set; get; } ////// /// public string Image { set; get; } ////// /// public int Views { set; get; } ////// /// public bool IsApprived { set; get; } ////// /// public bool CheckResult { set; get; } ////// /// public int DisplayOrder { set; get; } ////// /// public bool IsCommend { set; get; } ////// /// public string Sourse { set; get; } ////// /// public DateTime CreateDate { set; get; } ////// /// public string PostIP { set; get; } ////// /// public DateTime? UpdateDate { set; get; } //////获取单个模型 /// private Users _Users; public Users Users { get { if (_Users == null) { _Users = UsersManager.GetModel(this.UserID); return _Users; } return _Users; } } //////获取单个模型 /// private NewsType _NewsType; public NewsType NewsType { get { if (_NewsType == null) { _NewsType = NewsTypeManager.GetModel(this.TypeID); return _NewsType; } return _NewsType; } } } }
BLL
using System; using System.Collections.Generic; using System.Text; using JrdLibrary; using System.Data; using System.Data.SqlClient; namespace ChineseCode.Bll { public class NewsManager { #region 获取实体方法 ////// 获取一个实体类 /// public static News GetModel(SqlDataReader reader) { return SqlDataReaderExt.ReaderToModel(reader); } /// /// 获取一个实体类集合 /// public static ListGetList(SqlDataReader reader) { return SqlDataReaderExt.ReaderToList (reader); } #endregion /// /// 创建一个有默认值的Model /// public static News CreateModel() { News model = new News(); model.Views = 0; model.IsApprived = true; model.CheckResult = true; model.DisplayOrder = 0; model.IsCommend = false; model.CreateDate = DateTime.Now; return model; } ////// 增加一条数据 /// public static int Insert(News model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into Jrd_News("); strSql.Append("UserID,TypeID,Author,Title,Excerpts,Body,Image,Views,IsApprived,CheckResult,DisplayOrder,IsCommend,Sourse,CreateDate,PostIP)"); strSql.Append(" values ("); strSql.Append("@UserID,@TypeID,@Author,@Title,@Excerpts,@Body,@Image,@Views,@IsApprived,@CheckResult,@DisplayOrder,@IsCommend,@Sourse,@CreateDate,@PostIP)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@UserID", SqlDbType.Int,4), new SqlParameter("@TypeID", SqlDbType.Int,4), new SqlParameter("@Author",SqlDbType.NVarChar,100), new SqlParameter("@Title",SqlDbType.NVarChar,400), new SqlParameter("@Excerpts",SqlDbType.NVarChar,1000), new SqlParameter("@Body",SqlDbType.NText), new SqlParameter("@Image",SqlDbType.VarChar,100), new SqlParameter("@Views", SqlDbType.Int,4), new SqlParameter("@IsApprived",SqlDbType.Bit,1), new SqlParameter("@CheckResult",SqlDbType.Bit,1), new SqlParameter("@DisplayOrder", SqlDbType.Int,4), new SqlParameter("@IsCommend",SqlDbType.Bit,1), new SqlParameter("@Sourse",SqlDbType.NVarChar,200), new SqlParameter("@CreateDate",SqlDbType.DateTime), new SqlParameter("@PostIP",SqlDbType.VarChar,20) }; parameters[0].Value = model.UserID; parameters[1].Value = model.TypeID; parameters[2].Value = model.Author; parameters[3].Value = model.Title; parameters[4].Value = model.Excerpts; parameters[5].Value = model.Body; parameters[6].Value = model.Image; parameters[7].Value = model.Views; parameters[8].Value = model.IsApprived; parameters[9].Value = model.CheckResult; parameters[10].Value = model.DisplayOrder; parameters[11].Value = model.IsCommend; parameters[12].Value = model.Sourse; parameters[13].Value = model.CreateDate; parameters[14].Value = model.PostIP; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } } ////// 更新一条数据 /// public static bool Update(News model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Jrd_News set "); strSql.Append("UserID=@userID,TypeID=@typeID,Author=@author,Title=@title,Excerpts=@excerpts,Body=@body,Image=@image,Views=@views,IsApprived=@isApprived,CheckResult=@checkResult,DisplayOrder=@displayOrder,IsCommend=@isCommend,Sourse=@sourse,PostIP=@postIP,UpdateDate=@updateDate "); strSql.Append(" where NewsId=@NewsId"); SqlParameter[] parameters = { new SqlParameter("@UserID", SqlDbType.Int,4), new SqlParameter("@TypeID", SqlDbType.Int,4), new SqlParameter("@Author",SqlDbType.NVarChar,100), new SqlParameter("@Title",SqlDbType.NVarChar,400), new SqlParameter("@Excerpts",SqlDbType.NVarChar,1000), new SqlParameter("@Body",SqlDbType.NText), new SqlParameter("@Image",SqlDbType.VarChar,100), new SqlParameter("@Views", SqlDbType.Int,4), new SqlParameter("@IsApprived",SqlDbType.Bit,1), new SqlParameter("@CheckResult",SqlDbType.Bit,1), new SqlParameter("@DisplayOrder", SqlDbType.Int,4), new SqlParameter("@IsCommend",SqlDbType.Bit,1), new SqlParameter("@Sourse",SqlDbType.NVarChar,200), new SqlParameter("@PostIP",SqlDbType.VarChar,20), new SqlParameter("@UpdateDate",SqlDbType.DateTime), new SqlParameter("@NewsId", SqlDbType.Int,4) }; parameters[0].Value = model.UserID; parameters[1].Value = model.TypeID; parameters[2].Value = model.Author; parameters[3].Value = model.Title; parameters[4].Value = model.Excerpts; parameters[5].Value = model.Body; parameters[6].Value = model.Image; parameters[7].Value = model.Views; parameters[8].Value = model.IsApprived; parameters[9].Value = model.CheckResult; parameters[10].Value = model.DisplayOrder; parameters[11].Value = model.IsCommend; parameters[12].Value = model.Sourse; parameters[13].Value = model.PostIP; parameters[14].Value = model.UpdateDate; parameters[15].Value = model.NewsId; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } } ////// 删除一条数据 /// public static bool Delete(int newsId) { StringBuilder strSql=new StringBuilder(); strSql.Append("delete from Jrd_News "); strSql.Append(" where NewsId=@NewsId"); SqlParameter[] parameters = { new SqlParameter("@NewsId", SqlDbType.Int,4) }; parameters[0].Value = newsId; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } } ////// 是否存在该记录 /// public static bool Exists(int newsId) { StringBuilder strSql=new StringBuilder(); strSql.Append("select count(1) from Jrd_News"); strSql.Append(" where NewsId=@NewsId"); SqlParameter[] parameters = { new SqlParameter("@NewsId", SqlDbType.Int,4) }; parameters[0].Value = newsId; return DbHelperSQL.Exists(strSql.ToString(),parameters); } ////// 得到一个对象实体 /// public static News GetModel(int newsId) { StringBuilder strSql=new StringBuilder(); strSql.Append("select top 1 NewsId,UserID,TypeID,Author,Title,Excerpts,Body,Image,Views,IsApprived,CheckResult,DisplayOrder,IsCommend,Sourse,CreateDate,PostIP from Jrd_News "); strSql.Append(" where NewsId=@NewsId"); SqlParameter[] parameters = { new SqlParameter("@NewsId", SqlDbType.Int,4) }; parameters[0].Value = newsId; return GetModel(DbHelperSQL.ExecuteReader(strSql.ToString(),parameters)); } ////// 获得全部数据 /// public static ListGetAll() { StringBuilder strSql=new StringBuilder(); strSql.Append("select NewsId,UserID,TypeID,Author,Title,Excerpts,Body,Image,Views,IsApprived,CheckResult,DisplayOrder,IsCommend,Sourse,CreateDate,PostIP "); strSql.Append(" FROM Jrd_News "); return GetList(DbHelperSQL.ExecuteReader(strSql.ToString(),null)); } /// ///根据UserID获取列表 /// public static ListGetNewsByUserID(string andStr,int userID, int PageSize,int PageCurrent,string FdOrder, ref int totalCount) { SqlQuery query = new SqlQuery(); query.Add("UserID", userID, QueryOperator.Equal); return GetPager(query.GetWhere + andStr, PageSize, PageCurrent, FdOrder, SortType.DESC, ref totalCount); } /// ///根据TypeID获取列表 /// public static ListGetNewsByTypeID(string andStr,int typeID, int PageSize,int PageCurrent,string FdOrder, ref int totalCount) { SqlQuery query = new SqlQuery(); query.Add("TypeID", typeID, QueryOperator.Equal); return GetPager(query.GetWhere + andStr, PageSize, PageCurrent, FdOrder, SortType.DESC, ref totalCount); } /// /// 根据排序分页获取数据列表 /// public static ListGetPagerByDisplayOrder(string strWhere, int PageSize, int PageCurrent,SortType sort, ref int RecordCount) { return GetPager(strWhere, PageSize, PageCurrent, "DisplayOrder" , sort, ref RecordCount); } /// /// 根据浏览分页获取数据列表 /// public static ListGetPagerByViews(string strWhere, int PageSize, int PageCurrent, SortType sort, ref int RecordCount) { return GetPager(strWhere, PageSize, PageCurrent, "Views" , sort, ref RecordCount); } /// /// 分页获取数据列表 /// public static ListGetPager(string strWhere, int PageSize, int PageCurrent, string FdOrder,SortType sort, ref int RecordCount) { string sqlStr="select cast(NewsId as int) as NewsId,UserID,TypeID,Author,Title,Excerpts,Body,Image,Views,IsApprived,CheckResult,DisplayOrder,IsCommend,Sourse,CreateDate,PostIP,UpdateDate from Jrd_News "; if (string.IsNullOrEmpty(FdOrder) || FdOrder == "") FdOrder ="NewsId Desc"; else FdOrder = FdOrder + " " + sort.ToString(); return GetList(PagerBll.GetPagerReader(sqlStr + strWhere, PageSize, PageCurrent, "", FdOrder, ref RecordCount)); } } }
热心网友 时间:2022-04-12 19:54
我:me、I;我的:my、mine.
1、me
英 [mi] 美 [mi]
pron.(人称代词I的宾格)我
n.自我;自我的一部分;极端自私的人;[音乐]固定唱法时的E音
You misheard me, Frank
弗兰克,你听错了。
2、I
英 [aɪ] 美 [aɪ]
pron.我;个人;利己主义者
n.碘元素;英语字母表中第九个字母;罗马数字1
I already told you not to come over
我已经告诉你别过来了。
3、my
英 [maɪ] 美 [maɪ]
adj.我的(I的所有格形式)
int.啊呀;天啊
John's my best friend
约翰是我最好的朋友。
4、mine
英 [maɪn] 美 [maɪn]
pron.(I的所有格)我的(东西)
n.矿井;矿;地雷;水雷
vt.& vi.在…中开采,开采
vt.在…中[下]布雷;以地雷[水雷]炸毁
That wasn't his fault, it was mine
那不是他的错,是我的错。
扩展资料
我们英文为:we、us
1、us
英 [əs] 美 [ʌs]
pron.我们
They don't like us much
他们不太喜欢我们。
2、we
英 [wi] 美 [wi]
pron.我们,咱们;笔者,本人;朕;人们
We ordered another bottle of champagne
我们又点了一瓶香槟。
热心网友 时间:2022-04-12 21:12
我的英文是I。
一、读音:英 [aɪ],美 [aɪ]
二、意思:
pron. 我
三、例句:
I enjoy the book very much.
我非常喜欢那本书。
四、词汇搭配:
1、I dare say 我敢说
2、for all i care 与我无关
3、I beg your pardon 对不起, 请原谅。
4、for all I know 就我所知
5、and I don't mean maybe 一定要做到
6、I don't care if I do. 好吧,我没意见。
扩展资料:
近义词:me
一、读音:英 [mi:],美 [mi:]
二、意思:
pron. 我(宾格)
三、例句:
He asked me if I would go fishing with him tomorrow.
他问我明天是否和他一起去钓鱼。
四、用法:
me是I的宾格,意思是“我”。在句中多作宾语,在口语中用作表语,可相当于I,还可用于感叹句。
热心网友 时间:2022-04-12 22:46
1.人称代词
对于“我”的英文,语法成分上属于人称代词,在人称代词中“我”有两种格,分别为主格"I"和宾格"me"。它们在句中起不同的作用。
eg:I love you. (人称代词的主格可作主语或表语,此处作主语)
He told me that he loves me. (人称代词的宾格可作主语或表语,此处作宾语)
2.物主代词
对于“我的”的英文,语法成分上属于物主代词,也有两种形式,分别为形容词性物主代词"my"和形容词性物主代词"mine".用法也不同。
eg:This is my pen.(形容词性物主代词相当于形容词,放在名词前作定语)
This pen is mine.(名词性物主代词相当于名词,也相当于“形容词性物主代词+名词”,可作主语,表语或宾语,此处作表语。)
不知道你要问的是“我”还是“我的”,所以我把都列出来了,分别在1,2两点里。关于语法的描述性语言是从语法书里整理下来的,例子是我自己举的,应该比较好懂。希望你能满意哈~热心网友 时间:2022-04-13 00:38
我的原型:I
我的宾格:me
我的形容词性物主代词:mine
我的反身代词:myself
望采纳!热心网友 时间:2022-04-13 02:46
我的英文
I my me we热心网友 时间:2022-04-13 05:10
I.me,myself