public void InsertFilm(FilmInfo item) { var dt = MtimeHelper.Query("select * from FilmInfo where 1!=1").Tables[0]; var dateNow = DateTime.Now; DataRow dr = dt.NewRow(); dr["FilmName"] = item.FilmName.Transferred(); dr["FilmTypes"] = item.FilmTypes.Transferred(); dr["FilmLenth"] = item.FilmLenth; dr["FilmDirector"] = item.FilmDirector.Transferred(); dr["FilmActor"] = item.FilmActor.Transferred(); dr["FilmBrief"] = item.FilmBrief.Transferred(); dr["FilmYear"] = item.FilmYear; dr["FilmOtherName"] = item.FilmOtherName.Transferred(); dr["CreateDate"] = DateTime.Now; dr["FilmCountry"] = item.FilmCountry.Transferred(); dr["FilmScreenwriter"] = item.FilmScreenwriter.Transferred(); dr["Mtime_FilmID"] = item.Mtime_FilmID; dr["FilmPic"] = item.FilmPic.Transferred(); dr["ShangYing"] = item.ShangYing; dr["ZhiShi"] = item.ZhiShi.Transferred(); dr["FilmHref"] = item.FilmHref.TrimStr(); dt.Rows.Add(dr); MtimeHelper.BulkToDB("FilmInfo", dt); }
public static DataTable GetAsyncRow() { //return MtimeHelper.Query(@"select ID, DetailUrl from Mtime_Film a LEFT JOIN FilmInfo b ON a.ID=b.Mtime_FilmID // WHERE b.Mtime_FilmID IS NULL // order by ID asc").Tables[0]; return(MtimeHelper.Query(@"select ID, DetailUrl from Mtime_Film where ID>(select max(Mtime_FilmID) from FilmInfo)").Tables[0]); }
public override DataTable GetAsyncTable() { //return MtimeHelper.Query(@"select a.FilmID,a.Filmhref+'fullcredits.html' FilmHref,a.FilmName from FilmInfo a left join Actor b on a.FilmID =b.FilmID // where b.FilmID is null // order by a.FilmID asc").Tables[0]; return(MtimeHelper.Query(@" select a.FilmID,a.Filmhref+'fullcredits.html' FilmHref,a.FilmName from FilmInfo a where filmID>( select max(FilmID) from Actor)").Tables[0]); }
public void InsertDB(string name, int filmID, string jgType, string diqu) { var dt = MtimeHelper.Query("select * from 机构表 where 1!=1").Tables[0]; var dateNow = DateTime.Now; DataRow dr = dt.NewRow(); dr["公司名称"] = name.Replace(" ", ""); dr["FilmID"] = filmID; dr["机构类别"] = jgType; dr["地区"] = string.IsNullOrEmpty(diqu) ? "" : diqu; dt.Rows.Add(dr); MtimeHelper.BulkToDB("机构表", dt); }
private void InsertHref(string href, int level) { Console.WriteLine("已经发现" + ++count + "个行政区划"); var dt = MtimeHelper.Query("select * from 地区Href where 1!=1").Tables[0]; var dateNow = DateTime.Now; DataRow dr = dt.NewRow(); dr["Href"] = href; dr["AreaLevel"] = level; dr["CreateDate"] = DateTime.Now; dt.Rows.Add(dr); MtimeHelper.BulkToDB("地区Href", dt); }
public void InsertDB(List <Movie> movies, int year) { var dt = MtimeHelper.Query("select * from Mtime_Film where 1!=1").Tables[0]; var dateNow = DateTime.Now; foreach (var item in movies) { DataRow dr = dt.NewRow(); dr["FilmName"] = item.FilmName; dr["PicUrl"] = item.PicUrl; dr["DetailUrl"] = item.DetailUrl; dr["Page"] = item.Page; dr["Year"] = year; dt.Rows.Add(dr); } MtimeHelper.BulkToDB("Mtime_Film", dt); }
private void InsertDB(Area item) { var dt = MtimeHelper.Query("select * from 地区表 where 1!=1").Tables[0]; var dateNow = DateTime.Now; DataRow dr = dt.NewRow(); dr["地名"] = string.IsNullOrEmpty(item.地名) ? "" : item.地名; dr["隶属"] = string.IsNullOrEmpty(item.隶属) ? "" : item.隶属; dr["行政代码"] = string.IsNullOrEmpty(item.行政代码) ? "" : item.行政代码; dr["代码前6位"] = string.IsNullOrEmpty(item.代码前6位) ? "" : item.代码前6位; dr["辖区面积"] = string.IsNullOrEmpty(item.辖区面积) ? "" : item.辖区面积; dr["人口密度"] = string.IsNullOrEmpty(item.人口密度) ? "" : item.人口密度; dr["人口数量"] = string.IsNullOrEmpty(item.人口数量) ? "" : item.人口数量; dr["邮政编码"] = string.IsNullOrEmpty(item.邮政编码) ? "" : item.邮政编码; dt.Rows.Add(dr); MtimeHelper.BulkToDB("地区表", dt); }
public void InsertDB(List <Actor> act) { var dt = MtimeHelper.Query("select * from Actor where 1!=1").Tables[0]; var dateNow = DateTime.Now; foreach (var item in act) { DataRow dr = dt.NewRow(); dr["ActorName"] = string.IsNullOrEmpty(item.ActorName) ? "无" : item.ActorName.Transferred(); dr["ActorHref"] = string.IsNullOrEmpty(item.ActorHref) ? "无" : item.ActorHref.Transferred(); dr["ActorType"] = string.IsNullOrEmpty(item.ActorType) ? "无" : item.ActorType.Transferred(); dr["FilmName"] = string.IsNullOrEmpty(item.FilmName) ? "无" : item.FilmName.Transferred(); dr["FilmID"] = item.FilmID; dr["CreateDate"] = DateTime.Now; dt.Rows.Add(dr); } MtimeHelper.BulkToDB("Actor", dt); }
public void InsertDB(ActorDetail act) { var dt = MtimeHelper.Query(@"SELECT * FROM [dbo].[ActorDetail] where 1!=1").Tables[0]; var dateNow = DateTime.Now; DataRow dr = dt.NewRow(); dr["ActorID"] = string.IsNullOrEmpty(act.ActorID) ? "无" : act.ActorID; dr["ActorName"] = string.IsNullOrEmpty(act.ActorName) ? "无" : act.ActorName.Transferred(); dr["ActorOtherName"] = string.IsNullOrEmpty(act.ActorOtherName) ? "无" : act.ActorOtherName.Transferred(); dr["ActorHref"] = string.IsNullOrEmpty(act.ActorHref) ? "无" : act.ActorHref.Transferred(); dr["ActorType"] = string.IsNullOrEmpty(act.ActorType) ? "无" : act.ActorType.Transferred(); dr["ActorBirth"] = act.ActorBirth; dr["ActorPic"] = string.IsNullOrEmpty(act.ActorPic) ? "无" : act.ActorPic.Transferred(); dr["FilmID"] = act.FilmID; dt.Rows.Add(dr); MtimeHelper.BulkToDB("ActorDetail", dt); }
public override DataTable GetAsyncTable() { return(MtimeHelper.Query("select * from 地区Href where ID>( select isnull(max(ID),0) from 地区表) order by ID asc").Tables[0]); }
public override DataTable GetAsyncTable() { return(MtimeHelper.Query("select FilmID,Filmname,FilmHref+'details.html#company' FilmHref from FilmInfo where FilmID>(select isnull(max(FilmID),0) from 机构表)").Tables[0]); }
/// <summary> /// 下载页面 /// </summary> /// <param name="url"></param> /// <returns></returns> public override DataTable GetAsyncTable() { return(MtimeHelper.Query(@"select * from (select row_number()over(partition by Actorhref order by ActorID asc) num,* from Actor )tab where tab.num=1 and ActorID>=(select (isnull(max(ActorID),0)+1)ActorID from ActorDetail) order by ActorID asc").Tables[0]); }