Пример #1
0
        public int UpdateNewsViewTab(GZS.Model.news.NewsViewTab newsviewtab, int newsid)
        {
            string sql = "Update NewsViewTab set Title=@title ,Keywords=@keywords,Description=@descript,NewView=@newview,form=@form,Author=@author,Zhaiyao=@zhaiyao where Newsid=@Newsid  ";

            SqlParameter[] ps = new SqlParameter[] {
                new SqlParameter("@title", newsviewtab.Title)
                , new SqlParameter("@keywords", newsviewtab.Keywords)
                , new SqlParameter("@descript", newsviewtab.Description)
                , new SqlParameter("@newview", newsviewtab.NewView)
                , new SqlParameter("@form", newsviewtab.Formid)
                , new SqlParameter("@author", newsviewtab.Author)
                , new SqlParameter("@zhaiyao", newsviewtab.Zhaiyao)
                , new SqlParameter("@Newsid", newsid)
            };
            int result = DBHelper.ExecuteSql(sql, ps);

            return(result);
        }
Пример #2
0
        public GZS.Model.news.NewsViewTab GetNewsViewByNewId(int NewId)
        {
            string sql = "select * from NewsViewTab where Newsid=@newid";

            GZS.Model.news.NewsViewTab newsviewtab = null;
            DataSet set = DBHelper.Query(sql, new SqlParameter("newid", NewId));

            foreach (DataRow row in set.Tables[0].Rows)
            {
                newsviewtab             = new GZS.Model.news.NewsViewTab();
                newsviewtab.NViewID     = Convert.ToInt32(row["NViewID"]);
                newsviewtab.Newsid      = newstab.GetNewsTabByNewId(Convert.ToInt32(row["Newsid"]));
                newsviewtab.Title       = row["Title"].ToString().Trim();
                newsviewtab.Keywords    = row["Keywords"].ToString().Trim();
                newsviewtab.Description = row["Description"].ToString().Trim();
                newsviewtab.NewView     = row["NewView"].ToString().Trim();
                newsviewtab.Formid      = row["form"].ToString().Trim();
                newsviewtab.Author      = row["Author"].ToString().Trim();
                newsviewtab.Zhaiyao     = row["Zhaiyao"].ToString().Trim();
            }
            return(newsviewtab);
        }
Пример #3
0
        public int InsertNewsTab(GZS.Model.news.NewsTab newstab, GZS.Model.news.NewsTypeTab newstypetab, GZS.Model.news.NewsViewTab newsviewtab)
        {
            int rowsAffected = 0;

            SqlParameter[] parameters =
            {
                new SqlParameter("@TypeID",      SqlDbType.Int,           4),
                new SqlParameter("@UserName",    SqlDbType.VarChar,     200),
                new SqlParameter("@NTitle",      SqlDbType.VarChar,     200),
                new SqlParameter("@audit",       SqlDbType.Int,           4),
                new SqlParameter("@FromID",      SqlDbType.Int,           4),
                new SqlParameter("@urlhtml",     SqlDbType.VarChar,     200),
                new SqlParameter("@createdate",  SqlDbType.DateTime),
                new SqlParameter("@title",       SqlDbType.VarChar,     200),
                new SqlParameter("@keywords",    SqlDbType.VarChar,     200),
                new SqlParameter("@description", SqlDbType.VarChar,     200),
                new SqlParameter("@NewView",     SqlDbType.Text,      10000),
                new SqlParameter("@form",        SqlDbType.VarChar,    2000),
                new SqlParameter("@author",      SqlDbType.VarChar,     200),
                new SqlParameter("@zhaiyao",     SqlDbType.VarChar,     200),
                new SqlParameter("@recommendID", SqlDbType.Int,           4),
                new SqlParameter("@ImagesUrls",  SqlDbType.NVarChar, 400)
            };
            parameters[0].Value  = newstab.TypeID;
            parameters[1].Value  = newstab.UserName;
            parameters[2].Value  = newstab.NTitle;
            parameters[3].Value  = newstab.Audit;
            parameters[4].Value  = newstab.FromID;
            parameters[5].Value  = newstab.Urlhtml;
            parameters[6].Value  = newstab.Createdate;
            parameters[7].Value  = newsviewtab.Title;
            parameters[8].Value  = newsviewtab.Keywords;
            parameters[9].Value  = newsviewtab.Description;
            parameters[10].Value = newsviewtab.NewView;
            parameters[11].Value = newsviewtab.Formid;
            parameters[12].Value = newsviewtab.Author;
            parameters[13].Value = newsviewtab.Zhaiyao;
            parameters[14].Value = newstab.RecommendID;
            parameters[15].Value = newstab.Imagesurls;

            DBHelper.RunProcedure("NewsTab_Insert", parameters, out rowsAffected);
            return(rowsAffected);
        }
Пример #4
0
 public int InsertNewsTab(GZS.Model.news.NewsTab newstab, GZS.Model.news.NewsTypeTab newstypetab, GZS.Model.news.NewsViewTab newsviewtab)
 {
     return(newstabdal.InsertNewsTab(newstab, newstypetab, newsviewtab));
 }
Пример #5
0
 public int UpdateNewsViewTab(GZS.Model.news.NewsViewTab newsviewtab, int newsid)
 {
     return(newsviewtabdal.UpdateNewsViewTab(newsviewtab, newsid));
 }
Пример #6
0
        /// <summary>
        ///创建贷款静态页面
        /// </summary>
        public int StaticHtml(int newsid, string loginname)
        {
            try
            {
                string TempFileName = CasesTem.ToString();
                string Tem          = Compage.Reader(TempFileName); //读取模板内容

                string TempSoure = Tem;
                GZS.Model.news.NewsTab     newstab     = newstabbll.GetNewsTabByNewId(newsid);
                GZS.Model.news.NewsViewTab newsviewtab = newsviewtabbll.GetNewsViewByNewId(newsid);
                string   titlelist = sethtmls();
                string   context   = sethtml();
                string   tupianss  = newstab.Imagesurls;
                string   tupians   = "";
                string[] num       = tupianss.Split('$');
                for (int t = 0; t < num.Length; t++)
                {
                    if (num[t].Trim() != "")
                    {
                        tupians += "<input type=\"image\" id=\"" + num[t].Trim() + "\" src=\"" + tupianlu + "" + num[t].Trim() + "\"/>";
                    }
                }

                string contextname = newsviewtab.NewView.ToString().Replace("/images/", "crm.topfo.com/images/").ToString();
                TempSoure = TempSoure.Replace("$infoID$", newsid.ToString().Trim());
                TempSoure = TempSoure.Replace("$NewsTitle$", newstab.NTitle.ToString().Trim());
                TempSoure = TempSoure.Replace("$Createtime$", newstab.Createdate.Substring(0, 9).Trim());
                TempSoure = TempSoure.Replace("$FormId$", newsviewtab.Formid.ToString().Trim());
                TempSoure = TempSoure.Replace("$Author$", newsviewtab.Author.ToString().Trim());
                TempSoure = TempSoure.Replace("$ZhaiYao$", newsviewtab.Zhaiyao.ToString().Trim());
                TempSoure = TempSoure.Replace("$NewsView$", contextname);
                TempSoure = TempSoure.Replace("$tupian$", tupians);
                TempSoure = TempSoure.Replace("$TitleList$", titlelist.ToString().Trim());
                TempSoure = TempSoure.Replace("$Context$", context.ToString().Trim());
                TempSoure = TempSoure.Replace("$DisplayTitle$", newsviewtab.Title.ToString().Trim());
                TempSoure = TempSoure.Replace("$KeyWord$", newsviewtab.Keywords.ToString().Trim());
                TempSoure = TempSoure.Replace("$description$", newsviewtab.Description.ToString().Trim());



                string inPathTo = "/news";

                string   htmlFile = newstab.Urlhtml.ToString().Trim();
                string[] html     = htmlFile.Split('/');
                string[] nn       = html[2].Split('_');
                string   cc       = nn[0].Substring(nn[0].Length - 8);

                string wenjian = MerchantTmpPathTo + html[1].Replace("news", "");
                if (Directory.Exists(wenjian) == false)
                {
                    Directory.CreateDirectory(wenjian);
                }

                string htmlpaths = wenjian + inPathTo + cc + "_" + newsid + ".shtml";
                Compage.Writer(htmlpaths, TempSoure);
                return(1);
            }

            catch (Exception e)
            {
                return(0);
            }
        }